mzucker / noteshrink

Convert scans of handwritten notes to beautiful, compact PDFs
https://mzucker.github.io/2016/09/20/noteshrink.html
MIT License
4.81k stars 351 forks source link

ValueError: cannot reshape array of size 1 into shape (3) #21

Closed tneupaney closed 1 year ago

tneupaney commented 6 years ago

Got this error while running. I wanted to work on a small bill I got from a grocery shop.

./noteshrink.py bill.jpg opened bill.jpg Traceback (most recent call last): File "./noteshrink.py", line 587, in <module> main() File "./noteshrink.py", line 584, in main notescan_main(options=get_argument_parser().parse_args()) File "./noteshrink.py", line 559, in notescan_main samples = sample_pixels(img, options) File "./noteshrink.py", line 342, in sample_pixels pixels = img.reshape((-1, 3)) ValueError: cannot reshape array of size 1 into shape (3)

clapautius commented 5 years ago

I got the same error with files that were post-processed and some EXIF fields were incorrect / not updated.

As a workaround, try to remove the EXIF metadata from file (e.g. using exiftool -all= -overwrite_original FILE.

tneupaney commented 1 year ago

Thank you