Opened 11 years ago

Last modified 11 years ago

#215 closed defect (FIXED)

Some `medium.jpg` images are not saved to CloudFiles successfully.

Reported by: joar Owned by: joar
Priority: minor Milestone: 0.0.5
Component: programming Keywords:
Cc: Parent Tickets:


Images that **do** work;

-  `\_entries/4e543e85d9d7836d0a000021/test.jpg <>`_
-  `\_entries/4e543cebd9d7836d0a00000d/Portrait\_Screenshot\_test.png <>`_
-  `\_entries/4e52bba3d9d7835676000005/david-smoking-fireworks.jpg <>`_
-  `\_entries/4e52af64d9d783076700002d/david-bike.jpg <>`_
   (not the bike picture, a test to see if filename matters)

Images that **do not** work;

-  `\_entries/4e543fb4d9d7836d0a00002a/Photo\_maj\_09\_8\_06\_07\_em.jpg <>`_
-  `\_entries/4e543e26d9d7836d0a00001c/david-bike-pasted-resized.jpg <>`_
-  `\_entries/4e543e1ed9d7836d0a00001b/david-bike-pasted.jpg <>`_
-  `\_entries/4e543d57d9d7836d0a000012/david-bike-edited.jpg <>`_
-  `\_entries/4e53e45cd9d78342b900001d/david-bike.png <>`_

Example of corrupted ``medium`` image

-  `\_entries/4e543d57d9d7836d0a000012/medium.jpg <>`_

Example of non-corrupted ``medium`` image

-  `\_entries/4e52af64d9d783076700002d/medium.jpg <>`_

more can be found by substituting the filename in the URLs with

The ``thumbnail`` size images are never corrupted.


Change History (4)

comment:1 Changed 11 years ago by Christopher Allan Webber

Milestone: 0.0.5
Marking this for 0.0.5 even though I know we'll roll it for 0.0.6
most likely ;)

comment:2 Changed 11 years ago by joar

As said on IRC, the problem was that cloudfiles did not implicitly
append the contents of a write().

Those ``medium.jpg`` files that were affected were those who PIL
did buffered writes for.

I solved this in\_storage\_object\_wrapper
. It now does a check if the file object has a size, if so, it
appends the new data to any existing data and then writes it all.

Please review and merge.


comment:3 Changed 11 years ago by Christopher Allan Webber

Owner: set to Joar Wandborg
Status: NewClosed
This solution seems a bit curious, but it looks like it works, so I
merged it. I also added a bit to the docs explaining that there was
buffering happening on both ends, and that was related to the
corruption (not a thorough description, but decent enough for

I'm not sure we need this class inside a class stuff. It looks like
we don't to me, so I removed it from there and moved it into its
own class.

Anyway! Merged, and closed. Thanks for the sleuthing on this one,
Joar! :)

comment:4 Changed 11 years ago by Will Kahn-Greene

The original url for this bug was .

Note: See TracTickets for help on using tickets.