You are not logged in Log in Join
You are here: Home » Members » Marc's Zope Page » ImageTag_CorePatch

Log in
Name

Password

 
 

Folder icon ImageTag_CorePatch

This hotfix makes it so that all Image (and derived) object use PIL to resize when you use the tag method with integer (non-%) height and/or width parameters.

This way, stuff like the PhotoAlbum will behave (not give you a page full of full-image thumbnails).

This version should be cache aware, it's recommended for big sites to associate these with an HTTPCache to cut down on PIL usage- thought it's pretty fast.

It also steals the RESPONSE.set_header code from Image so the thumbs are cached on the clients.

Since it's a hotfix it's easy to try it and see if it's working for you, and remove it if not. It does not modify any of your images - it generates the thumbs on the fly and only stores them in an HTTPCache if you have one set up.

Also - for Plone users. Currently (2.0) Plone patches Image, overriding this hofix's patch of tag(). So I added pil_tag() to get around that. You can "try with error" pil_tag() and on error use tag() then your code will work whether or not this hotfix is there (and you have a try branch to tell if it is working - to notify the user or whatever).

 Title   Type   Size   Modified   Status 
 0.1 Edit object Software Release   2001-08-20 published
 0.3 Edit object Software Release   2004-01-25 published
 ImageTag hotfix for thumbnail generation Edit object News Item 1 K 2001-08-20 published
 Software_Release.2003-12-30.2503 Edit object Software Release   2003-12-30 published