[Zope] Photo: somes issues and thoughts

Ron Bickers rbickers-dated-1011501566.7f18aa@logicetc.com
Sat, 12 Jan 2002 23:39:25 -0500


A follow up to many notes and suggestions from J Esteves:

> On-the-fly resizing could be interesting:
> ...
>   <img src="http:/somesite/img/.../picture.jpg?width=300" ...  />
> ...
> when one needs to show picture.jpg in a new size with width of 300 pixels
> or  .../picture.jpg?width=480&height=480   to limite the larger
> size to 480
> pixels.
> ...
> It could also be
> nice to allow rescaling (relatively to the original size) with
> something like
>
>      .../picture.jpg?scale=1.56

I like these ideas.  All of these are now on my todo list.

> It could also be useful to allow customization of the cookie name

Added to my todo list.

> An
> interesting exception would be to set the display cookie ALSO when
> display=='', thus activating "natural size" viewing

Added to my list.

> Ideally, the `tag' method should respect alt=='' (since sometimes one
> really wants that):

True.  Also, added to my list.

> It would be interesting to
> have public methods providing that information (height() and width()

On my todo list.

> Unfortunately, I had no time to
> determine the precise equation used by ImageMagick to calculate new
> sizes maintaining aspect ratio.

Based on the lengthy discussion of this issue, and since I didn't get any
negative responses, I'll incorporate the algorithm you provided.  Thanks!

> Image quality with PIL:
>
> I noticed that in the version of PIL I have here, 1.1.2, the resize
> method has an optional filter argument which can be "NEAREST,
> BILINEAR, or BICUBIC. If omitted, it defaults to NEAREST."  I have no
> time for careful testing now (and Image Magick is working very well),
> but noticed that `resize' is being without specifying the
> filter, thus using NEAREST and not taking full advantage of PIL
> capabilities.

In a nutshell, resized image quality with PIL stinks.  I and many others
have done countless tests with all three settings of PIL.  Not one of my
tests produced a noticeable difference in any photo, so I didn't bother
adding anything fancy in Photo to try to make the images better.  I've tried
dozens of things suggested on the PIL forums, and nothing produced images
better than the plain ol' resize.  Clearly, IM is much better than PIL at
this task, so I recommend it be used when available.

If you haven't already, take a look at
http://www.bickersfamily.org/Photos/PILvsIM/

Thanks again for your input!
_______________________

Ron Bickers
Logic Etc, Inc.