Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect Image Type and Covert it #2

Closed
andrasbacsai opened this issue Jun 18, 2021 · 4 comments
Closed

Detect Image Type and Covert it #2

andrasbacsai opened this issue Jun 18, 2021 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@andrasbacsai
Copy link

Trying to cross-post from hashnode to dev.to, but received the following error:

Error occured while cross posting to DEV: Main image is not a valid URL

The image is base64 encoded: Error: Could not load img: "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="

@shahednasser shahednasser added bug Something isn't working help wanted Extra attention is needed labels Jun 18, 2021
@shahednasser
Copy link
Owner

Thank you for reporting this. I guess the approach should be to detect if an image URL is a data URL and then get a URL for it. Another approach would be to allow an option in the CLI to enter an image URL to be used instead of scanning the article for the image.

@sjkorvin
Copy link

Thank you so much for the great tool! I had gotten this problem as well. I had received these errors

Error: Could not load img: "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="

and

Error occured while cross posting to DEV: Main image is not a valid URL

I suppose that for now, I'll be posting on Dev.to and crossposting to Hashnode. Thank you again.

@shahednasser
Copy link
Owner

Hello @sjkorvin thank you for your comment on this. Unfortunately, I haven't been able to get into this due to my busy schedule, but I'm aware of what the problem is.

The tool currently only takes the src of the first image it encounters in an <article> element. Then, that src is used as the URL of the image when posting to the different platforms. It does not check what the type of image is, however, DEV is very particular about the type of images accepted, which causes the error.

I'm hoping that soon either someone will want to be assigned to work on this or I'll get some time to look into it. Maybe adding a few options here and there would more helpful, as well.

@shahednasser shahednasser changed the title Main image is not a valid URL Detect Image Type and Covert it Jul 17, 2021
@shahednasser shahednasser added the good first issue Good for newcomers label Jul 17, 2021
@shahednasser
Copy link
Owner

This issue has now been resolved by providing different options to the tool. You can check the README for more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants