jmd_imagescraper icon indicating copy to clipboard operation
jmd_imagescraper copied to clipboard

PNG Images Not Showing Up

Open ThePieMonster opened this issue 3 years ago • 7 comments
trafficstars

It seems only JPG images are showing up. Why are PNG images not allowed?

ThePieMonster avatar Aug 06 '22 18:08 ThePieMonster

ImgType defaults to Photo to filter out clipart and GIFs, it's probably responsible. Try setting it to All instead

joedockrill avatar Aug 06 '22 21:08 joedockrill

What do you mean try setting it to "all" @joedockrill ?

Current code is below:

display_image_cleaner(root_path)

ThePieMonster avatar Aug 06 '22 22:08 ThePieMonster

When you run the search, not when you display the results.

duckduckgo_search(root_path, "Nice", "nice clowns", img_type=ImgType.All)

It defaults that way because this was written for creating deep learning datasets and I didn't want clipart and GIFs. If you're doing something else then you may want to run the search differently.

It'll return whatever the search does. If you particularly want PNGs you can try ImgType.Transparent and see if those results suit your needs better.

Read the docs. https://joedockrill.github.io/jmd_imagescraper/core.html

joedockrill avatar Aug 07 '22 09:08 joedockrill

@joedockrill I already have PNGs in the folder. What I am saying is that PNGs do not show up in the image viewer, only JPGs. You can see in Colabs file browser that there are PNGs in the folder but are not being displayed by display_image_cleaner(root_path).

ThePieMonster avatar Aug 07 '22 17:08 ThePieMonster

Oh yeah, that's my fault, but I don't have a PC/laptop at the moment to be able to rebuild the library.

Are you on the fastai forums? If you can find someone who knows nbdev and is prepared to fix it then it's a trivial change to one function, but otherwise I'm afraid it'll stay broken for now.

joedockrill avatar Aug 07 '22 19:08 joedockrill

icln_render_batch needs fixing at line 137, extend files array with *.png, *.gif etc

joedockrill avatar Aug 07 '22 19:08 joedockrill

@joedockrill

icln_render_batch needs fixing at line 137, extend files array with *.png, *.gif etc

Thank you for re-opening. I am not familiar with those forums but can wait for someone to provide a fix / new build.

ThePieMonster avatar Aug 07 '22 22:08 ThePieMonster