Merge lp:~samuel-buffet/entertainer/bug_373707 into lp:entertainer

Proposed by Samuel Buffet
Status: Merged
Approved by: Matt Layman
Approved revision: 377
Merged at revision: not available
Proposed branch: lp:~samuel-buffet/entertainer/bug_373707
Merge into: lp:entertainer
Diff against target: None lines
To merge this branch: bzr merge lp:~samuel-buffet/entertainer/bug_373707
Reviewer Review Type Date Requested Status
Matt Layman Approve
Review via email: mp+6658@code.launchpad.net

Commit message

try/except to catch IOError exception while trying to open an image file. (Fixes Bug 373707)

To post a comment you must log in.
Revision history for this message
Samuel Buffet (samuel-buffet) wrote :

Hi,

I've tried this 2 lines fix on my desktop with success.

Samuel-

Note :
I know this code is likely to be obsolete soon with the new server. But I don't know if Paul is going to rewrite everything or will reuse some parts of the actual code.

Revision history for this message
Matt Layman (mblayman) wrote :

This branch works. `make check` was okay. I checked the error log and verified that it wrote to the log file so I know that the exception was handled properly.

This branch just needs a commit message.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'entertainerlib/backend/components/mediacache/image_cache.py'
2--- entertainerlib/backend/components/mediacache/image_cache.py 2009-05-06 02:58:08 +0000
3+++ entertainerlib/backend/components/mediacache/image_cache.py 2009-05-11 21:45:54 +0000
4@@ -282,8 +282,12 @@
5 title = tmp.replace('_',' ').title() # Make title more attractive
6 description = "" # No description for this image file
7
8- im = Image.open(filename)
9- width, height = im.size
10+ try:
11+ im = Image.open(filename)
12+ width, height = im.size
13+ except IOError:
14+ self.logger.error("Couldn't identify image file: " + filename)
15+ return
16
17 # Create thumbnail and return hash
18 thumbnailer = ImageThumbnailer(filename)

Subscribers

People subscribed via source and target branches