How to share JPEGs via dialogs.share_image?
dialogs.share_image(img)to share an photo from Pythonista to other apps.
The photo is given as a PiL image and it seems to be shared as a PNG which is pretty inefficient for photos.
Any idea how I can share the photo as a JPEG?
@halloleooo this shares a jpg
import console console.open_in('a.jpg')
Does this mean I have save the PIL image first as a JPG to disk and then I can share it?
https://omz-software.com/pythonista/docs/ios/console.html says that
import console from PIL import Image import os pil = Image.open('test:Lenna') pil.save('test.jpg', quality=95) console.open_in('test.jpg') os.remove('test.jpg')
Does this mean I have save the PIL image first as a JPG to disk and then I can share it
Thanks for the details. I was hoping to be able to tweak
dialogs.share)imageto export JPGs, but the detour via a JPG file is ok too.
hoping to be able to tweak dialogs.share)image to export JPGs
I don't think it is possible but I can be wrong
save the PIL image first as a JPG to disk
Don't forget that on a iDevice, files are also in RAM 🤔
I woulda said that solid state disk (SDD/flash) != RAM but perhaps someone could correct me.
cvp last edited by cvp
@ccc solid state memory = transistors
RAM = read and write memory = transistors too
Agree this not the same, specially in access speed, buT not exactly a disk which is in movement...
Only different words
Anyway, I only wanted to say that they are similar because in solid state material both
where the heck does the stuff get saved when Pythonista executes in a share extension???
I guess in the same folder as the script.
And no need of temp dir if you remove it just after sharing.
As usual, Python has nice batteries included...