Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
New iPad PIL Image import problem
-
Hi Guys,
I wrote a Pythonista program for iPad about 3 years ago which imports PIL images which will now not work. My code:from PIL import Image
im = Image.open('_Image_1')
im.show()Returns an error:
IOError[Erno2]no such file or directory:'Image'
This a new problem. My image file is still there with all of the images.
Can any of you guys tell me what changed and how do I fix it?
Thanks and take care,
Morgan -
Could you try either
Image.open('Images/_Image_1.png')
orImage.open('_Image_1.png')
? -
HI Guys,
Thank you, your first solution fixed the problem but the second did not. Also, for anyone else with this problem you must use the full name of the Image with the png suffix in the parentheses when you use the im.show () command so that my old code:from PIL import Image
im = Image.open('_Image_1')
im.show()Becomes:
from PIL import Image
im = Image.open('Images/_Image_1.png')
im.show('_Image_1.png')Thank you for this great help but I am still curious as to what changed in the last 3 years?
-
@Morgan A very long time ago, Pythonista didn't support folders. When you added an image from the clipboard, it would end up in a hidden "Images" folder, and
Image.open()
would just assume that any image without file extension was in that folder... I've since improved Pythonista's file management capabilities, and the old behavior seemed a little too non-standard. -
Hi Guys,
OK, now I have a new problem. My images will open in the console but only as thumbnails where before they were full size. So how do I fix this? Also, are my old images now automatically placed in a new folder called "Images" and where this folder name come from?
Thanks,
Morgan. -
@Morgan When you open an image file from the library (I assume that's what you mean), you can view them in full size by tapping "Quick Look". The console (e.g. when you use
image.show()
may scale images down a bit, but they shouldn't really be thumbnails.The "Images" folder was probably created by an older version of Pythonista. In the current version, you can put images in any folder you like.
-
Hi Guys,
Where is "Quick Look"?
Morgan. -
@Morgan , you can use console.quicklook(file_path), or if you select a file Pythonista can't display, it shows a icon in the middle of the screen with a button under it to quicklook