@@ -91,6 +91,7 @@ def _write_pixels(output_file, pixel_source, palette):
91
91
saving_bitmap = isinstance (pixel_source , Bitmap )
92
92
width , height = _rotated_height_and_width (pixel_source )
93
93
row_buffer = bytearray (_bytes_per_row (width ))
94
+ result_buffer = bytearray (2048 )
94
95
for y in range (height , 0 , - 1 ):
95
96
buffer_index = 0
96
97
if saving_bitmap :
@@ -102,7 +103,7 @@ def _write_pixels(output_file, pixel_source, palette):
102
103
color >>= 8
103
104
buffer_index += 1
104
105
else :
105
- data = pixel_source .fill_area ( x = 0 , y = y - 1 , width = width , height = 1 )
106
+ data = pixel_source .fill_row ( y - 1 , result_buffer )
106
107
for i in range (width ):
107
108
pixel565 = (data [i * 2 ] << 8 ) + data [i * 2 + 1 ]
108
109
for b in _rgb565_to_bgr_tuple (pixel565 ):
@@ -137,7 +138,7 @@ def save_pixels(file_or_filename, pixel_source=board.DISPLAY, palette=None):
137
138
_write_bmp_header (output_file , filesize )
138
139
_write_dib_header (output_file , width , height )
139
140
_write_pixels (output_file , pixel_source , palette )
140
- except Exception :
141
- raise
141
+ except Exception as ex :
142
+ raise ex
142
143
else :
143
144
output_file .close ()
0 commit comments