Error when trying to convert jpeg 2000 file #11
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
By josch on 2015-03-15T09:41:49.510Z
Created by: boxerab
FIrst off, thank you so much for this lovely app!
I am trying to conver a jpeg 2k file to pdf:
You can find the file here:
https://github.com/CodecCentral/openjpeg-data/tree/master/input/conformance
File name is:
zoo1.jp2
I get an error : broken data stream when reading image file
Thanks!
Aaron
PS I am using the latest github source
Imported comments:
By josch on 2014-04-05 18:56:55 UTC
I actually get a different error:
Color 18 is sYCC. I would not know how to handle images in that color space.
By boxerab on 2014-04-05 19:08:58 UTC
Thanks for checking. It is strange that we get different errors. I am using python 2.7 on windows, if that makes a difference.
By josch on 2014-04-05 19:12:22 UTC
I'm using python 2.7 and python-pil 2.3.0 on Debian testing. I'm more interested in what part exactly throws your error message " broken data stream when reading image file"
By boxerab on 2014-04-05 21:13:24 UTC
OK, how can I test this for you?
By josch on 2014-04-05 21:16:55 UTC
Well, usually when you run a Python program and it exits because of an error, it gives you a traceback looking like the one I pasted above. Apparently no source package in all of Debian contains the string "broken data stream when reading image file" so I'm at a loss where it could come from.
By boxerab on 2014-04-05 22:42:58 UTC
ahhh, it is a PIL error:
Microsoft Windows [VC:\src\openjpeg-data\input\conformance>img2pdf zoo1.jp2 -o temp.pdf
Traceback (most recent call last):
File "c:\Python27\Scripts\img2pdf-script.py", line 9, in
load_entry_point('img2pdf==0.1.0', 'console_scripts', 'img2pdf')()
File "C:\Python27\lib\site-packages\img2pdf.py", line 337, in main
args.subject, args.keywords, args.colorspace, args.verbose))
File "C:\Python27\lib\site-packages\img2pdf.py", line 269, in convert
imgdata = zlib.compress(imgdata.tostring())
File "C:\Python27\lib\site-packages\PIL\Image.py", line 582, in tostring
return self.tobytes(*args, **kw)
File "C:\Python27\lib\site-packages\PIL\Image.py", line 556, in tobytes
self.load()
File "C:\Python27\lib\site-packages\PIL\Jpeg2KImagePlugin.py", line 181, in lo
ad
ImageFile.ImageFile.load(self)
File "C:\Python27\lib\site-packages\PIL\ImageFile.py", line 234, in load
raise_ioerror(e)
File "C:\Python27\lib\site-packages\PIL\ImageFile.py", line 56, in raise_ioerr
or
raise IOError(message + " when reading image file")
IOError: broken data stream when reading image file
By boxerab on 2014-04-05 22:54:07 UTC
yeah, I found that this is an error with the version of PIL that I have. So, don't worry about it.
I shouldn't be using windows anyways :)