Giter Site home page Giter Site logo

Comments (7)

SmileyChris avatar SmileyChris commented on July 1, 2024

My storages changes have been pulled back into http://bitbucket.org/david/django-storages by the way

from easy-thumbnails.

SmileyChris avatar SmileyChris commented on July 1, 2024

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.

tuttle avatar tuttle commented on July 1, 2024

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.

michelts avatar michelts commented on July 1, 2024

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.

SmileyChris avatar SmileyChris commented on July 1, 2024

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.

michelts avatar michelts commented on July 1, 2024

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.

SmileyChris avatar SmileyChris commented on July 1, 2024

I'm going to close this issue, since it's not really a problem with easy-thumbnails

from easy-thumbnails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.