-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Consider any webp image that was renamed to have the jpg file extension. This happened to my server when someone uploaded such an image.
If I run run the fileHash function on this file I get a Left value. If I try to print this error value it starts to print, but then the program freezes:
Invalid marker used
Invalid Bitmap magic identifier
Invalid Gif signature : RIFFd
After this my code doesn't continue. There is something wrong with evaluating the error value that fileHash gives back. For now I am just ignoring the error message as a work-around.
So there are really two issues here:
- the error value is unsafe to evaluate
- I think fileHash can do a better job of determining the file type by looking at something other than the file extension. This way it can still compute a phash even if the extension is wrong. (if I rename the file everything works).
Metadata
Metadata
Assignees
Labels
No labels