Opened 15 years ago
Last modified 15 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/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/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/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/4e543d57d9d7836d0a000012/david-bike-edited.jpg
- http://c3338694.r94.cf0.rackcdn.com/media_entries/4e53e45cd9d78342b900001d/david-bike.png
Example of corrupted medium image
Example of non-corrupted medium image
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 , 15 years ago
| Milestone: | → 0.0.5 |
|---|
comment:2 by , 15 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 , 15 years ago
| Owner: | set to |
|---|---|
| Status: | New → Closed |
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! :)

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