ValueError while validating image file using Python Imaging Lib

Bug #50616 reported by Diogo Matsubara
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Unassigned

Bug Description

We use the Python Imaging Library to identify the image type uploaded on the +edithackergotchi page.
Usually when the PIL can't identify an image type, it raises a IOError, but it might raise a "ValueError: cannot read this XPM file" when uploading a broken XPM file. When that happens we see OOPS-171A222, OOPS-379D69, OOPS-1595L2717

The same applies when you try to upload a team emblem through +editemblem or a icon for your product using +branding

Related branches

description: updated
Revision history for this message
Diogo Matsubara (matsubara) wrote :
Changed in launchpad:
status: Unconfirmed → Confirmed
description: updated
Revision history for this message
Diogo Matsubara (matsubara) wrote :

<SteveA> matsubara: for 50616, I think we should try-except, and such images should be rejected as invalid
<salgado> agreed. that's what I had in mind
<SteveA> but we should also record the fact they were rejected, and the image involved
<SteveA> just in this case, not in the general case

Changed in launchpad:
assignee: nobody → salgado
Revision history for this message
Carlos Perelló Marín (carlos) wrote :

This bug also affects product creation: OOPS-402B296

Changed in launchpad:
assignee: salgado → nobody
description: updated
Changed in launchpad-foundations:
status: Confirmed → Triaged
importance: Undecided → Low
Changed in launchpad:
importance: Low → Critical
Revision history for this message
Curtis Hovey (sinzui) wrote :

The error message handling was changed after this was reported. The message we have is good for both IOError and ValueError, we just need to catch ValueError too.

Changed in launchpad:
assignee: nobody → Curtis Hovey (sinzui)
status: Triaged → In Progress
Curtis Hovey (sinzui)
Changed in launchpad:
milestone: none → 11.03
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
tags: added: qa-ok
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
Changed in launchpad:
assignee: Curtis Hovey (sinzui) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.