Hi,~This is a university assignment I'm working on.I have approximately 720
images all using the format "a ###.jpg", where # is a number (ie. "a
001.jpg").With these images, I'm attempting to create a gif by resizing an
image (a 001.jpg) 10 times and than use a recursive function that should use
the next image (a 002.jpg) and resize that 10 times, etc...; until it reaches
"a 721.jpg", where it should stop.I'm not familiar with the Pillow library in
python, so I'm kind of at a wall right now.I'm also sure there are plenty of
errors or inefficiency in this code.This will run; however, it will not go on
to the next image. I've tried a few things to manipulate the string "a
001.jpg".Anyone?
from PIL import Images = ("a 001.jpg")im = Image.open(s)def main(im): try:
x = 920 y = 80 for a in range(0,10): x += 100
y += 100 box = (x,y) im = im.resize(box)
im.show() s = list(s) if s[4] < 9: s[4] = int(s[4]) +
1 elif s[4] == 9: s[4] = 0 s[3] = int(s[3]) + 1
elif s[3] < 9: s[3] = int(s[3]) + 1 elif s[3] == 9:
s[3] = 0 s[2] = int(s[2]) + 1 elif s[2] < 9:
s[2] = int(s[2]) + 1 elif s[2] == 9: s[2] = 0 s =
''.join(s) im = Image.open(s) return main(im) except:
return -1main(im)
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor