Comments (7)
My storages changes have been pulled back into http://bitbucket.org/david/django-storages by the way
from easy-thumbnails.
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?
from easy-thumbnails.
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.
from easy-thumbnails.
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.
from easy-thumbnails.
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.
from easy-thumbnails.
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 :)
from easy-thumbnails.
I'm going to close this issue, since it's not really a problem with easy-thumbnails
from easy-thumbnails.
Related Issues (20)
- Cant install easy-thumbnails with Poetry and Django 4 HOT 4
- Template fails to render due to ZeroDivisionError when input is corrupted
- ContentFile without a name breaks easy_thumbnails
- ANTIALIAS is deprecated and will be removed in Pillow 10
- svglib dependency is missing HOT 9
- Imoprt error
- Django 4.1 template tag 'thumbnail' conflict with sorl-thumbnails
- Saving TIFF image raises Value error HOT 2
- How to force a single field to convert the thumbails to JPG even if PNG with alpha was provided
- DeprecationWarning from get_storage_class HOT 1
- Lots of duplicated queries HOT 1
- Support for pillow >= 10.0.0.0 HOT 1
- SVG File.width - This backend doesn't support absolute paths. HOT 2
- ZeroDivisionError when thumbnail is passed a 0x0 SVG HOT 1
- Increase File name field length HOT 1
- Allow use of new Django4.2 STORAGE config
- animated gifs - preserve animation, as PIL/Pillow supports it HOT 3
- up to date docs?
- Data too long on serving thumbnails
- DeprecationWarning: 'imghdr' is deprecated and slated for removal in Python 3.13 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easy-thumbnails.