-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
[BUG] Changing the files even if the exif is empty #56
Comments
It looks like this is your first issue here – welcome! Please familiarize yourself with the contributing guidelines, if you haven't already. |
Hi @Lee-W, nice to hear from you 😊 Your example mentions moving some images, but you don't provide any examples for me to test. I have also not seen this happen on my machine, so I really need a reproducible example here. If you see the I'm also not seeing an issue with the line you reference. You can confirm this by running the following test, which succeeds because the def test_empty_exif(tmp_path):
image_file = tmp_path / 'test.png'
with Image.new(mode='1', size=(2, 2)) as im:
im.save(image_file)
assert not im.getexif() While the
|
Thank you for your kind words about commitizen on the podcast! 🙌
Any image would failed on my machine 🤔 (a bit more detail below)
Ah, you're right 🤦♂️ By the time I saw the object was returned, I thought this was the root cause, which turns out it is not 🤦♂️ I tested it a bit more and found out it's actually due to exif-stripper/src/exif_stripper/__init__.py Lines 43 to 44 in d387c8b
terminal.app it still fails. Will did into it a bit more and see what's happening
|
I just verified on my machine this |
Hmm, I have the same setup as you (macOS and iTerm). From what I gathered, it is related to the permissions you give to iTerm (see #4 (comment)). Another user mentioned having an issue with a different attribute that I also wasn't able to replicate, so I want to do more research on extended attributes before proceeding. |
I tried to research a bit, but it seems to be an internal thing without an explicit document. (or simply I just did not find it 🥲) But instead of skipping some tags like what I do now in #57. I'm thinking of another solution. The |
That sounds like a better idea, but let's only do it for the extended attributes (xattr). The current behavior will result in being unable to commit images in which we can't remove the EXIF metadata, and that is a behavior I want to preserve. |
sounds good! just removed the exif part and do it on xattr only |
Required attestation
main
branch of exif-stripper.Describe the bug
Exif-stripper cleans and saves image files even when there is no EXIF data to remove, which causes the pre-commit hook to fail.
To Reproduce
The pre-commit keeps showing
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
pillow
version: 11.0.0xattr
version, if not using Windows: 1.1.0Additional context
This is due to
exif-stripper/src/exif_stripper/__init__.py
Line 31 in d387c8b
The text was updated successfully, but these errors were encountered: