-
Notifications
You must be signed in to change notification settings - Fork 58
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
error with truncated images #10
Comments
Hello @jfolli1 thanks for the report! I'm actually not running an Ubuntu box at this time. Any additional information you could provide on this such as the versions of the OS and languages/libraries used would be appreciated. When I get time I can spin up a correct image and see if I can't fiddle with it or merge a possible pull request. |
Ah yes absolutely. It is the desktop version of ubuntu 14.04 LTS (64bit). I have not done much if anything at all besides a sudo apt-get upgrade and whatever ubuntu updates it asked to perform. I will try and find the versions of dependancies I used and update to try and make this a bit more re-producable |
I found a very similar error whilst I'm running the python script. Check it out: #️⃣ ./nasa_apod_desktop.py I'm using Ubuntu 15.04 amd64 and my kernel is 3.19.0-25-generic |
Same here :
|
For me this solution from the stackoverflow discussion solved the problem: Just replace the line
with the following:
|
Hi. I'll admit I am new to Ubuntu / Linux. But I appreciate the work you have done on this. I received the following error when trying to run your program as-is just with updated defaults and requirements.
Found name of image: helix_blancoHubble_6145.jpg
File exists, moving on
Opening local image
Resizing the image from 6145 x 6623 to 2560 x 1440
Traceback (most recent call last):
File "/home/jason/Documents/random-nasa-wallpaper.py", line 425, in
filename = create_desktop_background_scoll(filename)
File "/home/jason/Documents/random-nasa-wallpaper.py", line 319, in create_desktop_background_scoll
resize_image(seed_filename)
File "/home/jason/Documents/random-nasa-wallpaper.py", line 246, in resize_image
image = image.resize((RESOLUTION_X, RESOLUTION_Y), Image.ANTIALIAS)
File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1319, in resize
self.load()
File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line 218, in load
raise IOError("image file is truncated (%d bytes not processed)" % len(b))
IOError: image file is truncated (3 bytes not processed)
After researching thie IOError some people recommended to change a setting in PIL as follows to allow the program to conintinue to run.
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
I added this after the import statements.
Doing so allows your script to run however some of the pictures are completed with black pixels/data due to the truncated image.
I am not sure of the root solution at this time I just did this quick fix to get it up and working. I will look more into it as I have time but maybe you will find the problem quicker.
Thanks
The text was updated successfully, but these errors were encountered: