-
1. Re: Why s:graphicImage can not show bmp?
gonzalad Jul 20, 2010 11:32 AM (in response to loveseam)Same problem here, with Seam 2.2.0.GA.
I'm using this :
<s:graphicImage value="/img/google12.bmp"/>
And when I call my page, I have the following stackTrace :
java.lang.NullPointerException
at org.jboss.seam.ui.graphicImage.Image.getImage(Image.java:154)
at org.jboss.seam.ui.graphicImage.GraphicImageRendererBase.doEncodeBegin(GraphicImageRendererBase.java:44)
at org.jboss.seam.ui.util.cdk.RendererBase.encodeBegin(RendererBase.java:79)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592) -
2. Re: Why s:graphicImage can not show bmp?
gonzalad Jul 20, 2010 11:56 AM (in response to loveseam)Sorry, issue already submitted in JIRA : JBSEAM-3917
-
3. Re: Why s:graphicImage can not show bmp?
gonzalad Jul 20, 2010 12:08 PM (in response to loveseam)Hello,
Does someone has an idea of how I can extend Seam to add bmp image handling ?
I've just patched org.jboss.seam.ui.graphicImage.Image, by adding IMAGE_BMP field in enum type, and it works fine :
public enum Type { IMAGE_PNG("image/png", ".png", "PNG"), IMAGE_JPEG("image/jpeg", ".jpg", "JPEG", "image/jpg"), IMAGE_GIF( "image/gif", ".gif", "GIF"), IMAGE_BMP("image/bmp", ".bmp", "bmp");
But how can I extend Seam without patching it (I must add IMAGE_BMP value in an enum, and I suppose it's impossible - enum values are immutable I think).
If enum values are immutable, shouldn't it be better to modify Seam base code (make Type a java class) in order to be able to extend it in the future ?
Thanks for your help
-
4. Re: Why s:graphicImage can not show bmp?
thokuest Jul 20, 2010 12:29 PM (in response to loveseam)If you do not create the bmp dynamically from your Seam component, use <h:graphicImage> instead of <s:graphicImage>.
-
5. Re: Why s:graphicImage can not show bmp?
gonzalad Jul 20, 2010 1:18 PM (in response to loveseam)If you do not create the bmp dynamically from your Seam component, use <h:graphicImage> instead of <s:graphicImage>.
Problem is I create bmp dynamically ;((
-
6. Re: Why s:graphicImage can not show bmp?
gonzalad Jul 20, 2010 1:19 PM (in response to loveseam)Or rather : I upload the image into my database (LOB) and download it afterwards.
-
7. Re: Why s:graphicImage can not show bmp?
thokuest Jul 21, 2010 2:19 AM (in response to loveseam)Ok, understood. Either you convert the bmp into a web friendly format (e.g via ImageIO) or you patch Seam as you already suggested.
-
8. Re: Why s:graphicImage can not show bmp?
gonzalad Jul 21, 2010 9:29 AM (in response to loveseam)Thanks Thomas !
I've added my vote for this JIRA issue. Meanwhile, I'm dropping support for bmp files in my application. I won't add it only of explicitly requested by my users (I prefer to avoid patching Seam codebase even if it's a trivial patch).
-
9. Re: Why s:graphicImage can not show bmp?
thokuest Jul 21, 2010 4:23 PM (in response to loveseam)Unfortunately, Seam 2 is at the end of its lifetime. Even if you submit a patch, I don't think this issue gets fixed. Another solution to serve dynamically created bmp images would be to use a servlet.
Hope that helps!
-
10. Re: Why s:graphicImage can not show bmp?
kenanaydin1905 Jul 22, 2010 7:18 AM (in response to loveseam)BUT; İT DİSPLAYS ITS IMAGES FOR EXAMPLES SEAMLOGO IMAGE AND ALSO ERROR IMAGE.YOU CAN USE FOR BMP, JPEG AND THE OTHERS