Skip to content

Commit ff255d2

Browse files
committed
modification to enable alpha PNG support
complements of Ivan toy/pHash#3 (comment)
1 parent db60f5d commit ff255d2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/pHash.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,9 @@ int ph_dct_imagehash(const char* file,ulong64 &hash){
369369
if (src.spectrum() == 3){
370370
img = src.RGBtoYCbCr().channel(0).get_convolve(meanfilter);
371371
} else if (src.spectrum() == 4){
372-
int width = img.width();
373-
int height = img.height();
374-
int depth = img.depth();
375-
img = src.crop(0,0,0,0,width-1,height-1,depth-1,2).RGBtoYCbCr().channel(0).get_convolve(meanfilter);
372+
int width = src.width();
373+
int height = src.height();
374+
img = src.crop(0,0,0,0,width-1,height-1,0,2).RGBtoYCbCr().channel(0).get_convolve(meanfilter);
376375
} else {
377376
img = src.channel(0).get_convolve(meanfilter);
378377
}

0 commit comments

Comments
 (0)