Conversation
Use original image instead of converted jpeg. Detect correct extension.
|
Hey there! Thanks for the suggestion and pull request! I'm afraid I cannot accept this PR though, as imghdr is deprecated and schedulled to be removed with the next version of Python, which is releasing next month. Thankfully, what you want is easy, since the original file extension is part of the URL. I have updated this, so please check out da157d2 . In this commit I have changed the default behaviour to download all images in their original format, while also allowing for a different extension specified via command line argument. Feel free to check the README on how to use. Great suggestion nevertheless, I have credited you in the README too, thank you! Let me know if there's anything else! |
|
I'm still suggesting not using Image.save() as it reencodes source image with poorer quality. |
|
Oh I didn't know that, makes sense that it reencodes if pillow doesn't know what the original extension is. Updated with commit 2f11f20 to write the bytes directly to the file if extension not specified or if specified extension matches the original. Many thanks again, I learned something new! |
Use original image instead of converted jpeg. Detect correct extension.