Skip to content

Fix table_to_png image generation#3

Open
StroppaFR wants to merge 1 commit into
PoustouFlan:mainfrom
StroppaFR:fix-table-png
Open

Fix table_to_png image generation#3
StroppaFR wants to merge 1 commit into
PoustouFlan:mainfrom
StroppaFR:fix-table-png

Conversation

@StroppaFR
Copy link
Copy Markdown

This fixes PNG image generation when using -format png. There were some extra commas in the source code.

Before

$ python main.py -in ./examples/toy -lat -format png -out .
./examples/toy 

Linear Approximation Table
Traceback (most recent call last):
  File "/tmp/SUnbox/main.py", line 150, in <module>
    print_table(table, format, filename)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/SUnbox/sunbox/format.py", line 74, in print_table
    output = table_to_png(table)
  File "/tmp/SUnbox/sunbox/format.py", line 64, in table_to_png
    image.putpixel((x, y), color)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/site-packages/PIL/Image.py", line 2214, in putpixel
    return self.im.putpixel(xy, value)
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^
TypeError: color must be int, or tuple of one, three or four elements

After

$ python main.py -in ./examples/toy -lat -format png -out . && file lat_toy.png
./examples/toy 

Linear Approximation Table

lat_toy.png: PNG image data, 16 x 16, 8-bit/color RGB, non-interlaced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant