Skip to content

Reuse images: change ImageRun keys to be based on image data content #2681

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

Merged
merged 4 commits into from
Oct 11, 2024

Conversation

mustache1up
Copy link
Contributor

@mustache1up mustache1up commented May 5, 2024

In order to generate only one media file for repeated images with the same data the uniqueId of the image can be based on the image data SHA1 digest (same strategy git uses internally).

Fixes #2680 and #849

@dolanmiu
Copy link
Owner

dolanmiu commented Oct 9, 2024

This seems like a good idea

But the dependency doesn't seem to be maintained?

https://github.com/indutny/hash.js

Edit: The library seems promising somewhat, as it works for both Node and Browser

Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (048a035) to head (041e9cb).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2681   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          281       281           
  Lines        14091     14097    +6     
  Branches      1379      1382    +3     
=========================================
+ Hits         14091     14097    +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dolanmiu dolanmiu merged commit e86dbd3 into dolanmiu:master Oct 11, 2024
8 checks passed
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.

Repeated images are written several times
3 participants