----- Original Message -----
From: "BJ Freeman" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, July 27, 2008 6:54 PM
Subject: Re: Automatically image resizing
I would be an advantage if you did learn ofbiz.
It would make your contribution very helpful.
:)
Oh I'm sorry, need to explain what I'm thinking... then you can tell me if
ofbiz can do this...
Hopefully an office biz template can do something as simple as this...
<p><img border="0" src=http://myOfBizServer/webapp/image.jpg?size = small
width="100" height="75"></p>
Something like that... then you make a little webapp servlet called
image.jpg...
load the icon from disk...
Image scaledImage = myImage.getScaledInstance(height , height,
Image.SCALE_SMOOTH);
rescale it... send the bytes...
All the offbiz template, web page whatever has to do is be able to hold a
URL...
The rescaling is happening server side... so no big download till the user
wants to see a big image... and a single image is kept server side....
Or store big/medium/small on a webserver anywhere... forget the servlet
rescaling and just display the URL..
Cant actually see why its difficult ;) Why is that difficult in ofbiz?
I'm learning here ;)
Johnny Kewl sent the following on 7/27/2008 9:24 AM:
Hi,
does anybody know if there is some mechanism to have a sort of control
on
uploaded image sizes?
I mean, l would like that when I upload a new image for a product ofbiz
automatically generates the small, medium, large and detailed images
scaling
the uploaded image with a fixed dimension regardless of the original
one.
Many thanks,
Bruno
Bruni, dont know ofBiz but start by playing with something like this...
public Image getScaledImage(ImageIcon myLoadedImageIcon)
{
Image myImage = myLoadedImageIcon.getImage();
Image scaledImage = myImage.getScaledInstance(height ,
height, Image.SCALE_SMOOTH);
return scaledImage;
}
Then googling on AWT images will probably get you going...
---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------