You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Reynir Hübner <Re...@hugsmidjan.is> on 2001/07/31 17:12:52 UTC

image resize

Hi, 
this is probably a bit of topic...
What would be the best way to resize images with servlet ?
I have .jpgs and .gifs in files (not kept in database) and I need to
create new files in different sizes from those images.
Is anyone willing to give me a hint (or more :) on how to do it. 

thanx
-r



RE: image resize

Posted by Pete Freitag <pf...@cfdev.com>.
I wouldn't say its "Beyond the Scope of Servlets" there are several usages
for server side image manipulation in web applications, and many other web
development languages have components for doing so.  For instance
	- automatically resizing images when they are uploaded so that they are all
the same size.
	- automatically generating thumbnails
	- In some very specific cases, creating dynamic images with text

Though I can see where you are coming from it IS beyond the scope of
servlets to make a server side PhotoShop.

________________________________________
Pete Freitag (pfreitag@cfdev.com)
CFDEV.COM
Web Developers Resources
http://www.cfdev.com/

-----Original Message-----
From: Richard Draucker [mailto:richard@draucker.com]
Sent: Tuesday, July 31, 2001 12:08 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: image resize


Can you be more specific what you mean by "resize"?
Html will allow you to set the displayable height/width of an image.  If
your
servlet is outputting html, just add a height or width attribute.
However, if you want to "manipulate" the image itself that's beyond the
scope
of tomcat or servlets in general... use your favorite image editor and serve
the resulting image from the servlet.



On Tuesday 31 July 2001 11:12 am, you wrote:
> Hi,
> this is probably a bit of topic...
> What would be the best way to resize images with servlet ?
> I have .jpgs and .gifs in files (not kept in database) and I need to
> create new files in different sizes from those images.
> Is anyone willing to give me a hint (or more :) on how to do it.
>
> thanx
> -r

--
Richard Draucker richard@protected-data.com
Protected-Data.Com www.protected-data.com
Remote Data Support For Web Developers



Re: image resize

Posted by Richard Draucker <ri...@draucker.com>.
Can you be more specific what you mean by "resize"?
Html will allow you to set the displayable height/width of an image.  If your 
servlet is outputting html, just add a height or width attribute. 
However, if you want to "manipulate" the image itself that's beyond the scope 
of tomcat or servlets in general... use your favorite image editor and serve 
the resulting image from the servlet. 



On Tuesday 31 July 2001 11:12 am, you wrote:
> Hi,
> this is probably a bit of topic...
> What would be the best way to resize images with servlet ?
> I have .jpgs and .gifs in files (not kept in database) and I need to
> create new files in different sizes from those images.
> Is anyone willing to give me a hint (or more :) on how to do it.
>
> thanx
> -r

-- 
Richard Draucker richard@protected-data.com
Protected-Data.Com www.protected-data.com
Remote Data Support For Web Developers


RE: image resize

Posted by Wouter Boers <Wo...@MphasiS.com>.
You can do this the the Java Advanced Imaging library. Beware though when
running advanges imaging on a Unix box that does not have X installed. A bug
in Java requires a connect to the X-server to be able to handle images. The
workaround is to install a X-server simulator, called  Xvbf. This worked
fine for me on a solaris box, uploaded images are scaled to a 'small' size
and a big size and stored to be displayed later on.

I have some sources that perform scaling (on-the-fly) which are available on
request.

Wouter

-----Original Message-----
From: Reynir Hübner [mailto:Reynir@hugsmidjan.is]
Sent: 31 July 2001 17:13
To: tomcat-user@jakarta.apache.org
Subject: image resize


Hi,
this is probably a bit of topic...
What would be the best way to resize images with servlet ?
I have .jpgs and .gifs in files (not kept in database) and I need to
create new files in different sizes from those images.
Is anyone willing to give me a hint (or more :) on how to do it.

thanx
-r