-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Cannot use 'keep'. jpg not recognized as jpg #4036
Comments
Thank you for the report. That's quite a bit of code, please could you reduce it to the smallest self-contained, runnable amount that still reproduces the problem? Tips here: |
so i think i found the problem. this is what happens. im = Image.open(path)
print(im.format) JPEG imResize = im.resize((500,500), Image.ANTIALIAS)
print(imResize.format) None somehow after the only question is: if the None format is intended behavior or not? test code from PIL import Image
Image.MAX_IMAGE_PIXELS = None
path = "C:/Users/KE/Desktop/omas 80 Panting Images/IMG_7679.jpg"
im = Image.open(path)
print(im.format)
## this won't work
# imResize = im.resize((500,500), Image.ANTIALIAS)
##this will work
im.thumbnail((500,500))
imResize = im
print(imResize.format)
nupath = path.replace("IMG_7679", "IMG_7679_resized")
imResize.save(nupath, 'JPEG', quality='keep') |
Yes. So |
https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.format
|
okey. makes sense. |
Cool. Enjoy continuing to use Pillow. Let us know if you have any further questions |
i was trying to resize images and keep the quality setting.
with quality set to a digit it works fine.
probably similar to issue:
#857
i suspect i have some sort of jpg type that is also not recognized as jpg, just like in the issue.
so i added it inside a zip.
What are your OS, Python and Pillow versions?
IMG_7679.zip
The text was updated successfully, but these errors were encountered: