Skip to content

Issues saving a displayio.Bitmap #21

Closed
@caternuson

Description

@caternuson

I think this was introduced with #14. Just run library example to demonstrate:

Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit PyPortal with samd51j20
>>> import bitmapsaver_simpletest
Setting up SD card
Building sample bitmap and palette
Saving bitmap
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "bitmapsaver_simpletest.py", line 54, in <module>
  File "adafruit_bitmapsaver.py", line 142, in save_pixels
  File "adafruit_bitmapsaver.py", line 140, in save_pixels
  File "adafruit_bitmapsaver.py", line 102, in _write_pixels
NameError: local variable referenced before assignment
>>>  

If a bitmap is passed in, result_buffer is not used, but the resetting of result_buffer is happening outside that logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions