trivial: Actually write the BMP UX images
We need to seek back to the head to read the data back...
Richard Hughes
3 years ago
142 | 142 | make_dir(d) |
143 | 143 | |
144 | 144 | # write PNG |
145 | buf_png = io.BytesIO() | |
146 | img.write_to_png(buf_png) | |
145 | with io.BytesIO() as io_png: | |
146 | img.write_to_png(io_png) | |
147 | io_png.seek(0) | |
147 | 148 | |
148 | # convert to BMP | |
149 | pimg = Image.open(buf_png) | |
150 | buf_bmp = io.BytesIO() | |
151 | pimg.save(buf_bmp, format='BMP') | |
152 | with gzip.open(filename, 'wb') as f: | |
153 | f.write(bytes(buf_bmp)) | |
149 | # convert to BMP | |
150 | with io.BytesIO() as io_bmp: | |
151 | pimg = Image.open(io_png) | |
152 | pimg.save(io_bmp, format='BMP') | |
153 | io_bmp.seek(0) | |
154 | with gzip.open(filename, 'wb') as f: | |
155 | f.write(io_bmp.read()) | |
154 | 156 | |
155 | 157 | for lang in self.languages: |
156 | 158 | #print("lang:\"%s\" string:\"%s\"" % (lang, string)) |