I'm working with images2gif and getting this error. Any ideas?
UnicodeDecodeError: 'ascii' codec can't decode byte 0x87 in position 10: ordinal not in range(128)
Test file:
from PIL import Image
from images2gif import writeGif
FRAMES = 2
FRAME_DELAY = 0.75
WIDTH, HEIGHT = 600, 600
frames = []
img1 = Image.open('1.jpg')
img2 = Image.open('2.jpg')
frames.append(img1)
frames.append(img2)
writeGif("test.gif", frames, duration=FRAME_DELAY, dither=0)
Traceback:
Traceback (most recent call last):
File "gif.py", line 15, in <module>
writeGif("topmovie.gif", frames, duration=FRAME_DELAY, dither=0)
File "/Users/Craig/Documents/github/RTB/images2gif.py", line 575, in writeGif
gifWriter.writeGifToFile(fp, images, duration, loops, xy, dispose)
File "/Users/Craig/Documents/github/RTB/images2gif.py", line 435, in writeGifToFile
fp.write(header.encode('utf-8'))
images2gif line 435: fp.write(header.encode('utf-8'))
Updated traceback:
Traceback (most recent call last):
File "gif.py", line 16, in <module>
writeGif("test.gif", frames, duration=FRAME_DELAY, dither=0)
File "/Users/Craig/Documents/github/RTB/images2gif.py", line 579, in writeGif
gifWriter.writeGifToFile(fp, images, duration, loops, xy, dispose)
File "/Users/Craig/Documents/github/RTB/images2gif.py", line 440, in writeGifToFile
fp.write(globalPalette)
TypeError: must be string or buffer, not None
Your updated question is also here: Error in images2gif.py with GlobalPalette
It references an issue on images2gif in which the author says they're going to rewrite the module to not use PIL/Pillow, but are busy: https://code.google.com/p/visvis/issues/detail?id=81
That in turn references a patched images2gif that is claimed to fix the issue: https://github.com/rec/echomesh/blob/master/code/python/external/images2gif.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With