CODAIT / magicat

🧙😺 magicat - Deep learning magic.. with the convenience of cat!
Apache License 2.0
26 stars 5 forks source link

Improve error output for invalid input images #5

Closed ptitzler closed 4 years ago

ptitzler commented 5 years ago

One of my directories contains a number of files with a jpg or png extension.

magicat ~/Downloads/
Scanning directory '/Users/patti/Downloads'...

error building response map - error preprocessing image - Error: Could not find MIME for Buffer <null>

Turns out, one of the files, e.g. abc.jpg, wasn't an actual image but a text document. It took me a while to figure out which file was causing the issue. If an error is raised the message should identify the image that was causing it, to make it easier to troubleshoot in situations where magicat is used to process a large collection of images.

vabarbosa commented 4 years ago

resolved in PR #11

feel free to re-open if further changes are needed

image