Re: overlay images retrieved from a Database

2007-10-22 Thread mikemjt

So is my next step dropping apache image taglib and use the classic JAVA 2d
api 


mikemjt wrote:
 
 Hi there, I have a image of a map and want to overlay a set of images with
 x y coords from a database.
 This is my code which does not work!
 img:image 
 src=/images/map_01.gif 
 dir=generated 
 name=map_rendered.jpg 
 attributes=alt='A sample image'
 refresh=true
 quality=1.0
 img:resize scale=100% /
 !--load all points to map --
 c:forEach var=poimaps
 items=${requestScope.poimaps}  
 img:overlay x=${poimaps.x_id}
 y=${poimpas.y_id} color=0xff tolerance=35
 img:image
 src=/images/${poimaps.imageName}.gif /img:image
 /img:overlay
 
 /c:forEach 
 
 /img:image
 
 This is the error message!
 javax.servlet.ServletException: Overlay must be a nested tag of Image Tag!
 
 Help would be appreciated
 Mike greece...
 

-- 
View this message in context: 
http://www.nabble.com/overlay-images-retrieved-from-a-Database-tf4666946.html#a13343246
Sent from the Taglibs - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: overlay images retrieved from a Database

2007-10-22 Thread Kris Schneider
Hang on, I've got an idea that might work. I'll post back in a little
bit - gotta grab some lunch!

On 10/22/07, mikemjt [EMAIL PROTECTED] wrote:

 So is my next step dropping apache image taglib and use the classic JAVA 2d
 api 


 mikemjt wrote:
 
  Hi there, I have a image of a map and want to overlay a set of images with
  x y coords from a database.
  This is my code which does not work!
  img:image
  src=/images/map_01.gif
  dir=generated
  name=map_rendered.jpg
  attributes=alt='A sample image'
  refresh=true
  quality=1.0
  img:resize scale=100% /
  !--load all points to map --
  c:forEach var=poimaps
  items=${requestScope.poimaps}
  img:overlay x=${poimaps.x_id}
  y=${poimpas.y_id} color=0xff tolerance=35
  img:image
  src=/images/${poimaps.imageName}.gif /img:image
  /img:overlay
 
  /c:forEach
 
  /img:image
 
  This is the error message!
  javax.servlet.ServletException: Overlay must be a nested tag of Image Tag!
 
  Help would be appreciated
  Mike greece...
 

 --
 View this message in context: 
 http://www.nabble.com/overlay-images-retrieved-from-a-Database-tf4666946.html#a13343246
 Sent from the Taglibs - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Kris Schneider mailto:[EMAIL PROTECTED]
directThought  http://www.directThought.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: overlay images retrieved from a Database

2007-10-22 Thread Kris Schneider
Here's an untested idea. What if you use a proxy tag to satisfy
overlay's parenting constraints? You'd do something like:

img:image src=/images/map_01.gif
   dir=generated
   name=map_rendered.jpg
   attributes=alt='A sample image'
   refresh=true
   quality=1.0
  img:resize scale=100% /
  !--load all points to map --
  c:forEach var=poimaps items=${requestScope.poimaps}
imgHelper:proxy
  img:overlay x=${poimaps.x_id}
   y=${poimpas.y_id}
   color=0xff tolerance=35
img:image src=/images/${poimaps.imageName}.gif/
  /img:overlay
imgHelper:proxy
  /c:forEach
/img:image

Here's the code for the proxy tag:

package com.directthought.taglibs.image;

import com.mullassery.imaging.Imaging;

import java.awt.image.BufferedImage;

import javax.servlet.jsp.JspException;

import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.tagext.TryCatchFinally;

import org.apache.taglibs.image.ImageHolder;

public class ProxyTag extends BodyTagSupport implements
TryCatchFinally, ImageHolder {

private ImageHolder ancestor;

public ProxyTag() {
super();
}

public int doStartTag() throws JspException {
this.ancestor = (ImageHolder)findAncestorWithClass(this,
ImageHolder.class);
if (this.ancestor == null) {
throw new JspException(ProxyTag could not find an
ImageHolder ancestor);
}
return EVAL_BODY_BUFFERED;
}

public void doCatch(Throwable t) {
// no-op
}

public void doFinally() {
this.ancestor = null;
}

public BufferedImage getImage() {
return this.ancestor.getImage();
}

public void setImage(BufferedImage image) {
this.ancestor.setImage(image);
}

public Imaging getImaging() {
return this.ancestor.getImaging();
}
}

On 10/22/07, Kris Schneider [EMAIL PROTECTED] wrote:
 Hang on, I've got an idea that might work. I'll post back in a little
 bit - gotta grab some lunch!

 On 10/22/07, mikemjt [EMAIL PROTECTED] wrote:
 
  So is my next step dropping apache image taglib and use the classic JAVA 2d
  api 
 
 
  mikemjt wrote:
  
   Hi there, I have a image of a map and want to overlay a set of images with
   x y coords from a database.
   This is my code which does not work!
   img:image
   src=/images/map_01.gif
   dir=generated
   name=map_rendered.jpg
   attributes=alt='A sample image'
   refresh=true
   quality=1.0
   img:resize scale=100% /
   !--load all points to map --
   c:forEach var=poimaps
   items=${requestScope.poimaps}
   img:overlay x=${poimaps.x_id}
   y=${poimpas.y_id} color=0xff tolerance=35
   img:image
   src=/images/${poimaps.imageName}.gif /img:image
   /img:overlay
  
   /c:forEach
  
   /img:image
  
   This is the error message!
   javax.servlet.ServletException: Overlay must be a nested tag of Image Tag!
  
   Help would be appreciated
   Mike greece...
  
 
  --
  View this message in context: 
  http://www.nabble.com/overlay-images-retrieved-from-a-Database-tf4666946.html#a13343246
  Sent from the Taglibs - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 Kris Schneider mailto:[EMAIL PROTECTED]
 directThought  http://www.directThought.com/


-- 
Kris Schneider mailto:[EMAIL PROTECTED]
directThought  http://www.directThought.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: overlay images retrieved from a Database

2007-10-21 Thread Kris Schneider
For better or worse, img:overlay appears to  require that it's
parent tag (not just an ancestor) be an instance of
org.apache.taglibs.image.ImageHolder. In your case, c:forEach is the
parent tag so the exception gets thrown.

On 10/21/07, mikemjt [EMAIL PROTECTED] wrote:

 Hi there, I have a image of a map and want to overlay a set of images with x
 y coords from a database.
 This is my code which does not work!
 img:image
 src=/images/map_01.gif
 dir=generated
 name=map_rendered.jpg
 attributes=alt='A sample image'
 refresh=true
 quality=1.0
 img:resize scale=100% /
 !--load all points to map --
 c:forEach var=poimaps
 items=${requestScope.poimaps}
 img:overlay x=${poimaps.x_id}
 y=${poimpas.y_id} color=0xff tolerance=35
 img:image
 src=/images/${poimaps.imageName}.gif /img:image
 /img:overlay

 /c:forEach

 /img:image

 This is the error message!
 javax.servlet.ServletException: Overlay must be a nested tag of Image Tag!

 Help would be appreciated
 Mike greece...
 --
 View this message in context: 
 http://www.nabble.com/overlay-images-retrieved-from-a-Database-tf4666946.html#a13331683
 Sent from the Taglibs - User mailing list archive at Nabble.com.

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
directThought  http://www.directThought.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: overlay images retrieved from a Database

2007-10-21 Thread mikemjt

Thanks Kris, got the what you are saying can't find any samples for what
I am looking for. Doesn't anyone use the image tag lib to generate on the
fly overlayed images? 
Mike greece...

Kris Schneider wrote:
 
 For better or worse, img:overlay appears to  require that it's
 parent tag (not just an ancestor) be an instance of
 org.apache.taglibs.image.ImageHolder. In your case, c:forEach is the
 parent tag so the exception gets thrown.
 
 On 10/21/07, mikemjt [EMAIL PROTECTED] wrote:

 Hi there, I have a image of a map and want to overlay a set of images
 with x
 y coords from a database.
 This is my code which does not work!
 img:image
 src=/images/map_01.gif
 dir=generated
 name=map_rendered.jpg
 attributes=alt='A sample image'
 refresh=true
 quality=1.0
 img:resize scale=100% /
 !--load all points to map --
 c:forEach var=poimaps
 items=${requestScope.poimaps}
 img:overlay x=${poimaps.x_id}
 y=${poimpas.y_id} color=0xff tolerance=35
 img:image
 src=/images/${poimaps.imageName}.gif /img:image
 /img:overlay

 /c:forEach

 /img:image

 This is the error message!
 javax.servlet.ServletException: Overlay must be a nested tag of Image
 Tag!

 Help would be appreciated
 Mike greece...
 --
 View this message in context:
 http://www.nabble.com/overlay-images-retrieved-from-a-Database-tf4666946.html#a13331683
 Sent from the Taglibs - User mailing list archive at Nabble.com.
 
 -- 
 Kris Schneider mailto:[EMAIL PROTECTED]
 directThought  http://www.directThought.com/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/overlay-images-retrieved-from-a-Database-tf4666946.html#a13337022
Sent from the Taglibs - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]