timhuff / canvas-phash

A Canvas-based pHash Implementation
11 stars 3 forks source link

0 phash for small resized images #4

Open sirpy opened 7 years ago

sirpy commented 7 years ago

Thanks for the great package. I've noticed that images that i resize to 200-350(width) get a resulting buffer filled with zeros. the original image or a resized image to width 500 get a normal phash buffer. any ideas? Thanks

timhuff commented 7 years ago

Hi sirpy. Thanks for the compliment. Unfortunately I haven't really looked at this code for about 3 years now and I'm swamped at work. I wish I could be of greater help but I won't have much free time for the next month or so. But if you want to create a pull request containing a simple failing test, that would enable me to at least give it a shot here in the next week or so. Is it any image in the range of 200-350 or is that just an estimate? If so, it might have to do with the number 255 - does it work for images of width 257? 253?

sirpy commented 7 years ago

hey, yes i confirmed that its about the number 255. from width 255 some images get 0 while for 256 they dont