google-code-export / django-photologue

Automatically exported from code.google.com/p/django-photologue
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Force resized images to different type #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Since there are image types that PIL understands but browsers may not (TIFF
is the one that is bugging me, but I'm sure there are others), I'm looking
at "fixing" photologue to either enable forcing all resized images to be of
a particular type (e.g. mid-quality JPEG), or converting particular
specified types when resizing etc. (so JPEGs would stay JPEGs, PNGs would
stay PNGs, but I could force TIFFs to be resized into PNGs, for example).

I'd rather do it this way than batch-converting images before import, as I
prefer to be able to keep all the original metadata etc., and to allow
downloading the actual original in the original format if desired.

Main issue is that I don't want to have to maintain a branch if I go ahead
and do this -- so before I start, I was wondering whether it's a feature
you'd be interested in having in there (of course, if you like the idea so
much that you decide to implement it yourself and save me the bother, that
would be even better ;-) ).

Original issue reported on code.google.com by monsterl...@gmail.com on 11 May 2008 at 10:59

GoogleCodeExporter commented 9 years ago
The issue to me is how to maintain quality. PIL handles paletted(gif, png, etc) 
and non-paletted images differently and 
converting between the two can produce less than desirable results. I'm not an 
expert in PIL so there may be ways to make 
these conversions without losing as much quality, but my experiments in that 
area have all shown poor results. This is 
why effects available in Photologue can not be applied to paletted images. I'm 
also curious as to how PIL handles TIFF files 
and various compression schemes and formats they can contain. 

These technical issues aside. If you can come up with code that can perform the 
translations, adding a 
"CONVERT_TO_WEB_FRIENDLY" setting or adding a "output file type" field to the 
photo size model would be fine with me.

- Justin

Original comment by justin.d...@gmail.com on 11 May 2008 at 2:21

GoogleCodeExporter commented 9 years ago
OK, I'll have a play around and see what works.

Cheers,

Nick

Original comment by monsterl...@gmail.com on 12 May 2008 at 8:16

GoogleCodeExporter commented 9 years ago
Got a patch that seems to work... not extensively tested, but It Works For Me.

Original comment by monsterl...@gmail.com on 18 May 2008 at 8:42

Attachments:

GoogleCodeExporter commented 9 years ago
ImageKit now support forcing the output file type and extension for each spec. 
Thank 
you very much for the patch but I don't think I want to try to support this in 
the 2.x 
branch.

Original comment by justin.d...@gmail.com on 23 Jul 2009 at 4:24