You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by BEGUE Pierre <pb...@iftechnologies.net> on 2005/07/22 17:20:59 UTC
svg to jpeg
hi thomas
i convert my svg File with this dimension with="465" height="368"
when he create my jpeg File i don't show entirely my svg file and my
jpegFile dimension is 400x400 by default
but when i use the squiggle he cant convert entirely the svg File and
the dimension of the jpeg File is 788x466
you can explain me please thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: svg to jpeg
Posted by BEGUE Pierre <pb...@iftechnologies.net>.
thanks thomas for all your advices. I find the problem it's in the head
svg id="main" i don't put the attribut height,width and viewBox.
all the problem i have got it's with the svg (syntax)
thanks,
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: svg to jpeg
Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Pierre,
BEGUE Pierre wrote:
> i use JSP. And you can see the difference between the 2 jpeg one with
> squiggle the other with the code i wrote)
> one is complete, the other not. I dont understand why?
Neither do I, but since the code works fine in a standalone
program the problem is not likely to be Batik, or the way you
are using Batik, it is likely how you have the servlet set up.
Perhaps you are not running the code you think you are...
Try adding logging statements or even totally breaking things to
see if you are running what you think you are.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: svg to jpeg
Posted by BEGUE Pierre <pb...@iftechnologies.net>.
hi thomas thanks for all your response you give.
i use JSP. And you can see the difference between the 2 jpeg one with
squiggle the other with the code i wrote)
one is complete, the other not. I dont understand why?
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: svg to jpeg
Posted by Thomas DeWeese <Th...@Kodak.com>.
BEGUE Pierre wrote:
> my svg file has this lenght : sortieFlux.svg 727Ko
>
> i use batik 1.6 with this code and he dont complete my jpeg by the
> JPEGTranscoder
Once you use AWT you need to explicitly kill your
application with System.exit(0). Otherwise the Swing (GUI)
thread sits around waiting for you to show a window.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: svg to jpeg
Posted by BEGUE Pierre <pb...@iftechnologies.net>.
my svg file has this lenght : sortieFlux.svg 727Ko
i use batik 1.6 with this code and he dont complete my jpeg by the
JPEGTranscoder
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: svg to jpeg
Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Pierre,
BEGUE Pierre wrote:
This works fine for me with the current SVN version of Batik.
> and this my code :
>
>
> try{
> out.flush();
> Rectangle rect = new Rectangle(0,0,788,466);
> //Creation d un JPEG transcoder
> JPEGTranscoder t = new JPEGTranscoder();
>
> //JOptionPane JOptPan = new JOptionPane();
> //JOptPan.showMessageDialog(null,"lancement de la convertion
> JPEG","MESSAGE",JOptPan.PLAIN_MESSAGE);
>
> //String str = JOptPan.showInputDialog("entrez la valeur de la
> qualite image (0.1<x<0.9)");
> //float val = Float.parseFloat(str);
>
> // Choix de la qualite image
> t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,new Float(0.9));
>
> t.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, new
> Float(rect.width));
> t.addTranscodingHint(JPEGTranscoder.KEY_HEIGHT, new
> Float(rect.height));
> t.addTranscodingHint(JPEGTranscoder.KEY_AOI, rect);
>
>
> // Creation d un transcoder input
> String svgURI = new File(fichier).toURL().toString();
> TranscoderInput input = new TranscoderInput(svgURI);
>
>
> // Creation d un transcoder output
> OutputStream ostream = new FileOutputStream(sortie);
> TranscoderOutput output = new TranscoderOutput(ostream);
> ostream.flush();
> // Sauvegarde de l image
> t.transcode(input, output);
>
> ostream.flush();
> ostream.close();
> }catch(Exception e){}
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: svg to jpeg
Posted by BEGUE Pierre <pb...@iftechnologies.net>.
and this my code :
try{
out.flush();
Rectangle rect = new Rectangle(0,0,788,466);
//Creation d un JPEG transcoder
JPEGTranscoder t = new JPEGTranscoder();
//JOptionPane JOptPan = new JOptionPane();
//JOptPan.showMessageDialog(null,"lancement de la convertion
JPEG","MESSAGE",JOptPan.PLAIN_MESSAGE);
//String str = JOptPan.showInputDialog("entrez la valeur de la
qualite image (0.1<x<0.9)");
//float val = Float.parseFloat(str);
// Choix de la qualite image
t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,new Float(0.9));
t.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, new
Float(rect.width));
t.addTranscodingHint(JPEGTranscoder.KEY_HEIGHT, new
Float(rect.height));
t.addTranscodingHint(JPEGTranscoder.KEY_AOI, rect);
// Creation d un transcoder input
String svgURI = new File(fichier).toURL().toString();
TranscoderInput input = new TranscoderInput(svgURI);
// Creation d un transcoder output
OutputStream ostream = new FileOutputStream(sortie);
TranscoderOutput output = new TranscoderOutput(ostream);
ostream.flush();
// Sauvegarde de l image
t.transcode(input, output);
ostream.flush();
ostream.close();
}catch(Exception e){}
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: svg to jpeg
Posted by BEGUE Pierre <pb...@iftechnologies.net>.
Thomas DeWeese wrote:
> Hi Begue,
>
> BEGUE Pierre wrote:
>
>> i convert my svg File with this dimension with="465" height="368"
>>
>> when he create my jpeg File i don't show entirely my svg file and my
>> jpegFile dimension is 400x400 by default
>
>
> This means that something is wrong with your specification of
> width/height. Can you provide a small example.
>
>> but when i use the squiggle he cant convert entirely the svg File and
>> the dimension of the jpeg File is 788x466
>>
>> you can explain me please thanks
>
>
> No, not with this level of detail.
so this with squiggle the jpeg
Re: svg to jpeg
Posted by BEGUE Pierre <pb...@iftechnologies.net>.
Thomas DeWeese wrote:
> Hi Begue,
>
> BEGUE Pierre wrote:
>
>> i convert my svg File with this dimension with="465" height="368"
>>
>> when he create my jpeg File i don't show entirely my svg file and my
>> jpegFile dimension is 400x400 by default
>
>
> This means that something is wrong with your specification of
> width/height. Can you provide a small example.
>
>> but when i use the squiggle he cant convert entirely the svg File and
>> the dimension of the jpeg File is 788x466
>>
>> you can explain me please thanks
>
>
> No, not with this level of detail.
so with my code
Re: svg to jpeg
Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Begue,
BEGUE Pierre wrote:
> i convert my svg File with this dimension with="465" height="368"
>
> when he create my jpeg File i don't show entirely my svg file and my
> jpegFile dimension is 400x400 by default
This means that something is wrong with your specification of
width/height. Can you provide a small example.
> but when i use the squiggle he cant convert entirely the svg File and
> the dimension of the jpeg File is 788x466
>
> you can explain me please thanks
No, not with this level of detail.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org