2013-12-13 6 views
5

मैं images2gif के साथ काम कर रहा हूं और यह त्रुटि प्राप्त कर रहा हूं। कोई विचार?यूनिकोडडेकोड एरर: 'ascii' कोडेक स्थिति 10 में बाइट 0x87 को डीकोड नहीं कर सकता है: क्रमशः श्रेणी में नहीं (128)

UnicodeDecodeError: 'ascii' codec can't decode byte 0x87 in position 10: ordinal not in range(128)

टेस्ट फ़ाइल:

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 लाइन 435: fp.write(header.encode('utf-8'))

अपडेट किया गया ट्रैस बैक:

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 
+1

कौन सा अजगर संस्करण आप पर कर रहे हैं? – aIKid

+0

छवियों का कौन सा संस्करण आप उपयोग कर रहे हैं? मैं पिछले संस्करण – PasteBT

+1

में उस रेखा को नहीं देख सकता हूं इस संस्करण में कोई एन्कोड नहीं है और मुझे अधिक उचित लगता है https://github.com/luopio/bag-of-tricks/blob/master/python/images2gif.py; अनुमान नहीं लगा सकता कि कोई स्ट्रिंग एन्कोड क्यों कर सकता है; image2gif का कोड py3 अनुकूल नहीं दिखता है, इसलिए मुझे लगता है कि यह py2 – alko

उत्तर

2

अपने अपडेट किए गए सवाल भी यहाँ है: Error in images2gif.py with GlobalPalette

यह जिसमें लेखक का कहना है कि वे मॉड्यूल जनहित याचिका/तकिया का उपयोग नहीं करने के लिए फिर से लिखने के लिए जा रहे images2gif पर एक मुद्दा संदर्भ देता है, लेकिन व्यस्त हैं: https://code.google.com/p/visvis/issues/detail?id=81

बदले में संदर्भ देता है एक समझौता images2gif कि इस मुद्दे को ठीक करने का दावा किया जाता है: https://github.com/rec/echomesh/blob/master/code/python/external/images2gif.py

संबंधित मुद्दे

 संबंधित मुद्दे