Hello, there are a lot of solutions to resizing images in Django. I commend 
you for wanting to create your own solution, but one of the greatest things 
about Django is that there's tons of projects that people have made that 
solve your problems and usually there's enough of them that you can find 
one that implements itself in a way that lets you do what you want to do. 
I'm not a great programmer and usually these modules are taken from 
websites that in order to function, they have had to work properly in an 
environment where anything can go wrong.

In my own experience, sorl-thumbnail has never let gotten in my way, it 
lets you do what you want and if you want to do something special you can 
easily write your own functionality. Don't want to use PIL? Use ImageMagick 
or write your own class. Have some sort of radical key value cache that 
nobody has ever heard of? Write your own class. Do you want to generate 
thumbnails in a batch process or in the model or in the template? 
sorl-thumbnail lets you choose what you want to do.

https://github.com/sorl/sorl-thumbnail

On Saturday, February 2, 2013 12:33:36 PM UTC-8, nYmo wrote:
>
> Hi all, 
> I'm new to django and also python but have already some programming 
> experience. I'm currently creating my first application in django and get 
> stucked because I'm looking for the best way to resize uploaded images.
> I'm already so far that I can upload/delete/update my images and show them 
> in my view. Now I want to resize the images for my view and thought about 
> the best way?
>
> First question: Is it possible to resize the images on the fly? For 
> example I uploaded an image in 1920x1080px and now want to transform it to 
> 400x200 or something similar when the view is being loaded? Is this a 
> convenient way in django or not?
>
> The only other way in my opinion could be to resize the image during the 
> file is being uploaded. What I don't like about this is that I have more 
> than one copy of one image only because of different image sizes. 
>
> Any other thoughs?
>
> I know that there are some nice packages out there where such problems are 
> already solved. But since I'm new to django I want to learn by myself how 
> to accomplish the basic stufff :) 
>
> Thanks in advance
>
> Regards nymo
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to