[Zope] display properties

Menno Brandsen menno@zreal.net
Wed, 18 Jul 2001 18:12:20 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0001_01C10FB5.301738D0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

I have a question about displaying properties of an image
 
The situation is this :
I have a folder called images, where users can upload pics.
when the pic gets uploaded, the id also gets stored into a MySQL
database
 
when a certain page is called it retrieves the correct image from the
folder by connecting the ImageID from the database to the id in the
folder
So far so good, this works fine.
 
but when I retrieve the image from the folder I also need the width and
the height from the image, and that's the part I do not seem to get
right
this is the code I tried :
 
( Photo is the DataBase entry )
 
<dtml-call "REQUEST.set('photo',Photo)">

<dtml-with expr="inbox.photos.objectValues()">
<dtml-call "REQUEST.set('id',id)">
<dtml-call "REQUEST.set('width',width)">
<dtml-call "REQUEST.set('height',height)">

<dtml-if "photo  == id"> <dtml-var id> <dtml-var width>  <dtml-var
height> <dtml-else> No Pic  </dtml-if>

</dtml-with>
 
I hope someone can help me out with this
Thanx in advance, 
 
Menno

------=_NextPart_000_0001_01C10FB5.301738D0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<TITLE>Message</TITLE>

<META content=3D"MSHTML 6.00.2512.1" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial size=3D2>I have =
a question=20
about displaying properties of an image</FONT></SPAN></DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial size=3D2>The =
situation is=20
this :</FONT></SPAN></DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial size=3D2>I have =
a folder=20
called images, where users can upload pics.</FONT></SPAN></DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial size=3D2>when =
the pic gets=20
uploaded, the id also gets stored into a MySQL =
database</FONT></SPAN></DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial size=3D2>when a =
certain page=20
is called it retrieves the correct image from the folder by connecting =
the=20
ImageID from the database to the id in the folder</FONT></SPAN></DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial size=3D2>So far =
so good, this=20
works fine.</FONT></SPAN></DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial size=3D2>but =
when I retrieve=20
the image from the folder I also need the width and the height from the =
image,=20
and that's the part I do not seem to get right</FONT></SPAN></DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial size=3D2>this =
is the code I=20
tried :</FONT></SPAN></DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial size=3D2>( =
Photo is the=20
DataBase entry )</FONT></SPAN></DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial =
size=3D2>&lt;dtml-call=20
"REQUEST.set('photo',Photo)"&gt;</FONT></SPAN></DIV><SPAN=20
class=3D306375815-18072001>
<DIV><BR><FONT face=3DArial size=3D2>&lt;dtml-with=20
expr=3D"inbox.photos.objectValues()"&gt;<BR>&lt;dtml-call=20
"REQUEST.set('id',id)"&gt;<BR>&lt;dtml-call=20
"REQUEST.set('width',width)"&gt;<BR>&lt;dtml-call=20
"REQUEST.set('height',height)"&gt;</FONT></DIV>
<DIV><BR><FONT face=3DArial size=3D2>&lt;dtml-if "<SPAN=20
class=3D306375815-18072001>photo </SPAN>&nbsp;=3D=3D&nbsp;<SPAN=20
class=3D306375815-18072001>id</SPAN>"&gt;<SPAN=20
class=3D306375815-18072001>&nbsp;&lt;dtml-var id&gt;&nbsp;&lt;dtml-var=20
width&gt;&nbsp; &lt;dtml-var =
height&gt;&nbsp;</SPAN>&lt;dtml-else&gt;<SPAN=20
class=3D306375815-18072001>&nbsp;</SPAN><SPAN =
class=3D306375815-18072001>No=20
Pic</SPAN><SPAN class=3D306375815-18072001>&nbsp;=20
</SPAN>&lt;/dtml-if&gt;</FONT></DIV>
<DIV><BR><FONT face=3DArial size=3D2>&lt;/dtml-with&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial size=3D2>I hope =
someone can=20
help me out with this</FONT></SPAN></DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial size=3D2>Thanx =
in advance,=20
</FONT></SPAN></DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D306375815-18072001><FONT face=3DArial=20
size=3D2>Menno</FONT></SPAN></SPAN></DIV></BODY></HTML>

------=_NextPart_000_0001_01C10FB5.301738D0--