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

TypeError: only integer arrays with one element can be converted to an index #17

Open bitwave opened 7 years ago

bitwave commented 7 years ago

got this weird error:

  getting palette...
/usr/lib/python3.6/site-packages/noteshrink.py:132: RuntimeWarning: invalid value encountered in true_divide
  saturation = delta.astype(np.float32) / cmax.astype(np.float32)
  applying palette...
  saving page0000.png...
Traceback (most recent call last):
  File "/usr/bin/noteshrink", line 11, in <module>
    load_entry_point('noteshrink==0.1.1', 'console_scripts', 'noteshrink')()
  File "/usr/lib/python3.6/site-packages/noteshrink.py", line 584, in main
    notescan_main(options=get_argument_parser().parse_args())
  File "/usr/lib/python3.6/site-packages/noteshrink.py", line 564, in notescan_main
    save(output_filename, labels, palette, dpi, options)
  File "/usr/lib/python3.6/site-packages/noteshrink.py", line 455, in save
    output_img.putpalette(palette.flatten())
  File "/usr/lib/python3.6/site-packages/PIL/Image.py", line 1483, in putpalette
    data = bytes(data)
TypeError: only integer arrays with one element can be converted to an index

Maybe this is a python3.6 problem

Regards, bitwave