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

Add imagehash v4 links #14

Merged
merged 3 commits into from
Apr 11, 2018
Merged

Conversation

bjlittle
Copy link
Member

@bjlittle bjlittle commented Apr 1, 2018

This PR converts all of the relevant images/*.png from old hash filenames to new imagehash 4.0 hash filenames within the images/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.

@pelson
Copy link
Member

pelson commented Apr 11, 2018

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...

Copy link
Member

@pelson pelson left a 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)
Copy link
Member

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?

Copy link
Member Author

@bjlittle bjlittle Apr 11, 2018

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?

@pelson pelson merged commit fb3b96b into SciTools:gh-pages Apr 11, 2018
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.

2 participants