Hi. I'm trying to write a script to resize the image to 1200 pixels wide.
Everything seems to be working fine apart from the fact that all portrait-oriented photos are rotated 90° degrees.
The images are displayed correctly (in portrait orientation) in my camera roll.
But when I'm running the script they are rotated 90° degrees to landscape mode.
What am I doing wrong here?
Here is the script I'm using.
from PIL import Image import photos import console image = photos.pick_image() def customSize(image): w, h = image.size print 'Original image size: '+str(w)+' × '+str(h)+' pixels'+'\n' if w > 1200: wsize = 1200/float(w) hsize = int(float(h)*float(wsize)) image = image.resize((1200, hsize), Image.ANTIALIAS) print 'Modified image size: 1200 × '+str(hsize)+' pixels' else: print 'Image is too small to be resampled. Width is less than 1200 pixels' return image image = customSize(image) image.show() saveit = photos.save_image(image) print 'Done!'
Thanks, omz. <code>original=False</code> helped. The only downside is that the image is already scaled to less than 1200 pixels (as you've said).
It still will work for me though.
I will take a look metadata option when have a little bit more free time :)
Hi, I'm trying to create a workflow that will append a clipboard (generated in Drafts 4) to the existing file and then return back to Drafts.
Right now it looks like that.
Appendjust appends a clipboard.
I've got everything working apart from return back to Drafts part. The clipboard gets appended to the file but nothing happens after that.
What am I missing?