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.
Resize image script not working after update
-
Hi.
I borrowed a script from macdrifter.com and changed it little. It worked perfect, but after the update to 1.4 it runs without errors but don't resize the image. It only saves a new image in the same size as the original. Here is the code
import Image import photos import console img = photos.pick_image() def customSize(img): w, h = img.size print 'w: ' + str(w) print 'h: '+ str(h) if w != 1000: wsize = 1000/float(w) print 'wsize: '+str(wsize) hsize = int(float(h)*float(wsize)) print 'hsize: ' + str(hsize) img = img.resize((1000, hsize), Image.ANTIALIAS) return img image = customSize(img) print image.size image.show() saveit = photos.save_image(img) print "\n\n Bilden sparad"
I'm a beginner and don't understand why this happens. Can someone please help me.
-
In the second last line, it should be
photos.save_image(image)
instead ofphotos.save_image(img)
.