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

fix: check whether xattr is changed before and after clear #57

Merged

Conversation

Lee-W
Copy link
Contributor

@Lee-W Lee-W commented Nov 3, 2024

Fixes #56

Describe your changes

Why
Some extend attributes cannot be removed in certain setups on macOS, which would cause
the file being modified meaninglessly

Checklist

  • Test cases have been modified/added to cover any code changes.
  • Docstrings have been modified/created for any code changes.
  • All linting and formatting checks pass (see the contributing guidelines for more information).

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulations on making your first pull request to exif-stripper! Please familiarize yourself with the contributing guidelines, if you haven't already.

Copy link

codecov bot commented Nov 3, 2024

Codecov Report

Attention: Patch coverage is 76.19048% with 5 lines in your changes missing coverage. Please review.

Project coverage is 95.90%. Comparing base (d387c8b) to head (7a4cf48).
Report is 2 commits behind head on main.

Current head 7a4cf48 differs from pull request most recent head 6b471d3

Please upload reports for the commit 6b471d3 to get more accurate results.

Files with missing lines Patch % Lines
tests/test_cli.py 72.72% 3 Missing ⚠️
src/exif_stripper/__init__.py 80.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##              main      #57      +/-   ##
===========================================
- Coverage   100.00%   95.90%   -4.10%     
===========================================
  Files            3        3              
  Lines          105      122      +17     
===========================================
+ Hits           105      117      +12     
- Misses           0        5       +5     
Files with missing lines Coverage Δ
src/exif_stripper/__init__.py 93.75% <80.00%> (-6.25%) ⬇️
tests/test_cli.py 96.05% <72.72%> (-3.95%) ⬇️

@Lee-W Lee-W marked this pull request as draft November 4, 2024 05:58
@Lee-W Lee-W force-pushed the skip-cleaning-if-there-re-no-metadata-to-clean branch from 5dc73e2 to 69121e0 Compare November 4, 2024 13:39
@Lee-W Lee-W changed the title fix: Skip exif clearing if there're no exif data in an image fix: ignore com.apple.provenance in xattr as it should not be removed on macOS Nov 4, 2024
@Lee-W Lee-W marked this pull request as ready for review November 4, 2024 13:43
src/exif_stripper/__init__.py Outdated Show resolved Hide resolved
src/exif_stripper/__init__.py Outdated Show resolved Hide resolved
@Lee-W Lee-W force-pushed the skip-cleaning-if-there-re-no-metadata-to-clean branch from 69121e0 to 78e00ad Compare November 5, 2024 14:52
@Lee-W Lee-W changed the title fix: ignore com.apple.provenance in xattr as it should not be removed on macOS fix: check whether xattr is changed before and after clear Nov 5, 2024
@Lee-W Lee-W force-pushed the skip-cleaning-if-there-re-no-metadata-to-clean branch 2 times, most recently from b3aaa0c to 96d8716 Compare November 5, 2024 14:55
@Lee-W Lee-W requested a review from stefmolin November 5, 2024 15:09
src/exif_stripper/__init__.py Outdated Show resolved Hide resolved
src/exif_stripper/__init__.py Outdated Show resolved Hide resolved
src/exif_stripper/__init__.py Outdated Show resolved Hide resolved
tests/test_cli.py Outdated Show resolved Hide resolved
tests/test_cli.py Show resolved Hide resolved
@Lee-W Lee-W force-pushed the skip-cleaning-if-there-re-no-metadata-to-clean branch from 96d8716 to f3b6236 Compare November 6, 2024 01:17
Some extend attributes cannot be removed in certain setups on macOS, which would cause
the file being modified meaninglessly
@Lee-W Lee-W force-pushed the skip-cleaning-if-there-re-no-metadata-to-clean branch from f3b6236 to 097eeb1 Compare November 7, 2024 01:04
@Lee-W Lee-W requested a review from stefmolin November 12, 2024 13:27
tests/test_cli.py Outdated Show resolved Hide resolved
@stefmolin stefmolin merged commit 908af8b into stefmolin:main Nov 13, 2024
20 checks passed
@stefmolin
Copy link
Owner

Thanks, @Lee-W!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Changing the files even if the exif is empty
2 participants