Skip to content

Commit 693b8a3

Browse files
authored
Merge pull request #544 from adafruit/mm-thingiverse-pyportal-img-conv
Update to use new PyPortal AIO image converter
2 parents ef1b897 + 97f5bf3 commit 693b8a3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

PyPortal_Thingiverse/thingiverse.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
default_bg=cwd+"/thingiverse_background.bmp",
2727
text_font=cwd+"/fonts/Arial-12.bdf",
2828
text_position=((5, 5), (5, 200)),
29-
text_color=(0x00FF00, 0x00FF00))
29+
text_color=(0x00FF00, 0x00FF00),
30+
text_transform=(None, None))
3031
pyportal.preload_font()
3132

3233
while True:
@@ -36,8 +37,10 @@
3637
print("Response is", response)
3738
pyportal.set_background(None)
3839
image_url = response[2].replace('_thumb_medium.', '_display_large.')
39-
pyportal.wget(adafruit_pyportal.IMAGE_CONVERTER_SERVICE+image_url, "/cache.bmp")
40-
pyportal.set_background("/cache.bmp")
40+
pyportal.wget(pyportal.image_converter_url(image_url,320, 240,color_depth=16),
41+
"/sd/cache.bmp",
42+
chunk_size=512)
43+
pyportal.set_background("/sd/cache.bmp")
4144

4245
except (IndexError, RuntimeError, ValueError) as e:
4346
print("Some error occured, retrying! -", e)

0 commit comments

Comments
 (0)