-
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
PNGs always give the same fingerprint, JPGs work fine #20
Comments
I see that exact fingerprint too. |
@fny: Today I noticed that my system is giving me strange behaviour on other PNGs I try to process to. Mine is libpng/1.5.14 installed through Homebrew on OSX 10.9 |
Identical. I'll give this a shot on an Ubuntu install. |
I had the problem that RMagick wouldn't crop my PNGs right. |
I got the same problem (OSX 10.9, ruby-2.0.0p247, libpng through macports) but only for png-files with alpha channels. So I guess this issue is related to #11 |
Did anybody try Linux so far? |
@toadle I tried running tests I added (55f1a26) on linux (Ubuntu 12.04 with libpng12-dev 1.2.46-3ubuntu4). fingerprints from Phashion::Image#fingerprint
-
image 1 fingerprint 1 = 3897734968558088698
image 2 fingerprint 2 = 54086765383280
image 3 fingerprint 3 = 54086765383280
image 3 fingerprint 4 = 3897734968558088698
fingerprints from Phashion::Image.get_fingerprint
-
image 1 fingerprint 1 = 3897734968558088698
image 2 fingerprint 2 = 54086765383280
image 3 fingerprint 3 = 54086765383280
image 1 fingerprint 4 = 3897734968558088698 I expect fingerprint 1 and 4 to be the same they are derived from the same png. But I expect images 2 and 3s' fingerpints to be different. They are the same. |
@toadle I should add that I got the same result on mac too (libpng/1.5.14 via homebrew). Not sure where to go next. I'll dig into the C in the couple days. All and any ideas are welcome! |
MMh, so the fingerprint of the PNGs that don't give the right fingerprint seems always to be "54086765383280". See my example above. I'd suspect that this is a certain PNG-type that causes this. Perhaps the root cause is already in the phash-library? |
@westonplatter Did you have a chance to check it out? |
@toadle i haven't dug into the C/C++ code. Did you see anything on the pHash website (http://www.phash.org/) specifying limitations? I read through it, but did not see file type compatibilities. I noticed on their demo page, they only JPEG and BMP file types. Maybe this was intentional? I also saw a comment on another Ruby gem project stating that pHash is not compatible with PNGs. Regardless, I sent an email to the pHash support group (http://www.phash.org/support/). I will update this thread with the response. |
I haven't read anything about a limitation, but I just verified the "Zero data"-problem with my local problematic files. In fact I can get PNGs to work, if there is no alpha channel. See this:
So it seems this is really a problem deep down in the phash-library. I can provide the test-data, if you want. |
Have you guys considered this might be a libphash bug and seeing if there is a newer version?
|
Well from all I can see it IS in fact a phash-bug. Current version of phash is still the same on their website. |
Has someone opened an issue with the project?
|
@mperham Yes. This guy: toy/pHash#3 (comment) |
Too bad the maintainer is unresponsive. Fork and fix. Maybe you can get the maintainer to bless a new maintainer like I turned over maintenance of phashion.
|
@mperham I would try and patched this into phashion myself, but I've never built a gem so far. So I'm too rookie here. |
@westonplatter Have you seen this? toy/pHash#3 (comment) Possible fix at hand. |
Phashion vendors its own copy of libphash so you just need to update the code in the tarball. It's not ideal but possible.
|
@toadle I talked with Evan, the pHash mantainer. He said he would pull in the patch (westonplatter/phash@ff255d2) and republish to the official pHash lib.
My thought was to provide a temporary solution via this branch, /~https://github.com/westonplatter/phashion/tree/temp-png-fix, and then republish the phashion gem once the offiicial pHash update comes. Does this solution meet your needs? Feel free to suggest something else. |
@westonplatter Works for me already. I decided to always convert my stuff to JPG, therefore I can already work now. If I could decide for phashion, I did release the fix and release again, when the new phash-relase comes out, since we don't know when those guys will come around (when was their last release? 2010?). But thats more work I think. How could I install the branched version of the gem? |
Hey there,
I just found this little gem and would really like to use it in own of my projects. Sadly I got the problem that every PNG gives me the same fingerprint hash. I have to convert my files to JPG in order to get a usable value.
A I doing something work or might this be a bug?
The text was updated successfully, but these errors were encountered: