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

Incorrect hashing of png #7

Open
jonasob opened this issue Dec 11, 2014 · 3 comments
Open

Incorrect hashing of png #7

jonasob opened this issue Dec 11, 2014 · 3 comments

Comments

@jonasob
Copy link
Member

jonasob commented Dec 11, 2014

This image: https://commons.wikimedia.org/wiki/File:Arius.png

It's getting incorrectly hashed by blockhash-js, which gives a hash of 00ec008bbe80ffbf0000e9f9f8fb80fdffffffffffffffffffffffffffffffff instead of 0ff91ff10ff1000300018fd984d79ddf8e058fc30fc30fc3dfc3c3c303831783 as would be expected (from the C blockhash). The trailing fffff is a tell tale sign of an issue, which look very similar to the issue we had with jpeg where jpeg-js made assumptions about the image being RGB. Could something similar be amiss here?

@chazzmoney
Copy link

This is no longer an issue with the merge of #15, can you close?

@artfwo
Copy link
Member

artfwo commented Mar 31, 2019

I'm still getting 00ec008bfe80ffbf0000f9f9f8fb80fdffffffffffffffffffffffffffffffff for the image above, the issue doesn't look fixed.

@depsypher
Copy link

Looks like this is caused by the png-js lib not handling indexed color images properly. I was able to fix it by switching to a different lib (https://github.com/lukeapage/pngjs):

master...depsypher:master

Not sure if you want a PR, because I couldn't get browserify to work with pngjs, but the existing tests pass as well as producing the correct hash for that Arius.png file.

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

No branches or pull requests

4 participants