New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cool program! I keep getting "broken data stream" error, though. #65
Comments
Hey @harold, I'm glad you like it. Do you have the problem on all types of images? Even with 2 or 3 small JPEG images? Could you run --- a/photocollage/render.py
+++ b/photocollage/render.py
@@ -260,7 +260,7 @@ class RenderingTask(Thread):
return canvas
def run(self):
- try:
+ if True:
canvas = PIL.Image.new(
"RGB", (int(self.page.w), int(self.page.h)), "white")
@@ -303,6 +303,3 @@ class RenderingTask(Thread):
if self.on_complete:
self.on_complete(canvas)
- except Exception as e:
- if self.on_fail:
- self.on_fail(e) |
Hey @adrienverge I'm glad you're glad I like it. Really neat program. I'm away from the machine with the program and the images at the moment, but thanks for the pointer on where to disable the exception swallowing. I imagine the program would indeed work with 2 or 3 small known-good images. The images I was trying to use are from various american government webcams (and so are likely to be without izzat). Knowing precisely what about the images is making the program sad would be interesting, so I will try again with the suggested patch. I won't be able to try until Monday, or perhaps the Monday of the following week, as we're on holiday at the moment, but I'll let you know the results when I do. Thanks again for your efforts and this great program; they're both much appreciated. |
Happily, right click -> save as... on the image from here and adding it to photocollage still produces the error. 🎄 |
Hey @harold, I can confirm the bug, even without running PhotoCollage: $ python3 -c "import PIL.Image; PIL.Image.open('/tmp/image.jpg').resize((400, 225))"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.7/site-packages/PIL/Image.py", line 1890, in resize
self.load()
File "/usr/lib64/python3.7/site-packages/PIL/ImageFile.py", line 272, in load
raise_ioerror(err_code)
File "/usr/lib64/python3.7/site-packages/PIL/ImageFile.py", line 58, in raise_ioerror
raise IOError(message + " when reading image file")
OSError: broken data stream when reading image file By searching the error on Pillow issues it seems that we can tell the lib PIL to continue, even if the input image is corrupted, using |
Avoid "OSError: broken data stream when reading image file" on truncated files; instead, try to continue reading the file if possible. Fixes #65.
Avoid "OSError: broken data stream when reading image file" on truncated files; instead, try to continue reading the file if possible. Fixes #65.
Hi! Thanks for this program, it looks really neat and seems to do what I want. I really appreciate your efforts.
Every time I try to make a collage, I get this error:
I am able to open the images in
eog
and display them in the browser, so I think they're good. But it'd be cool if there was an option (or by default) to simply ignore images that aren't working for photocollage.Thanks again, hope you have a nice day.
The text was updated successfully, but these errors were encountered: