I have a problem and I hope that you could help me. I'm using struts2 and I have an action like that:
<action name="myAction" method="cimas" class="MyClass" >
<result name="success" type="stream">
<param name="contentType">image/jpeg</param>
<param name="inputName">inputStream</param>
<param name="contentDisposition">inline;filename="${filename}"</param>
<param name="bufferSize">1024</param>
</result>
</action>
Until here everything's perfect, I set from my class the inputStream
using this code:
filename = "anImage.jpg";
File img = new File("D://anImage.jpg");
inputStream = new FileInputStream(img);
and the image shows correctly, but the problem appears when I try to display an imagen with tif format.
I change the path of the image, the filename and I set the contentType
to:
<param name="contentType">image/tiff</param>
But it doesn't work and I wonder why. Can anybody help me?
Edit:
I edited the answer to explain what I did to resolve the problem.
As many users said to me, tiff format isn't for web use. Inspite of it, with IE and AlternaTIFF I accomplished to show the image. But as I wanted a solution for all browsers finally I converted the image to jpg and I displayed it using ImageMagick.
Thanks all for your help.