Make erase image as well

This commit is contained in:
Ben V. Brown
2022-02-14 22:23:02 +11:00
parent 90b2e2c311
commit 6644d9550c
3 changed files with 17 additions and 14 deletions

View File

@@ -27,9 +27,12 @@ jobs:
- name: prep
run: mkdir -p /tmp/${{ matrix.model }}
- name: build test
- name: build logo's
run: cd Bootup\ Logos && ./run.sh /tmp/${{ matrix.model }}/ ${{matrix.args}}
- name: build logo's
run: cd Bootup\ Logos && python3 img2logo.py -E dummy.png /tmp/${{ matrix.model }}/
- name: Archive artifacts
uses: actions/upload-artifact@v2
with:

View File

@@ -193,21 +193,21 @@ def img2hex(
Optional `negative' inverts black/white regardless of input image type
or other options.
"""
try:
image = Image.open(input_filename)
except BaseException as e:
raise IOError('error reading image file "{}": {}'.format(input_filename, e))
if make_erase_image:
data = [0xFF] * 1024
elif getattr(image, "is_animated", False):
data = animated_image_to_bytes(image, negative, dither, threshold)
else:
# magic/required header
data = [DATA_PROGRAMMED_MARKER, 0x00] # Timing value of 0
image_bytes = still_image_to_bytes(image, negative, dither, threshold, preview_filename)
data.extend(get_screen_blob([0] * LCD_NUM_BYTES, image_bytes))
try:
image = Image.open(input_filename)
except BaseException as e:
raise IOError('error reading image file "{}": {}'.format(input_filename, e))
if getattr(image, "is_animated", False):
data = animated_image_to_bytes(image, negative, dither, threshold)
else:
# magic/required header
data = [DATA_PROGRAMMED_MARKER, 0x00] # Timing value of 0
image_bytes = still_image_to_bytes(image, negative, dither, threshold, preview_filename)
data.extend(get_screen_blob([0] * LCD_NUM_BYTES, image_bytes))
# Pad up to the full page size
if len(data) < LCD_PAGE_SIZE:

View File

@@ -1,4 +1,4 @@
#! /bin/sh
echo $1
echo $2
find Images/ -type f -exec python img2logo.py {} "$1" "$2" \;
find Images/ -type f -exec python3 img2logo.py {} "$1" "$2" \;