-
Notifications
You must be signed in to change notification settings - Fork 124
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
Getting different hashes on bit-for-bit identical PNGs #39
Comments
@McGeekiest which phashion version are you on? |
@westonplatter 1.0.6 |
ah, I think I know what the problem is. We made a custom patch to the pHash C library that was released in gem version 1.0.8. The README describes this more, https://github.com/westonplatter/phashion#gem-uses-customized-phash-096. I'll be pushing an updated 1.1 version this weekend. Until then, you could reference the GitHub master branch. In case it's helpful, more info about how to do that here, #32 (comment). |
Thanks for the help so far, @westonplatter! $ bundle show | grep phashion
* phashion (1.0.8 2c6d8c9) ... then I get the same problem in a Rails console. Curiously, the fingerprints on both files differ every time I run the code, as do the hamming distances. I thought maybe there was just an invocation problem; glad to know I wasn't missing something obviously obvious (as it were). :-) Can I provide any other information to help? I'm on Rails 4.0.2 under Ubuntu Saucy, to start with. |
Oh, hello! Based on the hints in the README, I tried: $ convert 0_0.png -alpha remove 1_0.png
$ convert 0_1.png -alpha remove 1_1.png Now it works on the two new PNGs. It's apparently an alpha thing. I'll just write a script to strip alpha information from the PNGs. |
Nice solution. Sorry @McGeekiest. That's frustrating. I'll have test that and add tests to prove we're catching the alpha-png/regular pngs. Could you send the png images you're using to test? email = my github username [at] gmail |
@westonplatter Done. Let me know if I can help further. |
@McGeekiest tested alpha png images you sent locally, and Phashion said they were duplicates. :(. I'll update the readme, and talk with @toy to see if he's had coontinued problems with alpha PNGs. Thanks for the help! |
I'am using phashion 1.2.0 and have encountered a similar problem, the same png image has a different fingerprint, and the console occasionally output:
|
With two files, shown to be identical via diff, I am getting dramatically different hash values:
Results in:
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: