On 02/07/2015 08:29, telmo bacile wrote:
Hi list, im new in this list.
Im trying to run a python code that was made originally with pil using pillow,
The problem is that i get this error:
IOError: decoder jpeg not available
Any idea why this code is not working with pillow?
import math
from PIL import Image
imageFile = 'test.jpg'
im = Image.open(imageFile)
rgbHistogram = im.histogram()
print 'Snannon Entropy for Red, Green, Blue:'
for rgb in range(3):
totalPixels = sum(rgbHistogram[rgb * 256 : (rgb + 1) * 256])
ent = 0.0
for col in range(rgb * 256, (rgb + 1) * 256):
freq = float(rgbHistogram[col]) / totalPixels
if freq > 0:
ent = ent + freq * math.log(freq, 2)
ent = -ent
print ent
Searching for "python pil ioerror decoder jpeg not available" on google
gives 3,930 results of which this is the first
http://stackoverflow.com/questions/8915296/python-image-library-fails-with-message-decoder-jpeg-not-available-pil
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list