Hi,

what do you mean with "when this GIF image stream is passed to Cocoon code it gets 
transformed back to JPG"?
In my CustomReader Class I am just overriding the method processStream() of ImageReader Class. And in the processStream() of my CustomeReader Class, I am transforming the JPG image into GIF image. I have checked mime-type of the image which has been transformed by my CustomeReader Class, it is image/gif.

do you mean your browser is indicating the file received being JPG or even your 
OS bluntly assumes a file named '*.jpg' being JPG?
Yes, On the browser the image is coming as JPG format but it should come as GIF Format as transformed by my CustomReader Class.

Did you actually verify the format of the file received being JPG?
Yes i have checked the mime type of the image.

Gaurav

Rainer Pruy wrote:
Hi,

what do you mean with "when this GIF image stream is passed to Cocoon code it gets 
transformed back to JPG"?

If you gave the complete pipeline, there is no other cocoon component involved 
that could run a conversion from GIF to JPG.
Or do you mean your browser is indicating the file received being JPG or even 
your OS bluntly assumes a file named '*.jpg' being JPG?

Be aware, that your browser probably does give more trust in the URL ending 
with '.jpg' than the actual mime type being indicated by
cocoon. This way tricking you in believing you did get JPG.

Did you actually verify the format of the file received being JPG?

Rainer

Gaurav Kalia schrieb:
For that matter, you can set it in the pipelines, like:
      <map:match pattern="favicon.ico">
        <map:read src="resource/external/images/favicon.ico"
mime-type="image/vnd.microsoft.icon"/>
</map:match>
This is the pipeline we are using:

   <map:match pattern="test.jpg">
           <map:read type="customreader"
src="/home/user/Desktop/test.jpg" mime-type="image/gif">
               <map:parameter name="width" value="250"/>
               <map:parameter name="height" value="160"/>
           </map:read>
       </map:match>

Here we are using JPG image in the src and the mime-type is set to
image/gif. CustomReader is our reader which is transforming the image
and converting it into GIF image.

I am saving the image which has been transformed by my CustomReader at
physical location and i can see that the JPG image got converted into
GIF Image which is exactly what i want but when this GIF image stream is
passed to Cocoon code it gets transformed back to JPG.

I am trying to find that piece of code which is transforming the image
back to JPG after my CustomReader.

Please Suggest

Luca Morandini wrote:
On 21/10/09 18:11, Anish wrote:
But the problem is that when the gif stream is generated by our modified
image reader, somewhere in the code Cocoon automatically converts its
mime type to JPEG and again returns a JPEG image irrespective of the
required mime-type.
For that matter, you can set it in the pipelines, like:
      <map:match pattern="favicon.ico">
        <map:read src="resource/external/images/favicon.ico"
mime-type="image/vnd.microsoft.icon"/>
      </map:match>
      <map:match pattern="*.png">
        <map:read src="resource/external/images/{1}.png"
mime-type="image/png"/>
      </map:match>
...etc

--------------------
   Luca Morandini
www.lucamorandini.it
--------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org

Reply via email to