[Image-SIG] [bug report] OverflowError: signed integer is greater than maximum

Edward Cannon edward at unicornschool.org
Sun Aug 18 22:09:50 CEST 2013


have you tried to use the built in save function instead of the save_image
function? It would look like
img.save( '/tmp/1889935.jpg')
you don't need to specify the file type or other parameters as long as the
file has an appropriate extension.
PS if you are just moving the image around and not changing it at all the
shutil.copy() function from the standard libraries is much faster and
lossless.


On Thu, Jul 25, 2013 at 8:20 AM, Julien Palard <julien at palard.fr> wrote:

> I jiust reproduced the bug with another image that I can publicly release,
> so you may easily reproduce it :
>
> http://mandark.fr/art/art/2011/01/16/2011-01-16-14-54-22.jpg
>
>
> On Thu, Jul 25, 2013 at 5:11 PM, Julien Palard <julien at palard.fr> wrote:
>
>> Hi there, I'm facing a bug in PIL, from the stable Debian Package, don't
>> know the PIL exact version number as it's not exposed by the package but I
>> got :
>>
>> apt-cache policy python-imaging
>> python-imaging:
>>   Installed: 1.1.7-4
>>
>> Here come the bug :
>>
>> $ python
>> Python 2.7.3 (default, Jan  2 2013, 13:56:14)
>> [GCC 4.7.2] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> from PIL import Image as PILImage
>> >>> from pilkit.utils import save_image
>> >>>
>> >>> img = PILImage.open('./1889935.jpg')
>> >>> save_image(img, '/tmp/1889935.jpg', 'JPEG', {}, True)
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>>   File
>> "/usr/local/lib/python2.7/dist-packages/pilkit-1.0.0-py2.7.egg/pilkit/utils.py",
>> line 175, in save_image
>>     img.save(outfile, format, **options)
>>   File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1439, in save
>>     save_handler(self, fp, filename)
>>   File "/usr/lib/python2.7/dist-packages/PIL/JpegImagePlugin.py", line
>> 471, in _save
>>     ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
>>   File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line 499, in
>> _save
>>     s = e.encode_to_file(fh, bufsize)
>> OverflowError: signed integer is greater than maximum
>>
>> How I may help ?
>>
>> --
>> Julien Palard - http://julien.palard.fr
>> IRC : mandark at freenode.net, mandark at quakenet.org
>> TEL : 06.21.19.49.10 / FAX : 09.72.28.06.72
>>
>
>
>
> --
> Julien Palard - http://julien.palard.fr
> IRC : mandark at freenode.net, mandark at quakenet.org
> TEL : 06.21.19.49.10 / FAX : 09.72.28.06.72
>
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20130818/d687618f/attachment-0001.html>


More information about the Image-SIG mailing list