jya-dev / supernote-tool

Unofficial python tool for Supernote
Apache License 2.0
254 stars 27 forks source link

hitting error due to "unsupported color in the note" #40

Open ariccb opened 4 months ago

ariccb commented 4 months ago

not sure exactly what's causing this - but I know that the note it's always notes that contain a variety of "title" sections in different "color" choices. not sure which style is throwing the error but here it is: i'm on the latest version A6X Chauvet 2.15.29 and using supernote-tool version Version: 0.5.0

returned non-zero exit status 1.
Error output: Traceback (most recent call last):
  File "/opt/homebrew/bin/supernote-tool", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/supernotelib/cmds/supernote_tool.py", line 203, in main
    args.handler(args)
  File "/opt/homebrew/lib/python3.11/site-packages/supernotelib/cmds/supernote_tool.py", line 70, in subcommand_convert
    img = converter.convert(args.number)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/supernotelib/converter.py", line 67, in convert
    return self._convert_layered_page(page, self.palette, visibility_overlay)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/supernotelib/converter.py", line 96, in _convert_layered_page
    img = self._create_image_from_decoder(decoder, binary, palette=palette, blank_hint=all_blank)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/supernotelib/converter.py", line 133, in _create_image_from_decoder
    bitmap, size, bpp = decoder.decode(binary, palette=palette, all_blank=blank_hint)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/supernotelib/decoder.py", line 181, in decode
    uncompressed += self._create_color_bytearray(palette.mode, colormap, colorcode, length)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/supernotelib/decoder.py", line 199, in _create_color_bytearray
    c = colormap[color_code]
        ~~~~~~~~^^^^^^^^^^^^
KeyError: 201

Color code error detected. This may be due to an unsupported color in the note.