-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Description
Hi.
Looks like phashion-1.2.0 doesn't handle exceptions in #mh_fingerprint method, more specifically in pHash C code.
For example, calling #fingerprint on non-existing file produces RuntimeError:
> Phashion::Image.new('/tmp/20251203-6-1qsykyq').fingerprint
[CImg] *** CImgIOException *** [instance(0,0,0,0,(nil),non-shared)] CImg<unsigned char>::load() : Failed to open file '/tmp/20251203-6-1qsykyq'.
RuntimeError: Unknown pHash errorbut calling #mh_fingerprint in the same situation crashes rails console (sigabrt):
> Phashion::Image.new('/tmp/20251203-6-1qsykyq').mh_fingerprint
[CImg] *** CImgIOException *** [instance(0,0,0,0,(nil),non-shared)] CImg<unsigned char>::load() : Failed to open file '/tmp/20251203-6-1qsykyq'.
terminate called after throwing an instance of 'cimg_library::CImgIOException'
what(): [instance(0,0,0,0,(nil),non-shared)] CImg<unsigned char>::load() : Failed to open file '/tmp/20251203-6-1qsykyq'.
ERROR: 134Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels