tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Oinn <...@ebi.ac.uk>
Subject Re: image manipulating via servlets on tomcat4
Date Tue, 12 Mar 2002 15:15:23 GMT


yilmaz wrote:
> 
> Hi  everybody,
> I am using tomcat4 on win 2000.
> I have searched all the archives and almost all websites related with java,
> to no avail.
> My problem is manupulating  images via servlets on Tomcat.
> In fact , there are tons of examples on the internet and on the archives
> which shows
> how to load an image from a local file and send to the browser, or
> dynamically
> generate a gif , or jpg image  and send it  to the user. Up to here ,
> everything is allright.
> But , it seems that there is no way to load an image from a file (at
> server), write some text on it
> or edit that image on hand, finally send it to hte browser as a new image.
> I tried almost every way, in vain :(
> I hope, someone overthere, an expert, be nice enough to answer my question,
> though my
> question might sound a little bit offtopic.
> Looking forward to your help hopefully.
> Cheers :)

It sounds that you need to do the following :

1) Load your image and do whatever manipulation you would do normally,
this gives you some kind of object representing the image data yes?
2) Set the response content type to something appropriate to the image
format you want to use
3) Get the writer for the http response
4) Get a reader from your image object, through some kind of encoder
format (jpeg, gif etc)
5) Read from the reader, writing to the writer and you should be
returning an image to the client.

Hope that helps,

Tom

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message