Skip to content

Commit

Permalink
modification to enable alpha PNG support
Browse files Browse the repository at this point in the history
complements of Ivan
toy/pHash#3 (comment)
  • Loading branch information
westonplatter committed Nov 25, 2013
1 parent db60f5d commit ff255d2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pHash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,9 @@ int ph_dct_imagehash(const char* file,ulong64 &hash){
if (src.spectrum() == 3){
img = src.RGBtoYCbCr().channel(0).get_convolve(meanfilter);
} else if (src.spectrum() == 4){
int width = img.width();
int height = img.height();
int depth = img.depth();
img = src.crop(0,0,0,0,width-1,height-1,depth-1,2).RGBtoYCbCr().channel(0).get_convolve(meanfilter);
int width = src.width();
int height = src.height();
img = src.crop(0,0,0,0,width-1,height-1,0,2).RGBtoYCbCr().channel(0).get_convolve(meanfilter);
} else {
img = src.channel(0).get_convolve(meanfilter);
}
Expand Down

0 comments on commit ff255d2

Please sign in to comment.