[Zope-dev] Resize a image stored in a Oracle's BLOB Field

Lennart Regebro lennart@regebro.nu
Mon, 12 Nov 2001 16:27:06 +0100


From: Juan Javier Carrera Obrero
>Thanks, I have displayed the images which them was stored in a Oracle's
BLOB field, with:
>
><dtml-call expr="RESPONSE.setHeader('content-type','image/jpeg')">
><dtml-in SQLMethod_with_a_Only_Row>
><dtml-var expr="BLOB_FIELD.read()">
></dtml-in>
>
>However, I would like to resize this image. I can not do it with the
"height" and "width" attributes, because the image is >obtained from a
Oracle's BLOB field, and no from image object (i.e.: I can not use <dtml-var
"ImageObject.tag(border='5', >align='left')">).
>
>How can I do it ?

I don't understand why this would make any difference. The code above is to
send the actual image data, the resizing is done when you create the
IMG-tag, which I assume you create somewhere else. Or don't you have an
IMG-tag at all, just a link?

If you actually want to resize the image itself to send less image-data, the
PIL library can be used to do that. But it seems easier to resize the image
before putting it into the database in that case.