-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thumbnails have MIME type application/octet-stream on CloudFiles #7
Comments
My storages changes have been pulled back into http://bitbucket.org/david/django-storages by the way |
I'm a bit confused. The filename is guessed by python-cloudfiles if the file doesn't have a content_type attribute (http://github.com/rackspace/python-cloudfiles/blob/master/cloudfiles/storage_object.py#L297) so isn't your patch really just duplicating this same logic? |
Ok, I switched back to David's repo. How about to mark the info about the back pull and that your repo is in fact abandoned into its description? TBH, I'm not sure whether my patch is duplicating. Just proposing one way of ensuring the resulting thumbnails have proper MIME type on CloudFiles. The important part in my patch is the computed content_type variable. Sorry if I'm missing something. If I can be of any help with testing, just ping me. |
Hi Chris, The mimetype isn't guessed by cloudfiles, there is 2 methods to save the object: the write method, that guess the mimetpe as you noticed and the send method that just rely on the content type passed as argument. I didn't understand exactly why, but the django storages make use of the send method. This forces us to set the mimetype before send the file. This way, the patch isn't duplicating but anyway, I think the error is in rackspace cloudfiles. I think the send method should be able to guess the mimetype just like the write method. |
Thanks for your input michaelts by the way (I did read your comment but just never replied to it). It really does sound like this is something that could be fixed in storages easily enough -- has anyone dropped a report with David? I'd apply this ticket anyway, but using SimpleUploadedFile seems a bit of a warty workaround and I need to think more about any issues with doing it this way. |
Hi Chris, I'm not using David's repo anymore. The author of the module is Richard Leland and he is keeping a new lib, the django-cumulus. It is the same thing but on a different place. I'm using it and we did some bug fixes and improvements that are not on the storages. Anyway, django-cumulus is already taking care of the content-type issue (except for a little bug): https://github.com/richleland/django-cumulus/issues/closed#issue/4 Now it would be redundant :) |
I'm going to close this issue, since it's not really a problem with easy-thumbnails |
Browsers can have problems with that.
Using latest django-storages from http://bitbucket.org/smileychris/django-storages/, latest python-cloudfiles from git://github.com/rackspace/python-cloudfiles.git, latest easy-thumbnails from git://github.com/SmileyChris/easy-thumbnails.git. As of 2010-03-08.
My proposed solution:
The text was updated successfully, but these errors were encountered: