Open jfolli1 opened 10 years ago
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:
:hash: ./nasa_apod_desktop.py
Traceback (most recent call last):
File "./nasa_apod_desktop.py", line 422, in
I'm using Ubuntu 15.04 amd64 and my kernel is 3.19.0-25-generic
Same here :
Traceback (most recent call last):
File "./nasa_apod_desktop.py", line 422, in <module>
filename = create_desktop_background_scoll(filename)
File "./nasa_apod_desktop.py", line 316, in create_desktop_background_scoll
resize_image(seed_filename)
File "./nasa_apod_desktop.py", line 243, in resize_image
image = image.resize((RESOLUTION_X, RESOLUTION_Y), Image.ANTIALIAS)
File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1526, in resize
self.load()
File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line 204, in load
raise IOError("image file is truncated")
IOError: image file is truncated
For me this solution from the stackoverflow discussion solved the problem: https://stackoverflow.com/a/20068394
Just replace the line
image = image.resize((RESOLUTION_X, RESOLUTION_Y), Image.ANTIALIAS)
with the following:
try:
image = image.resize((RESOLUTION_X, RESOLUTION_Y), Image.ANTIALIAS)
except IOError:
pass # You can always log it to logger
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