Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Clubbing two images using a servlet

 
Mahesh Sivaraman
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i have some images (jpegs and gifs.). In my servlet I want to put my logo on the right top of the image and sent it back to the browser as a single image. I tried with JpegEncoder and GifEncoder from Acme.
How can i do that with my servlet.
Can anyone shed some light ?
Mahesh
[ September 01, 2002: Message edited by: mahesh sr ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In 50 words or less:
You need to map your servlet as something like MyImageServetThing and then call images as /webapp/MyImageServetThing/otherImage.jpg
If you do it right then otherImage.jpg will be passed a parameter to the servlet. You can then load the image, paste your image over the top, set the content-type and throw the custom image back.
Damnit, 54 words
Dave
 
Mahesh Sivaraman
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
thanx for the reply. But that is not my problem. i'll explain. I've loaded the images (main image and the logo). I've created a BufferedImage and draw both the images on it using its graphics object. Both are Jpegs. I gave that image to the JpegEncoder to encode it. But when it encodes only the main image comes. the logo is no longer there. Will the JPegEncoder cause any prob when we give it an image (BufferedImage) which contains two JPegs?? Any probs with the Jpeg header??
Regards
Mahesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic