jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abey Mullassery" <a...@mullassery.com>
Subject Re: New fitIn tag for image taglib
Date Wed, 24 Mar 2004 17:31:07 GMT

The Image tag is in the sandbox. We could add this tag and get more feedback.
I will put in your suggested Tag. Many others have sent me suggestions and code snippets to
add into the PMIW (http://www.mullassery.com/software/PMIW/) as well. Will do all this sometime
during the coming week (am traveling now).

I would like to put the PMIW also as a public project where anyone could contribute. Since
it is the common lib used by Image Taglib and Image Ant Task (http://www.mullassery.com/software/ANT/),
I cannot add it to either. Any suggestions? 


Abey Mullassery
http://www.mullassery.com



> ------------Original Message------------
> From: Matti Härö <matti.haro@infosto.fi>
> To: Tag Libraries Developers List <taglibs-dev@jakarta.apache.org>
> Date: Wed, Mar-24-2004 2:01 PM
> Subject: Re: New fitIn tag for image taglib
> 
> Hi Felipe,
> 
> TitInTag differs from resize tag in that it can be used to fit an arbitrarily
> oriented (portrait or landscape) image into an area of given width and height,
> without touching the proportions of the image.
> 
> Using the ResizeTag for the same purpose your would have to know in advance if
> the picture is portrait or landscape oriented. In many applications the picture
> is fetched from database and you don't know the orientation in advance. With
> ResizeTag, you have three options:
> 
> 1) Use width and height attributes to limit the dimensions of the image to make
> it fit in a specified GUI area. The good thing about this solution is, that the
> image is really fitted into a specified GUI area. Downsides of this solution:
> The picture proportions may be forcefully changed (portrait images are streched
> and lanscape images are squeezed), if the original proportions don't happen to
> match exactly with the dimensions specified by the tag attributes. This happens
> quite a lot with arbitrarily oriented portrait/landscape dynamic pictures.
> 2) Use the width attribute to limit the width of the image. The image
> proportions are kept as they were, which is a good thing. The downside is, that
> we can only guarantee that the widht of the image fits in a certain area of the
> GUI. If the picture is portrait oriented, then the height of the picture may
> exceed the desired area size.
> 3) Use the height attribute to limit the height of the image. The image
> proportions are kept as they were, which is again a good thing. The downside is,
> that we can only guarantee that the height of the image fits in a certain area
> of the GUI. If the picture is landscape oriented, then the width of the picture
> may exceed the desired area size.
> 
> Using the FitInTag, you can fit the image into a specified area, regardless of
> the image orientation, without loosing the original image proportions. The image
> looks the same as the original, only it's size is updated to fit in a box. Using
> the ResizeTag you wont be able to do the same.
> 
> 
> A simple example:
> 
> Our GUI designer desides that he wants a dynamic picture from our image engine,
> and that the area reserved in the GUI for the image is:
> 
> width 140
> height 150
> 
> This area of 140x150 pixels should be filled by the dynamic picture from our
> product database in a way that the image proportions are left untouched.
> Portrait images should be displayed as portrait images, and landscape images
> should be displayed as landscape images. This means that:
> 
> a) With portrait images, there should be unused space in the left and right of
> the image.
> b) With landscape images, there should be unused space in the top and bottom of
> the image.
> 
> This is where the FitInTag comes handy. You can just tell the FitInTag, that fit
> the image into an area of 140x150, and the resulting image will fit in the area.
> 
> Note the difference in between:
> 
> given GUI area size (This is the size of the GUI area where the image should fit
> in, and is described by the width and height attributes of the FitInTag. In this
> example case this is: 140x150)
> 
> and
> 
> image dimensions (This is the resulting image size. In this example case, it
> might be something like 140x100, 140x112, 140x96 for landscape images, or
> 90x150, 106x150, 66x150, 131x150 for portrait images). These actual image
> dimensions are determined by the FitInTag, using the given GUI area size (width
> and height attributes) and the image orientation as input data.)
> 
> With best regards,
> Matti Härö
> 
> 
> 
> 
> 
> Lainaus Felipe Leme <jakartalists1@felipeal.net>:
> 
> > Hi Matti,
> > 
> > 
> > On Tue, 2004-03-23 at 08:30, Matti Härö wrote:
> > 
> > > The purpose of the FitInTag is to scale down/up given image to fit in an
> > area of
> > > given size (described by width and height). The tag determines if the
> > picture is
> > 
> > I'm not too familiar with the Image taglib, but isn't it the resize tag
> > enough for your needs? From
> > http://jakarta.apache.org/taglibs/sandbox/doc/image-doc/index.html:
> > 
> > This tag scales/ resizes an image loaded by an enclosing parent tag. 
> > This can be used to generate thumbnails or to zoom into an image.
> > 
> > > 		if (pTag == null || !(pTag instanceof ImageHolder))
> > > 			throw new JspException("Resize must be a nested tag of Image Tag!");
> > 
> > Looks like you copied Resize's structure in your tag. Hence, you knew
> > this tag existed and it probably didn't fit your needs, right? In this
> > case, could you please give us a more detailed description on what the
> > tag does, how is it different from Resize and what's the meaning of the
> > attributes? You could take as example resize's own documentation:
> > 
> > http://jakarta.apache.org/taglibs/sandbox/doc/image-doc/index.html#resize
> > 
> > 
> > If you can make it clear that these tags have different purposes (and
> > how they differ), I will gladly commit these changes (otherwise,
> > committing it would make the maintenance difficult later on).
> > 
> > Regards,
> > 
> > Felipe
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
> > 
> > 
> 
> 
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Mime
View raw message