> I havent tried to duplicate using your code, but I do notice that my
servlet 
> transcodes always set the content type before obtaining the sevlet output
stream:
>
>        response.setContentType("image/png");

Actually, this line precedes my lines below ;-)

But good to know it works somewhere else in the servlet environment (are you
really able to save the result image?) so it seems to be my fault. 

I would be grateful for a link to any working example code... I hope there
is no any special magic behind, just a small mistake from my side...

On Tue, Feb 23, 2010 at 2:11 PM, Jan Tosovsky <[email protected]> wrote:
> > Although I can see the result in the target browser, I am unable to
> save the
> > image on a local disk. Actually, in Firefox I can notice an attempt
> to save
> > the file, but in a download manager it is of zero size and it is not
> really
> > present in the target location. MSIE offers me save the PNG file in
> BMP
> > format...
>
> The fact that you can see it and cannot save it very weird. Even
> weirder is the described MSIE behavior. If you are working with the
> trunk code, maybe your are getting bit by bug 48693 [1]? If you are
> working with Batik 1.7, that may be bug 46863 [2].
Thanks for this info. It led me to try also JPEG output, but the result is
the same. I suspect the way of closing the final stream. I think the browser
can display partial data but as they are unfinished properly, it made him
puzzled a bit.

Transcoding via command line is Ok in all cases.

> Could you try to analyze the (supposedly PNG) raw file saved and/or
> attach it to a reply?
No file is created in FF so there is nothing to analyze. And that MSIE BMP
file is the standard image. It is probably a kind of the screenshot of an
internal canvas.

Here is the final part of my code:

TranscoderOutput output = new TranscoderOutput(response.getOutputStream());
t.transcode(input, output);
// I've tried to find any closing method of the 'output' object,
// but still without success. The following way also doesn't help
//
// output.getWriter().close();

ServletOutputStream out = response.getOutputStream();
out.flush();
out.close();

Any other ideas?

Jan

> Hope this helps,
>  Helder
>
>
> [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=48693
> [2] https://issues.apache.org/bugzilla/show_bug.cgi?id=46863


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to