View Single Post
Old 03-07-2023, 09:42 PM   #7
superpomme
Enthusiast
superpomme rocks like Gibraltar!superpomme rocks like Gibraltar!superpomme rocks like Gibraltar!superpomme rocks like Gibraltar!superpomme rocks like Gibraltar!superpomme rocks like Gibraltar!superpomme rocks like Gibraltar!superpomme rocks like Gibraltar!superpomme rocks like Gibraltar!superpomme rocks like Gibraltar!superpomme rocks like Gibraltar!
 
Posts: 42
Karma: 100218
Join Date: May 2021
Device: kobo touch, k3, k4, Nook Simple touch
I got it kind of working using stablehorde, but the image it downloads is a png in heic webp format. If I convert this using

Code:
from PIL import Image

# Open the WebP image
webp_image = Image.open("test2.png")

# Resize the image
resized_image = webp_image.resize((600, 800))

# Save the image in PNG format
png_filename = "example.png"
resized_image.save(png_filename, format="PNG")

Then it works on my pc, but it doesn't work on the kindle:
webp_image = Image.open("test2.png")
File "/mnt/us/python3/lib/python3.9/site-packages/PIL/Image.py", line 2994, in open
raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file 'test2.png'


I think it's due to the version of pillow, but I'm concerned that updating it will break the existing kindle stuff

-> I tried installing webp, but this went to "installing build dependencies, filled the kindle up and it rebooted. If I can get past this, or there's a way to get it as non webp from the api then this should work fine
superpomme is offline   Reply With Quote