Opened 13 years ago

Last modified 13 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:

Description

Images that **do** work;


-  `http://c3338694.r94.cf0.rackcdn.com/media\_entries/4e543e85d9d7836d0a000021/test.jpg <http://c3338694.r94.cf0.rackcdn.com/media_entries/4e543e85d9d7836d0a000021/test.jpg>`_
-  `http://c3338694.r94.cf0.rackcdn.com/media\_entries/4e543cebd9d7836d0a00000d/Portrait\_Screenshot\_test.png <http://c3338694.r94.cf0.rackcdn.com/media_entries/4e543cebd9d7836d0a00000d/Portrait_Screenshot_test.png>`_
-  `http://c3338694.r94.cf0.rackcdn.com/media\_entries/4e52bba3d9d7835676000005/david-smoking-fireworks.jpg <http://c3338694.r94.cf0.rackcdn.com/media_entries/4e52bba3d9d7835676000005/david-smoking-fireworks.jpg>`_
-  `http://c3338694.r94.cf0.rackcdn.com/media\_entries/4e52af64d9d783076700002d/david-bike.jpg <http://c3338694.r94.cf0.rackcdn.com/media_entries/4e52af64d9d783076700002d/david-bike.jpg>`_
   (not the bike picture, a test to see if filename matters)

Images that **do not** work;


-  `http://c3338694.r94.cf0.rackcdn.com/media\_entries/4e543fb4d9d7836d0a00002a/Photo\_maj\_09\_8\_06\_07\_em.jpg <http://c3338694.r94.cf0.rackcdn.com/media_entries/4e543fb4d9d7836d0a00002a/Photo_maj_09_8_06_07_em.jpg>`_
-  `http://c3338694.r94.cf0.rackcdn.com/media\_entries/4e543e26d9d7836d0a00001c/david-bike-pasted-resized.jpg <http://c3338694.r94.cf0.rackcdn.com/media_entries/4e543e26d9d7836d0a00001c/david-bike-pasted-resized.jpg>`_
-  `http://c3338694.r94.cf0.rackcdn.com/media\_entries/4e543e1ed9d7836d0a00001b/david-bike-pasted.jpg <http://c3338694.r94.cf0.rackcdn.com/media_entries/4e543e1ed9d7836d0a00001b/david-bike-pasted.jpg>`_
-  `http://c3338694.r94.cf0.rackcdn.com/media\_entries/4e543d57d9d7836d0a000012/david-bike-edited.jpg <http://c3338694.r94.cf0.rackcdn.com/media_entries/4e543d57d9d7836d0a000012/david-bike-edited.jpg>`_
-  `http://c3338694.r94.cf0.rackcdn.com/media\_entries/4e53e45cd9d78342b900001d/david-bike.png <http://c3338694.r94.cf0.rackcdn.com/media_entries/4e53e45cd9d78342b900001d/david-bike.png>`_

Example of corrupted ``medium`` image


-  `http://c3338694.r94.cf0.rackcdn.com/media\_entries/4e543d57d9d7836d0a000012/medium.jpg <http://c3338694.r94.cf0.rackcdn.com/media_entries/4e543d57d9d7836d0a000012/medium.jpg>`_

Example of non-corrupted ``medium`` image


-  `http://c3338694.r94.cf0.rackcdn.com/media\_entries/4e52af64d9d783076700002d/medium.jpg <http://c3338694.r94.cf0.rackcdn.com/media_entries/4e52af64d9d783076700002d/medium.jpg>`_

more can be found by substituting the filename in the URLs with
"medium.jpg"

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



Change History (4)

comment:1 by Christopher Allan Webber, 13 years ago

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 by joar, 13 years ago

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
https://github.com/jwandborg/mediagoblin/tree/cloudfiles\_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.

Cheers,



comment:3 by Christopher Allan Webber, 13 years ago

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
now).

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 by Will Kahn-Greene, 13 years ago

The original url for this bug was http://bugs.foocorp.net/issues/512 .

Note: See TracTickets for help on using tickets.