Release v0.4.8: dedupe re-copied images#14
Merged
Conversation
Image entries used a random UUID as their stored reference, so copying the same image again never matched an existing entry and stacked as a duplicate. Derive the reference id from the image content (dimensions + FNV-1a fingerprint) so identical images map to the same id: history now dedupes the re-copy, bumps its copy count, and moves it to the top, while reusing the on-disk PNG instead of writing a new file each time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Copying the same image twice added a second history entry instead of moving the existing one to the top. Image entries stored a random UUID as their reference id, so two copies of the same image never compared equal and stacked as duplicates. (Text already deduped correctly.)
How
Derive the image reference id from the image content itself -
img-{width}x{height}-{fnv1a-fingerprint}- instead of a random UUID. Identical images now map to the same id, so:Added unit tests: identical images share a ref id; different content or dimensions do not collide.
Also bumps the workspace version 0.4.7 -> 0.4.8 and corrects the app size / RAM figures on the marketing site and press page.