-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add imagehash v4 links #14
Conversation
FWIW, you don't need to worry about the git repository size when you have two identical files in a repository: https://stackoverflow.com/a/29949004/741316 It definitely helps for user checkouts though... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me.
I don't fully have the bigger picture just yet, but from an incremental change perspective, no objections 👍
@@ -15,7 +15,7 @@ class TestHash(unittest.TestCase): | |||
def test(self): | |||
self.maxDiff = None | |||
exceptions = [] | |||
for fname in glob.glob("images/*.png"): | |||
for fname in glob.glob("images/v4/*.png"): | |||
phash = imagehash.phash(Image.open(fname), hash_size=_HASH_SIZE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have the ability to pass the phash version to the function, or does imagehash not maintain backwards compatible image hashing functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a breaking change moving to v4. There's no way to generate the old hash from v4, hence the test coverage is only on the new images using the new imagehash v4.
To test the old hashes we'd need to install the pre-v4 imagehash ... and I'm kinda loathed to do that. Is that a safe approach to take?
This PR converts all of the relevant
images/*.png
from old hash filenames to newimagehash 4.0
hash filenames within theimages/v4
directory.In order not to unnecessarily bloat the repo, the new hash filenames link to their associated old hash filename.
Note that, the new hash filename
fa81857e857e7a81857e7a817a81857a7a81857e857e7a85857e7a817a81857a.png
has been added to correct a new failing test.