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 Gergely Hajdu <gh...@abprodata.com> on 2003/12/04 09:38:59 UTC

How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

I am using the org.apache.batik.transcoder and
org.apache.batik.transcoder.image
packages to create TIFF-images.I wonder how to
combine these with org.apache.batik.ext.awt.image.codec.tiff
packages to compress the TIFF-image I am about
to create. In this code snippet, "Images/Template.svg" is the
file that will be created as a TIFF-image.My code, so far :

// create a JPEG transcoder
TIFFTranscoder transcoder = new TIFFTranscoder();
// create the transcoder input
String svgURI = new File("Images/Template.svg").toURL().toString();
TranscoderInput input = new TranscoderInput(svgURI);

// create the transcoder output
OutputStream ostream = new FileOutputStream("Archived_Images/Template.tif");
TranscoderOutput output = new TranscoderOutput(ostream);
/* HERE I WOULD LIKE TO INCLUDE CODE FOR DOING COMPRESSION, USING CLASSES
FROM org.apache.batik.ext.awt.image.codec.tiff package. BUT I JUST DON'T
KNOW
WHAT TO WRITE */
// save the image
transcoder.transcode(input, output);
Thanks in advance
/Gergely



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Gergely,

Gergely Hajdu wrote:

> I managed to insert the white rectangle. Now some different questions :
> 
> 1.Why can't the image be seen if a compress it ? My code for doing this
> is the following :

    Why can't the image be seen where?
    I could believe that the software you are using to view them
doesn't support the types of TIFF compression used.  'Baseline'
Tiff does not include any compression (and even that is not very
completely supported) - so these are all 'extended' Tiffs.

> 2.When I want to see the image, the text can't be seen. It's very fuzzy, as
> if it was scaled in some way. Any ideas ?

    This is because your image is only 100x100 pixels (which on most
monitors is a 1-1.25 inch square of screen space at 1:1).  I suspect
that you will need to render at a higher resolution (and hence
generate a larger file).

    If you are dealing with simple black text on a white background
you really want to go to 1bpp (to 4bpp) or something similar this
would net you something like a 10-30x compression up front.  But this
would require writing a Rendered Op.

> And as usual, big thanks for helping me. If it would be possible, I would
> definitely buy you a beer for all the help you have given me :=)
> 
> Regards
> /Gergely
> 
> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Friday, December 05, 2003 6:53 PM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
> 
> 
> Gergely Hajdu wrote:
> 
> 
>>I misunderstood you, thinking #1 was not so easy either. But I'll
>>go for that suggestion.I am almost ashamed to ask, but how do you
>>that, and when...? Sorry, but I'm really a novice on graphics, and
>>all thats concerning with it.
> 
> 
>     This is all DOM stuff (more or less of the top of my head
> so it may not compile right away).
> 
>     String svgns = "http://www.w3.org/2000/svg";
>     Element rect = document.createElementNS(svgns, "rect");
>     rect.setAttribute("x", "0");
>     rect.setAttribute("y", "0");
>     rect.setAttribute("width", "100%");
>     rect.setAttribute("height", "100%");
>     rect.setAttribute("fill", "white");
>     Element root = document.getRootElement();
>     root.insertBefore(rect, root.getFirstChild());
> 
> 
> 
>>I think it will be enough to add the rectangle on the fly, just for
>>the transcoding purposes. Where should this code be inserted and how
>>does the lines to be inserted look line in TiledImageEncoder ? Or is
>>it a big task to creata the rectangle ?
> 
> 
>     Add it before calling the baseclass transcode method.
> 
> 
>>And again, great thanks for helping me.
>>/Gergely
>>
>>-----Original Message-----
>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>Sent: Thursday, December 04, 2003 7:01 PM
>>To: Batik Users
>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>
>>
>>Gergely Hajdu wrote:
>>
>>
>>
>>>Honestly, my needs are absolutely not so big at all concerning the quality
>>>of the TIFF. Actually I just plain text I want to visualise, on
>>>white/transparent background with black text. So as long as the text
>>>can be seen, I wil be satisfied :=)
>>>
>>>Huh, isn't there any easier way to achieve this than the two suggestions
>>>you are giving :=) ? Otherwise, I am afraid I will mailbomb this/other
>>>forum for a while...
>>
>>
>>    I gave three, add a white rectangle to the SVG (perhaps on the fly
>>only for transcoding purposes), use software that understands alpha
>>channels and write code to flatten (implement the background color
>>hint basically).
>>
>>    I can understand that #2 may be out, #3 may be more work than you
>>want to do (although it might open the door for other enhancements
>>like going to 1bpp), but what is wrong with #1?
>>
>>
>>
>>
>>>As I mentioned, I just need to be able to see the text. In the "worst"
>>
>>case
>>
>>
>>>maybe other colors can be used to than black/white if it makes a solution
>>>easier.
>>>
>>>Regards
>>>/Gergely
>>>
>>>-----Original Message-----
>>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>>Sent: Thursday, December 04, 2003 5:11 PM
>>>To: Batik Users
>>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>>
>>>
>>>Gergely Hajdu wrote:
>>>
>>>
>>>
>>>
>>>>Finally Thomas, I've managed to run the program :=)
>>>>But there are just a small bit missing....The created
>>>>TIFF-image can't be viewed, I just see a black background.
>>>
>>>
>>>  Actually you are seeing opaque black text on a transparent black
>>>background :)  You either need to insert an opaque white rectangle
>>>into the SVG source (before everything else).  Use software that
>>>understands alpha channels, or write code to 'flatten the image'
>>>(* this is non-trivial).
>>>
>>>
>>>
>>>
>>>>tit.addTranscodingHint( ImageTranscoder.KEY_BACKGROUND_COLOR, // ADDED
>>>
>>>MYSELF
>>>
>>>
>>>
>>>>				Color.white );
>>>
>>>
>>>  This would be one of the bells and whistles not supported by the
>>>tiled transcoder.
>>>
>>>
>>>
>>>
>>>>The TIFF is now just 14000 byte ( suspiciously small...). What does the
>>>>KEY_WIDTH and KEY_HEIGHT mean ?
>>>
>>>
>>>   This is the size of the image in pixels.  So you are generating
>>>a 100x100 pixel image with 4 channels of 8 bits (1byte) each:
>>>
>>>	100*100*4*1 = 40,000 bytes uncompressed I could easily
>>>believe 14,000 bytes compressed.  Although 100x100 may not be close
>>>to big enough for your needs.
>>>
>>>
>>>
>>>
>>>>By the way, setting the background Color.white is not seen in the result.
>>>>
>>>>Again, million thanks for your help ! Now it's just the final step left.
>>>
>>>So
>>>
>>>
>>>
>>>>if you could help me with this, I would be REALLY happy :=)
>>>>
>>>>Regards
>>>>/Gergely
>>>>
>>>>-----Original Message-----
>>>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>>>Sent: Thursday, December 04, 2003 3:41 PM
>>>>To: Batik Users
>>>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>>>
>>>>
>>>>Gergely Hajdu wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>You are right, I meant baseclass method. I have removed the
>>>>>batik.jar from FOP, but then I just got some other error.
>>>>>
>>>>>java.lang.NoClassDefFoundError: org/apache/batik/i18n/Localizable
>>>>>	at java.lang.ClassLoader.defineClass0(Native Method)
>>>>
>>>>>[...]
>>>>
>>>>
>>>>>Exception in thread "main"
>>>>>
>>>>>The jar's I've included to the classpath is the follow
>>>>>
>>>>>batik-1.5.zip/batik-1.5/*.jar
>>>>>batik-1.5.zip/batik-1.5/lib/*.jar
>>>>
>>>>
>>>> Are you sure you have all of these (there are a lot of them).
>>>>In particular the above mentioned class is from 'lib/batik-util.jar'
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>batik-1.5.zip/batik-1.5/extensions/*.jar
>>>>>
>>>>>When I removed the batik.jar ( FOP version ) I could find the
>>>>
>>>>"KEY_INDEXED"
>>>>
>>>>
>>>>
>>>>
>>>>>field as well.
>>>>>
>>>>>I really appreciate your help !
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>>
>>>
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
hg



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


RE: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Gergely Hajdu <gh...@abprodata.com>.
Hi Thomas,

I managed to insert the white rectangle. Now some different questions :

1.Why can't the image be seen if a compress it ? My code for doing this
is the following :

TIFFImageEncoder enc = new TIFFImageEncoder(output.getOutputStream(), null);

TIFFEncodeParam tiffParams = new TIFFEncodeParam();
tiffParams.setCompression(TIFFEncodeParam.COMPRESSION_PACKBITS); // Just an
example, I have tried ALL compression groups
tiffParams.setWriteTiled(false); // I have also tried to have
setWriteTiled(true) , but I got the same result

enc.setParam(tiffParams);
enc.encode(rimg);

2.When I want to see the image, the text can't be seen. It's very fuzzy, as
if it was scaled in some way. Any ideas ?

And as usual, big thanks for helping me. If it would be possible, I would
definitely buy you a beer for all the help you have given me :=)

Regards
/Gergely

-----Original Message-----
From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
Sent: Friday, December 05, 2003 6:53 PM
To: Batik Users
Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?


Gergely Hajdu wrote:

> I misunderstood you, thinking #1 was not so easy either. But I'll
> go for that suggestion.I am almost ashamed to ask, but how do you
> that, and when...? Sorry, but I'm really a novice on graphics, and
> all thats concerning with it.

    This is all DOM stuff (more or less of the top of my head
so it may not compile right away).

    String svgns = "http://www.w3.org/2000/svg";
    Element rect = document.createElementNS(svgns, "rect");
    rect.setAttribute("x", "0");
    rect.setAttribute("y", "0");
    rect.setAttribute("width", "100%");
    rect.setAttribute("height", "100%");
    rect.setAttribute("fill", "white");
    Element root = document.getRootElement();
    root.insertBefore(rect, root.getFirstChild());


> I think it will be enough to add the rectangle on the fly, just for
> the transcoding purposes. Where should this code be inserted and how
> does the lines to be inserted look line in TiledImageEncoder ? Or is
> it a big task to creata the rectangle ?

    Add it before calling the baseclass transcode method.

>
> And again, great thanks for helping me.
> /Gergely
>
> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Thursday, December 04, 2003 7:01 PM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>
>
> Gergely Hajdu wrote:
>
>
>>Honestly, my needs are absolutely not so big at all concerning the quality
>>of the TIFF. Actually I just plain text I want to visualise, on
>>white/transparent background with black text. So as long as the text
>>can be seen, I wil be satisfied :=)
>>
>>Huh, isn't there any easier way to achieve this than the two suggestions
>>you are giving :=) ? Otherwise, I am afraid I will mailbomb this/other
>>forum for a while...
>
>
>     I gave three, add a white rectangle to the SVG (perhaps on the fly
> only for transcoding purposes), use software that understands alpha
> channels and write code to flatten (implement the background color
> hint basically).
>
>     I can understand that #2 may be out, #3 may be more work than you
> want to do (although it might open the door for other enhancements
> like going to 1bpp), but what is wrong with #1?
>
>
>
>>As I mentioned, I just need to be able to see the text. In the "worst"
>
> case
>
>>maybe other colors can be used to than black/white if it makes a solution
>>easier.
>>
>>Regards
>>/Gergely
>>
>>-----Original Message-----
>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>Sent: Thursday, December 04, 2003 5:11 PM
>>To: Batik Users
>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>
>>
>>Gergely Hajdu wrote:
>>
>>
>>
>>>Finally Thomas, I've managed to run the program :=)
>>>But there are just a small bit missing....The created
>>>TIFF-image can't be viewed, I just see a black background.
>>
>>
>>   Actually you are seeing opaque black text on a transparent black
>>background :)  You either need to insert an opaque white rectangle
>>into the SVG source (before everything else).  Use software that
>>understands alpha channels, or write code to 'flatten the image'
>>(* this is non-trivial).
>>
>>
>>
>>>tit.addTranscodingHint( ImageTranscoder.KEY_BACKGROUND_COLOR, // ADDED
>>
>>MYSELF
>>
>>
>>>				Color.white );
>>
>>
>>   This would be one of the bells and whistles not supported by the
>>tiled transcoder.
>>
>>
>>
>>>The TIFF is now just 14000 byte ( suspiciously small...). What does the
>>>KEY_WIDTH and KEY_HEIGHT mean ?
>>
>>
>>    This is the size of the image in pixels.  So you are generating
>>a 100x100 pixel image with 4 channels of 8 bits (1byte) each:
>>
>>	100*100*4*1 = 40,000 bytes uncompressed I could easily
>>believe 14,000 bytes compressed.  Although 100x100 may not be close
>>to big enough for your needs.
>>
>>
>>
>>>By the way, setting the background Color.white is not seen in the result.
>>>
>>>Again, million thanks for your help ! Now it's just the final step left.
>>
>>So
>>
>>
>>>if you could help me with this, I would be REALLY happy :=)
>>>
>>>Regards
>>>/Gergely
>>>
>>>-----Original Message-----
>>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>>Sent: Thursday, December 04, 2003 3:41 PM
>>>To: Batik Users
>>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>>
>>>
>>>Gergely Hajdu wrote:
>>>
>>>
>>>
>>>
>>>
>>>>You are right, I meant baseclass method. I have removed the
>>>>batik.jar from FOP, but then I just got some other error.
>>>>
>>>>java.lang.NoClassDefFoundError: org/apache/batik/i18n/Localizable
>>>>	at java.lang.ClassLoader.defineClass0(Native Method)
>>>
>>>>[...]
>>>
>>>
>>>>Exception in thread "main"
>>>>
>>>>The jar's I've included to the classpath is the follow
>>>>
>>>>batik-1.5.zip/batik-1.5/*.jar
>>>>batik-1.5.zip/batik-1.5/lib/*.jar
>>>
>>>
>>>  Are you sure you have all of these (there are a lot of them).
>>>In particular the above mentioned class is from 'lib/batik-util.jar'
>>>
>>>
>>>
>>>
>>>>batik-1.5.zip/batik-1.5/extensions/*.jar
>>>>
>>>>When I removed the batik.jar ( FOP version ) I could find the
>>>
>>>"KEY_INDEXED"
>>>
>>>
>>>
>>>>field as well.
>>>>
>>>>I really appreciate your help !
>>>
>>>
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Gergely Hajdu wrote:

> I misunderstood you, thinking #1 was not so easy either. But I'll
> go for that suggestion.I am almost ashamed to ask, but how do you
> that, and when...? Sorry, but I'm really a novice on graphics, and
> all thats concerning with it.

    This is all DOM stuff (more or less of the top of my head
so it may not compile right away).

    String svgns = "http://www.w3.org/2000/svg";
    Element rect = document.createElementNS(svgns, "rect");
    rect.setAttribute("x", "0");
    rect.setAttribute("y", "0");
    rect.setAttribute("width", "100%");
    rect.setAttribute("height", "100%");
    rect.setAttribute("fill", "white");
    Element root = document.getRootElement();
    root.insertBefore(rect, root.getFirstChild());


> I think it will be enough to add the rectangle on the fly, just for
> the transcoding purposes. Where should this code be inserted and how
> does the lines to be inserted look line in TiledImageEncoder ? Or is
> it a big task to creata the rectangle ?

    Add it before calling the baseclass transcode method.

> 
> And again, great thanks for helping me.
> /Gergely
> 
> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Thursday, December 04, 2003 7:01 PM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
> 
> 
> Gergely Hajdu wrote:
> 
> 
>>Honestly, my needs are absolutely not so big at all concerning the quality
>>of the TIFF. Actually I just plain text I want to visualise, on
>>white/transparent background with black text. So as long as the text
>>can be seen, I wil be satisfied :=)
>>
>>Huh, isn't there any easier way to achieve this than the two suggestions
>>you are giving :=) ? Otherwise, I am afraid I will mailbomb this/other
>>forum for a while...
> 
> 
>     I gave three, add a white rectangle to the SVG (perhaps on the fly
> only for transcoding purposes), use software that understands alpha
> channels and write code to flatten (implement the background color
> hint basically).
> 
>     I can understand that #2 may be out, #3 may be more work than you
> want to do (although it might open the door for other enhancements
> like going to 1bpp), but what is wrong with #1?
> 
> 
> 
>>As I mentioned, I just need to be able to see the text. In the "worst"
> 
> case
> 
>>maybe other colors can be used to than black/white if it makes a solution
>>easier.
>>
>>Regards
>>/Gergely
>>
>>-----Original Message-----
>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>Sent: Thursday, December 04, 2003 5:11 PM
>>To: Batik Users
>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>
>>
>>Gergely Hajdu wrote:
>>
>>
>>
>>>Finally Thomas, I've managed to run the program :=)
>>>But there are just a small bit missing....The created
>>>TIFF-image can't be viewed, I just see a black background.
>>
>>
>>   Actually you are seeing opaque black text on a transparent black
>>background :)  You either need to insert an opaque white rectangle
>>into the SVG source (before everything else).  Use software that
>>understands alpha channels, or write code to 'flatten the image'
>>(* this is non-trivial).
>>
>>
>>
>>>tit.addTranscodingHint( ImageTranscoder.KEY_BACKGROUND_COLOR, // ADDED
>>
>>MYSELF
>>
>>
>>>				Color.white );
>>
>>
>>   This would be one of the bells and whistles not supported by the
>>tiled transcoder.
>>
>>
>>
>>>The TIFF is now just 14000 byte ( suspiciously small...). What does the
>>>KEY_WIDTH and KEY_HEIGHT mean ?
>>
>>
>>    This is the size of the image in pixels.  So you are generating
>>a 100x100 pixel image with 4 channels of 8 bits (1byte) each:
>>
>>	100*100*4*1 = 40,000 bytes uncompressed I could easily
>>believe 14,000 bytes compressed.  Although 100x100 may not be close
>>to big enough for your needs.
>>
>>
>>
>>>By the way, setting the background Color.white is not seen in the result.
>>>
>>>Again, million thanks for your help ! Now it's just the final step left.
>>
>>So
>>
>>
>>>if you could help me with this, I would be REALLY happy :=)
>>>
>>>Regards
>>>/Gergely
>>>
>>>-----Original Message-----
>>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>>Sent: Thursday, December 04, 2003 3:41 PM
>>>To: Batik Users
>>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>>
>>>
>>>Gergely Hajdu wrote:
>>>
>>>
>>>
>>>
>>>
>>>>You are right, I meant baseclass method. I have removed the
>>>>batik.jar from FOP, but then I just got some other error.
>>>>
>>>>java.lang.NoClassDefFoundError: org/apache/batik/i18n/Localizable
>>>>	at java.lang.ClassLoader.defineClass0(Native Method)
>>>
>>>>[...]
>>>
>>>
>>>>Exception in thread "main"
>>>>
>>>>The jar's I've included to the classpath is the follow
>>>>
>>>>batik-1.5.zip/batik-1.5/*.jar
>>>>batik-1.5.zip/batik-1.5/lib/*.jar
>>>
>>>
>>>  Are you sure you have all of these (there are a lot of them).
>>>In particular the above mentioned class is from 'lib/batik-util.jar'
>>>
>>>
>>>
>>>
>>>>batik-1.5.zip/batik-1.5/extensions/*.jar
>>>>
>>>>When I removed the batik.jar ( FOP version ) I could find the
>>>
>>>"KEY_INDEXED"
>>>
>>>
>>>
>>>>field as well.
>>>>
>>>>I really appreciate your help !
>>>
>>>
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


RE: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Gergely Hajdu <gh...@abprodata.com>.
Hi Thomas,

I misunderstood you, thinking #1 was not so easy either. But I'll
go for that suggestion.I am almost ashamed to ask, but how do you
that, and when...? Sorry, but I'm really a novice on graphics, and
all thats concerning with it.

I think it will be enough to add the rectangle on the fly, just for
the transcoding purposes. Where should this code be inserted and how
does the lines to be inserted look line in TiledImageEncoder ? Or is
it a big task to creata the rectangle ?

And again, great thanks for helping me.
/Gergely

-----Original Message-----
From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
Sent: Thursday, December 04, 2003 7:01 PM
To: Batik Users
Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?


Gergely Hajdu wrote:

> Honestly, my needs are absolutely not so big at all concerning the quality
> of the TIFF. Actually I just plain text I want to visualise, on
> white/transparent background with black text. So as long as the text
> can be seen, I wil be satisfied :=)
>
> Huh, isn't there any easier way to achieve this than the two suggestions
> you are giving :=) ? Otherwise, I am afraid I will mailbomb this/other
> forum for a while...

    I gave three, add a white rectangle to the SVG (perhaps on the fly
only for transcoding purposes), use software that understands alpha
channels and write code to flatten (implement the background color
hint basically).

    I can understand that #2 may be out, #3 may be more work than you
want to do (although it might open the door for other enhancements
like going to 1bpp), but what is wrong with #1?


> As I mentioned, I just need to be able to see the text. In the "worst"
case
> maybe other colors can be used to than black/white if it makes a solution
> easier.
>
> Regards
> /Gergely
>
> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Thursday, December 04, 2003 5:11 PM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>
>
> Gergely Hajdu wrote:
>
>
>>Finally Thomas, I've managed to run the program :=)
>>But there are just a small bit missing....The created
>>TIFF-image can't be viewed, I just see a black background.
>
>
>    Actually you are seeing opaque black text on a transparent black
> background :)  You either need to insert an opaque white rectangle
> into the SVG source (before everything else).  Use software that
> understands alpha channels, or write code to 'flatten the image'
> (* this is non-trivial).
>
>
>>tit.addTranscodingHint( ImageTranscoder.KEY_BACKGROUND_COLOR, // ADDED
>
> MYSELF
>
>>				Color.white );
>
>
>    This would be one of the bells and whistles not supported by the
> tiled transcoder.
>
>
>>The TIFF is now just 14000 byte ( suspiciously small...). What does the
>>KEY_WIDTH and KEY_HEIGHT mean ?
>
>
>     This is the size of the image in pixels.  So you are generating
> a 100x100 pixel image with 4 channels of 8 bits (1byte) each:
>
> 	100*100*4*1 = 40,000 bytes uncompressed I could easily
> believe 14,000 bytes compressed.  Although 100x100 may not be close
> to big enough for your needs.
>
>
>>By the way, setting the background Color.white is not seen in the result.
>>
>>Again, million thanks for your help ! Now it's just the final step left.
>
> So
>
>>if you could help me with this, I would be REALLY happy :=)
>>
>>Regards
>>/Gergely
>>
>>-----Original Message-----
>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>Sent: Thursday, December 04, 2003 3:41 PM
>>To: Batik Users
>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>
>>
>>Gergely Hajdu wrote:
>>
>>
>>
>>
>>>You are right, I meant baseclass method. I have removed the
>>>batik.jar from FOP, but then I just got some other error.
>>>
>>>java.lang.NoClassDefFoundError: org/apache/batik/i18n/Localizable
>>>	at java.lang.ClassLoader.defineClass0(Native Method)
>>
>> > [...]
>>
>>
>>>Exception in thread "main"
>>>
>>>The jar's I've included to the classpath is the follow
>>>
>>>batik-1.5.zip/batik-1.5/*.jar
>>>batik-1.5.zip/batik-1.5/lib/*.jar
>>
>>
>>   Are you sure you have all of these (there are a lot of them).
>>In particular the above mentioned class is from 'lib/batik-util.jar'
>>
>>
>>
>>>batik-1.5.zip/batik-1.5/extensions/*.jar
>>>
>>>When I removed the batik.jar ( FOP version ) I could find the
>>
>>"KEY_INDEXED"
>>
>>
>>>field as well.
>>>
>>>I really appreciate your help !
>>
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Gergely Hajdu wrote:

> Honestly, my needs are absolutely not so big at all concerning the quality
> of the TIFF. Actually I just plain text I want to visualise, on
> white/transparent background with black text. So as long as the text
> can be seen, I wil be satisfied :=)
> 
> Huh, isn't there any easier way to achieve this than the two suggestions
> you are giving :=) ? Otherwise, I am afraid I will mailbomb this/other
> forum for a while...

    I gave three, add a white rectangle to the SVG (perhaps on the fly
only for transcoding purposes), use software that understands alpha 
channels and write code to flatten (implement the background color
hint basically).

    I can understand that #2 may be out, #3 may be more work than you
want to do (although it might open the door for other enhancements
like going to 1bpp), but what is wrong with #1?


> As I mentioned, I just need to be able to see the text. In the "worst" case
> maybe other colors can be used to than black/white if it makes a solution
> easier.
> 
> Regards
> /Gergely
> 
> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Thursday, December 04, 2003 5:11 PM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
> 
> 
> Gergely Hajdu wrote:
> 
> 
>>Finally Thomas, I've managed to run the program :=)
>>But there are just a small bit missing....The created
>>TIFF-image can't be viewed, I just see a black background.
> 
> 
>    Actually you are seeing opaque black text on a transparent black
> background :)  You either need to insert an opaque white rectangle
> into the SVG source (before everything else).  Use software that
> understands alpha channels, or write code to 'flatten the image'
> (* this is non-trivial).
> 
> 
>>tit.addTranscodingHint( ImageTranscoder.KEY_BACKGROUND_COLOR, // ADDED
> 
> MYSELF
> 
>>				Color.white );
> 
> 
>    This would be one of the bells and whistles not supported by the
> tiled transcoder.
> 
> 
>>The TIFF is now just 14000 byte ( suspiciously small...). What does the
>>KEY_WIDTH and KEY_HEIGHT mean ?
> 
> 
>     This is the size of the image in pixels.  So you are generating
> a 100x100 pixel image with 4 channels of 8 bits (1byte) each:
> 
> 	100*100*4*1 = 40,000 bytes uncompressed I could easily
> believe 14,000 bytes compressed.  Although 100x100 may not be close
> to big enough for your needs.
> 
> 
>>By the way, setting the background Color.white is not seen in the result.
>>
>>Again, million thanks for your help ! Now it's just the final step left.
> 
> So
> 
>>if you could help me with this, I would be REALLY happy :=)
>>
>>Regards
>>/Gergely
>>
>>-----Original Message-----
>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>Sent: Thursday, December 04, 2003 3:41 PM
>>To: Batik Users
>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>
>>
>>Gergely Hajdu wrote:
>>
>>
>>
>>
>>>You are right, I meant baseclass method. I have removed the
>>>batik.jar from FOP, but then I just got some other error.
>>>
>>>java.lang.NoClassDefFoundError: org/apache/batik/i18n/Localizable
>>>	at java.lang.ClassLoader.defineClass0(Native Method)
>>
>> > [...]
>>
>>
>>>Exception in thread "main"
>>>
>>>The jar's I've included to the classpath is the follow
>>>
>>>batik-1.5.zip/batik-1.5/*.jar
>>>batik-1.5.zip/batik-1.5/lib/*.jar
>>
>>
>>   Are you sure you have all of these (there are a lot of them).
>>In particular the above mentioned class is from 'lib/batik-util.jar'
>>
>>
>>
>>>batik-1.5.zip/batik-1.5/extensions/*.jar
>>>
>>>When I removed the batik.jar ( FOP version ) I could find the
>>
>>"KEY_INDEXED"
>>
>>
>>>field as well.
>>>
>>>I really appreciate your help !
>>
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


RE: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Gergely Hajdu <gh...@abprodata.com>.
Honestly, my needs are absolutely not so big at all concerning the quality
of the TIFF. Actually I just plain text I want to visualise, on
white/transparent background with black text. So as long as the text
can be seen, I wil be satisfied :=)

Huh, isn't there any easier way to achieve this than the two suggestions
you are giving :=) ? Otherwise, I am afraid I will mailbomb this/other
forum for a while...

As I mentioned, I just need to be able to see the text. In the "worst" case
maybe other colors can be used to than black/white if it makes a solution
easier.

Regards
/Gergely

-----Original Message-----
From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
Sent: Thursday, December 04, 2003 5:11 PM
To: Batik Users
Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?


Gergely Hajdu wrote:

> Finally Thomas, I've managed to run the program :=)
> But there are just a small bit missing....The created
> TIFF-image can't be viewed, I just see a black background.

   Actually you are seeing opaque black text on a transparent black
background :)  You either need to insert an opaque white rectangle
into the SVG source (before everything else).  Use software that
understands alpha channels, or write code to 'flatten the image'
(* this is non-trivial).

> tit.addTranscodingHint( ImageTranscoder.KEY_BACKGROUND_COLOR, // ADDED
MYSELF
> 				Color.white );

   This would be one of the bells and whistles not supported by the
tiled transcoder.

> The TIFF is now just 14000 byte ( suspiciously small...). What does the
> KEY_WIDTH and KEY_HEIGHT mean ?

    This is the size of the image in pixels.  So you are generating
a 100x100 pixel image with 4 channels of 8 bits (1byte) each:

	100*100*4*1 = 40,000 bytes uncompressed I could easily
believe 14,000 bytes compressed.  Although 100x100 may not be close
to big enough for your needs.

> By the way, setting the background Color.white is not seen in the result.
>
> Again, million thanks for your help ! Now it's just the final step left.
So
> if you could help me with this, I would be REALLY happy :=)
>
> Regards
> /Gergely
>
> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Thursday, December 04, 2003 3:41 PM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>
>
> Gergely Hajdu wrote:
>
>
>
>>You are right, I meant baseclass method. I have removed the
>>batik.jar from FOP, but then I just got some other error.
>>
>>java.lang.NoClassDefFoundError: org/apache/batik/i18n/Localizable
>>	at java.lang.ClassLoader.defineClass0(Native Method)
>
>  > [...]
>
>>Exception in thread "main"
>>
>>The jar's I've included to the classpath is the follow
>>
>>batik-1.5.zip/batik-1.5/*.jar
>>batik-1.5.zip/batik-1.5/lib/*.jar
>
>
>    Are you sure you have all of these (there are a lot of them).
> In particular the above mentioned class is from 'lib/batik-util.jar'
>
>
>>batik-1.5.zip/batik-1.5/extensions/*.jar
>>
>>When I removed the batik.jar ( FOP version ) I could find the
>
> "KEY_INDEXED"
>
>>field as well.
>>
>>I really appreciate your help !
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Gergely Hajdu wrote:

> Finally Thomas, I've managed to run the program :=)
> But there are just a small bit missing....The created
> TIFF-image can't be viewed, I just see a black background.

   Actually you are seeing opaque black text on a transparent black
background :)  You either need to insert an opaque white rectangle
into the SVG source (before everything else).  Use software that
understands alpha channels, or write code to 'flatten the image'
(* this is non-trivial).

> tit.addTranscodingHint( ImageTranscoder.KEY_BACKGROUND_COLOR, // ADDED MYSELF
> 				Color.white );

   This would be one of the bells and whistles not supported by the
tiled transcoder.

> The TIFF is now just 14000 byte ( suspiciously small...). What does the
> KEY_WIDTH and KEY_HEIGHT mean ? 

    This is the size of the image in pixels.  So you are generating
a 100x100 pixel image with 4 channels of 8 bits (1byte) each:

	100*100*4*1 = 40,000 bytes uncompressed I could easily
believe 14,000 bytes compressed.  Although 100x100 may not be close
to big enough for your needs.

> By the way, setting the background Color.white is not seen in the result.
> 
> Again, million thanks for your help ! Now it's just the final step left. So
> if you could help me with this, I would be REALLY happy :=)
> 
> Regards
> /Gergely
> 
> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Thursday, December 04, 2003 3:41 PM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
> 
> 
> Gergely Hajdu wrote:
> 
> 
> 
>>You are right, I meant baseclass method. I have removed the
>>batik.jar from FOP, but then I just got some other error.
>>
>>java.lang.NoClassDefFoundError: org/apache/batik/i18n/Localizable
>>	at java.lang.ClassLoader.defineClass0(Native Method)
> 
>  > [...]
> 
>>Exception in thread "main"
>>
>>The jar's I've included to the classpath is the follow
>>
>>batik-1.5.zip/batik-1.5/*.jar
>>batik-1.5.zip/batik-1.5/lib/*.jar
> 
> 
>    Are you sure you have all of these (there are a lot of them).
> In particular the above mentioned class is from 'lib/batik-util.jar'
> 
> 
>>batik-1.5.zip/batik-1.5/extensions/*.jar
>>
>>When I removed the batik.jar ( FOP version ) I could find the
> 
> "KEY_INDEXED"
> 
>>field as well.
>>
>>I really appreciate your help !
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


RE: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Gergely Hajdu <gh...@abprodata.com>.
Finally Thomas, I've managed to run the program :=)
But there are just a small bit missing....The created
TIFF-image can't be viewed, I just see a black background.

When I view the TIFF with "Microsoft Photo Editor"
I just got a "can't determine type" error.

When I view it with I.E or "Imaging Preview" I got this
all black picture without any text.

The lines I added to the main method are :

FileOutputStream fos = new FileOutputStream(args[1]);
TiledImageTranscoder tit = new TiledImageTranscoder();
tit.addTranscodingHint(KEY_WIDTH, new Float(100)); // CHANGED VALUE FROM
10240
tit.addTranscodingHint(KEY_HEIGHT, new Float(100)); // ADDED MYSELF
tit.addTranscodingHint( ImageTranscoder.KEY_BACKGROUND_COLOR, // ADDED
MYSELF
				Color.white );
tit.transcode(new TranscoderInput("file:" + args[0]),
				  new TranscoderOutput(fos));

The TIFF is now just 14000 byte ( suspiciously small...). What does the
KEY_WIDTH and KEY_HEIGHT mean ? By the way, setting the background
Color.white
is not seen in the result.

Again, million thanks for your help ! Now it's just the final step left. So
if you could help me with this, I would be REALLY happy :=)

Regards
/Gergely

-----Original Message-----
From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
Sent: Thursday, December 04, 2003 3:41 PM
To: Batik Users
Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?


Gergely Hajdu wrote:


> You are right, I meant baseclass method. I have removed the
> batik.jar from FOP, but then I just got some other error.
>
> java.lang.NoClassDefFoundError: org/apache/batik/i18n/Localizable
> 	at java.lang.ClassLoader.defineClass0(Native Method)
 > [...]
> Exception in thread "main"
>
> The jar's I've included to the classpath is the follow
>
> batik-1.5.zip/batik-1.5/*.jar
> batik-1.5.zip/batik-1.5/lib/*.jar

   Are you sure you have all of these (there are a lot of them).
In particular the above mentioned class is from 'lib/batik-util.jar'

> batik-1.5.zip/batik-1.5/extensions/*.jar
>
> When I removed the batik.jar ( FOP version ) I could find the
"KEY_INDEXED"
> field as well.
>
> I really appreciate your help !





---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Gergely Hajdu wrote:


> You are right, I meant baseclass method. I have removed the
> batik.jar from FOP, but then I just got some other error.
> 
> java.lang.NoClassDefFoundError: org/apache/batik/i18n/Localizable
> 	at java.lang.ClassLoader.defineClass0(Native Method)
 > [...]
> Exception in thread "main"
> 
> The jar's I've included to the classpath is the follow
> 
> batik-1.5.zip/batik-1.5/*.jar
> batik-1.5.zip/batik-1.5/lib/*.jar

   Are you sure you have all of these (there are a lot of them).
In particular the above mentioned class is from 'lib/batik-util.jar'

> batik-1.5.zip/batik-1.5/extensions/*.jar
> 
> When I removed the batik.jar ( FOP version ) I could find the "KEY_INDEXED"
> field as well.
> 
> I really appreciate your help !





---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


RE: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Gergely Hajdu <gh...@abprodata.com>.
Hi Thomas,

You are right, I meant baseclass method. I have removed the
batik.jar from FOP, but then I just got some other error.

java.lang.NoClassDefFoundError: org/apache/batik/i18n/Localizable
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
	at org.apache.batik.transcoder.SVGAbstractTranscoder.<init>(Unknown Source)
	at testing.TiledImageTranscoder.<init>(TiledImageTranscoder.java:23)
	at testing.TiledImageTranscoder.main(TiledImageTranscoder.java:76)
Exception in thread "main"

Line 76 looks like
TiledImageTranscoder tit = new TiledImageTranscoder();

Line 23 looks like
protected TiledImageTranscoder() {}

The jar's I've included to the classpath is the follow

batik-1.5.zip/batik-1.5/*.jar
batik-1.5.zip/batik-1.5/lib/*.jar
batik-1.5.zip/batik-1.5/extensions/*.jar

When I removed the batik.jar ( FOP version ) I could find the "KEY_INDEXED"
field
as well.

I really appreciate your help !
/Gergely

-----Original Message-----
From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
Sent: Thursday, December 04, 2003 3:15 PM
To: Batik Users
Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?


Gergely Hajdu wrote:

> Hi Thomas,
>
> I looked at the documentation for SVGAbstractRenderer-class,
> and there are no constructor that takes these arguments :
>
> super.transcode(document, uri, output);

    This is a call to a baseclass method not a constructor, and
because this method shows up in the stack trace the call succeeds,
the problem is in some method it tries to call internally.

> so therefore I got the NoSuchMethodErrorException. I recently
> downloaded batik-1.5.zip, and thats the version I am running.
>
> Besides that, when I use the PNGTranscoder for setting TranscodingHints,
> I get errors when using "KEY_INDEXED" field, although it's part of the
API.

    You must somehow have gotten mixed jars.  The sample rasterizer
application uses KEY_INDEXED and that works for me from the 1.5 zip.

> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Thursday, December 04, 2003 2:59 PM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>
>
> Gergely Hajdu wrote:
>
>
>>I have downloaded the file and running the static-main method of
>>the TileImageEncoder class. But I got the following error-message :
>>
>>ava.lang.NoSuchMethodError
>>	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown
>>Source)
>
>
>  > Do you have any idea why ?
>
> Hi Gergely,
>
>     Short answer, no.  Longer answer, the problem is not the
> call to super.transcode but something inside of that method.  I would
> suspect some sort of version mismatch.  At this point I would suggest
> getting the CVS source dist and build with debug on (this can be
> done by creating the file xml-batik/build.properties with the one
> line 'debug=on').
>
>     It's possible that the problem will just go away with the
> CVS code, or at least you will be able to point to what method
> doesn't exist.
>
>
>>	at testing.TiledImageTranscoder.transcode(TiledImageTranscoder.java:41)
>>	at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown
>>Source)
>>	at testing.TiledImageTranscoder.main(TiledImageTranscoder.java:80)
>>Exception in thread "main"
>>
>>When I try to run the line that calls the superclass (line 41)
>>SVGAbstractTranscoder.transcode(document, uri, output)
>>
>>protected void transcode(Document document,String uri,TranscoderOutput
>>output)
>>			throws TranscoderException {
>>
>>	// Sets up root, curTxf & curAoi
>>	super.transcode(document, uri, output);
>>
>>Thanks for helping me.
>>/Gergely
>>
>>
>>
>>-----Original Message-----
>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>Sent: Thursday, December 04, 2003 11:57 AM
>>To: Batik Users
>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>
>>
>>Gergely Hajdu wrote:
>>
>>
>>
>>>Sorry, but I can't find the contribution where the
>>>TileImageTranscoder is. The only "contributor" area
>>>I find, is the one with the Batik Committers
>>>(http://xml.apache.org/batik/whoAreWe.html).
>>
>>
>>
>>    Sorry, if you are working with the binary distribution
>>you won't see it, here is a pointer to it from viewcvs:
>>
>>http://cvs.apache.org/viewcvs.cgi/xml-batik/contrib/tiledTranscoder/
>>
>>
>>
>>
>>>-----Original Message-----
>>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>>Sent: Thursday, December 04, 2003 11:31 AM
>>>To: Batik Users
>>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>>
>>>
>>>Gergely Hajdu wrote:
>>>
>>>
>>>
>>>>I am using the org.apache.batik.transcoder and
>>>>org.apache.batik.transcoder.image
>>>>packages to create TIFF-images.I wonder how to
>>>>combine these with org.apache.batik.ext.awt.image.codec.tiff
>>>>packages to compress the TIFF-image I am about
>>>>to create. In this code snippet, "Images/Template.svg" is the
>>>>file that will be created as a TIFF-image.My code, so far :
>>>
>>>
>>>Hi Gergely,
>>>
>>>   As I think I said when you first asked about Compressed
>>>Tiffs you will be better off using the tileImageTranscoder
>>
>>>from the contrib area of Batik.  This directly exposes the
>>
>>>Tiff encoder so you can add the TiffEncodeParam you want.
>>>
>>>   It also directly exposes the width/height of the image.
>>>
>>>   It also rasterizes the image in chunks so you don't
>>>need 2GB of ram to raserize large images.
>>>
>>>   It doesn't have all the funky switches that the
>>>normal transcoders have.
>>>
>>>
>>>
>>>
>>>
>>>>// create a JPEG transcoder
>>>>TIFFTranscoder transcoder = new TIFFTranscoder();
>>>>// create the transcoder input
>>>>String svgURI = new File("Images/Template.svg").toURL().toString();
>>>>TranscoderInput input = new TranscoderInput(svgURI);
>>>>
>>>>// create the transcoder output
>>>>OutputStream ostream = new
>>>
>>>FileOutputStream("Archived_Images/Template.tif");
>>>
>>>
>>>
>>>>TranscoderOutput output = new TranscoderOutput(ostream);
>>>>/* HERE I WOULD LIKE TO INCLUDE CODE FOR DOING COMPRESSION, USING
CLASSES
>>>
>>>>FROM org.apache.batik.ext.awt.image.codec.tiff package. BUT I JUST DON'T
>>>
>>>
>>>>KNOW
>>>>WHAT TO WRITE */
>>>>// save the image
>>>>transcoder.transcode(input, output);
>>>>Thanks in advance
>>>>/Gergely
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>>
>>>
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Gergely Hajdu wrote:

> Hi Thomas,
> 
> I looked at the documentation for SVGAbstractRenderer-class,
> and there are no constructor that takes these arguments :
> 
> super.transcode(document, uri, output);

    This is a call to a baseclass method not a constructor, and
because this method shows up in the stack trace the call succeeds,
the problem is in some method it tries to call internally.

> so therefore I got the NoSuchMethodErrorException. I recently
> downloaded batik-1.5.zip, and thats the version I am running.
> 
> Besides that, when I use the PNGTranscoder for setting TranscodingHints,
> I get errors when using "KEY_INDEXED" field, although it's part of the API.

    You must somehow have gotten mixed jars.  The sample rasterizer
application uses KEY_INDEXED and that works for me from the 1.5 zip.

> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Thursday, December 04, 2003 2:59 PM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
> 
> 
> Gergely Hajdu wrote:
> 
> 
>>I have downloaded the file and running the static-main method of
>>the TileImageEncoder class. But I got the following error-message :
>>
>>ava.lang.NoSuchMethodError
>>	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown
>>Source)
> 
> 
>  > Do you have any idea why ?
> 
> Hi Gergely,
> 
>     Short answer, no.  Longer answer, the problem is not the
> call to super.transcode but something inside of that method.  I would
> suspect some sort of version mismatch.  At this point I would suggest
> getting the CVS source dist and build with debug on (this can be
> done by creating the file xml-batik/build.properties with the one
> line 'debug=on').
> 
>     It's possible that the problem will just go away with the
> CVS code, or at least you will be able to point to what method
> doesn't exist.
> 
> 
>>	at testing.TiledImageTranscoder.transcode(TiledImageTranscoder.java:41)
>>	at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown
>>Source)
>>	at testing.TiledImageTranscoder.main(TiledImageTranscoder.java:80)
>>Exception in thread "main"
>>
>>When I try to run the line that calls the superclass (line 41)
>>SVGAbstractTranscoder.transcode(document, uri, output)
>>
>>protected void transcode(Document document,String uri,TranscoderOutput
>>output)
>>			throws TranscoderException {
>>
>>	// Sets up root, curTxf & curAoi
>>	super.transcode(document, uri, output);
>>
>>Thanks for helping me.
>>/Gergely
>>
>>
>>
>>-----Original Message-----
>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>Sent: Thursday, December 04, 2003 11:57 AM
>>To: Batik Users
>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>
>>
>>Gergely Hajdu wrote:
>>
>>
>>
>>>Sorry, but I can't find the contribution where the
>>>TileImageTranscoder is. The only "contributor" area
>>>I find, is the one with the Batik Committers
>>>(http://xml.apache.org/batik/whoAreWe.html).
>>
>>
>>
>>    Sorry, if you are working with the binary distribution
>>you won't see it, here is a pointer to it from viewcvs:
>>
>>http://cvs.apache.org/viewcvs.cgi/xml-batik/contrib/tiledTranscoder/
>>
>>
>>
>>
>>>-----Original Message-----
>>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>>Sent: Thursday, December 04, 2003 11:31 AM
>>>To: Batik Users
>>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>>
>>>
>>>Gergely Hajdu wrote:
>>>
>>>
>>>
>>>>I am using the org.apache.batik.transcoder and
>>>>org.apache.batik.transcoder.image
>>>>packages to create TIFF-images.I wonder how to
>>>>combine these with org.apache.batik.ext.awt.image.codec.tiff
>>>>packages to compress the TIFF-image I am about
>>>>to create. In this code snippet, "Images/Template.svg" is the
>>>>file that will be created as a TIFF-image.My code, so far :
>>>
>>>
>>>Hi Gergely,
>>>
>>>   As I think I said when you first asked about Compressed
>>>Tiffs you will be better off using the tileImageTranscoder
>>
>>>from the contrib area of Batik.  This directly exposes the
>>
>>>Tiff encoder so you can add the TiffEncodeParam you want.
>>>
>>>   It also directly exposes the width/height of the image.
>>>
>>>   It also rasterizes the image in chunks so you don't
>>>need 2GB of ram to raserize large images.
>>>
>>>   It doesn't have all the funky switches that the
>>>normal transcoders have.
>>>
>>>
>>>
>>>
>>>
>>>>// create a JPEG transcoder
>>>>TIFFTranscoder transcoder = new TIFFTranscoder();
>>>>// create the transcoder input
>>>>String svgURI = new File("Images/Template.svg").toURL().toString();
>>>>TranscoderInput input = new TranscoderInput(svgURI);
>>>>
>>>>// create the transcoder output
>>>>OutputStream ostream = new
>>>
>>>FileOutputStream("Archived_Images/Template.tif");
>>>
>>>
>>>
>>>>TranscoderOutput output = new TranscoderOutput(ostream);
>>>>/* HERE I WOULD LIKE TO INCLUDE CODE FOR DOING COMPRESSION, USING CLASSES
>>>
>>>>FROM org.apache.batik.ext.awt.image.codec.tiff package. BUT I JUST DON'T
>>>
>>>
>>>>KNOW
>>>>WHAT TO WRITE */
>>>>// save the image
>>>>transcoder.transcode(input, output);
>>>>Thanks in advance
>>>>/Gergely
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>>
>>>
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


RE: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Gergely Hajdu <gh...@abprodata.com>.
Hi Thomas,

I looked at the documentation for SVGAbstractRenderer-class,
and there are no constructor that takes these arguments :

super.transcode(document, uri, output);

so therefore I got the NoSuchMethodErrorException. I recently
downloaded batik-1.5.zip, and thats the version I am running.

Besides that, when I use the PNGTranscoder for setting TranscodingHints,
I get errors when using "KEY_INDEXED" field, although it's part of the API.

Regards
/Gergely

-----Original Message-----
From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
Sent: Thursday, December 04, 2003 2:59 PM
To: Batik Users
Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?


Gergely Hajdu wrote:

> I have downloaded the file and running the static-main method of
> the TileImageEncoder class. But I got the following error-message :
>
> ava.lang.NoSuchMethodError
> 	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown
> Source)

 > Do you have any idea why ?

Hi Gergely,

    Short answer, no.  Longer answer, the problem is not the
call to super.transcode but something inside of that method.  I would
suspect some sort of version mismatch.  At this point I would suggest
getting the CVS source dist and build with debug on (this can be
done by creating the file xml-batik/build.properties with the one
line 'debug=on').

    It's possible that the problem will just go away with the
CVS code, or at least you will be able to point to what method
doesn't exist.

> 	at testing.TiledImageTranscoder.transcode(TiledImageTranscoder.java:41)
> 	at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown
> Source)
> 	at testing.TiledImageTranscoder.main(TiledImageTranscoder.java:80)
> Exception in thread "main"
>
> When I try to run the line that calls the superclass (line 41)
> SVGAbstractTranscoder.transcode(document, uri, output)
>
> protected void transcode(Document document,String uri,TranscoderOutput
> output)
> 			throws TranscoderException {
>
> 	// Sets up root, curTxf & curAoi
> 	super.transcode(document, uri, output);
>
> Thanks for helping me.
> /Gergely
>
>
>
> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Thursday, December 04, 2003 11:57 AM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>
>
> Gergely Hajdu wrote:
>
>
>>Sorry, but I can't find the contribution where the
>>TileImageTranscoder is. The only "contributor" area
>>I find, is the one with the Batik Committers
>>(http://xml.apache.org/batik/whoAreWe.html).
>
>
>
>     Sorry, if you are working with the binary distribution
> you won't see it, here is a pointer to it from viewcvs:
>
> http://cvs.apache.org/viewcvs.cgi/xml-batik/contrib/tiledTranscoder/
>
>
>
>>-----Original Message-----
>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>Sent: Thursday, December 04, 2003 11:31 AM
>>To: Batik Users
>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>
>>
>>Gergely Hajdu wrote:
>>
>>
>>>I am using the org.apache.batik.transcoder and
>>>org.apache.batik.transcoder.image
>>>packages to create TIFF-images.I wonder how to
>>>combine these with org.apache.batik.ext.awt.image.codec.tiff
>>>packages to compress the TIFF-image I am about
>>>to create. In this code snippet, "Images/Template.svg" is the
>>>file that will be created as a TIFF-image.My code, so far :
>>
>>
>>Hi Gergely,
>>
>>    As I think I said when you first asked about Compressed
>>Tiffs you will be better off using the tileImageTranscoder
>>from the contrib area of Batik.  This directly exposes the
>>Tiff encoder so you can add the TiffEncodeParam you want.
>>
>>    It also directly exposes the width/height of the image.
>>
>>    It also rasterizes the image in chunks so you don't
>>need 2GB of ram to raserize large images.
>>
>>    It doesn't have all the funky switches that the
>>normal transcoders have.
>>
>>
>>
>>
>>>// create a JPEG transcoder
>>>TIFFTranscoder transcoder = new TIFFTranscoder();
>>>// create the transcoder input
>>>String svgURI = new File("Images/Template.svg").toURL().toString();
>>>TranscoderInput input = new TranscoderInput(svgURI);
>>>
>>>// create the transcoder output
>>>OutputStream ostream = new
>>
>>FileOutputStream("Archived_Images/Template.tif");
>>
>>
>>>TranscoderOutput output = new TranscoderOutput(ostream);
>>>/* HERE I WOULD LIKE TO INCLUDE CODE FOR DOING COMPRESSION, USING CLASSES
>>
>>>FROM org.apache.batik.ext.awt.image.codec.tiff package. BUT I JUST DON'T
>>
>>>KNOW
>>>WHAT TO WRITE */
>>>// save the image
>>>transcoder.transcode(input, output);
>>>Thanks in advance
>>>/Gergely
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Gergely Hajdu wrote:

> I have downloaded the file and running the static-main method of
> the TileImageEncoder class. But I got the following error-message :
> 
> ava.lang.NoSuchMethodError
> 	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown
> Source)

 > Do you have any idea why ?

Hi Gergely,

    Short answer, no.  Longer answer, the problem is not the
call to super.transcode but something inside of that method.  I would
suspect some sort of version mismatch.  At this point I would suggest
getting the CVS source dist and build with debug on (this can be
done by creating the file xml-batik/build.properties with the one
line 'debug=on').

    It's possible that the problem will just go away with the
CVS code, or at least you will be able to point to what method
doesn't exist.

> 	at testing.TiledImageTranscoder.transcode(TiledImageTranscoder.java:41)
> 	at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown
> Source)
> 	at testing.TiledImageTranscoder.main(TiledImageTranscoder.java:80)
> Exception in thread "main"
> 
> When I try to run the line that calls the superclass (line 41)
> SVGAbstractTranscoder.transcode(document, uri, output)
> 
> protected void transcode(Document document,String uri,TranscoderOutput
> output)
> 			throws TranscoderException {
> 
> 	// Sets up root, curTxf & curAoi
> 	super.transcode(document, uri, output);
> 
> Thanks for helping me.
> /Gergely
> 
> 
> 
> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Thursday, December 04, 2003 11:57 AM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
> 
> 
> Gergely Hajdu wrote:
> 
> 
>>Sorry, but I can't find the contribution where the
>>TileImageTranscoder is. The only "contributor" area
>>I find, is the one with the Batik Committers
>>(http://xml.apache.org/batik/whoAreWe.html).
> 
> 
> 
>     Sorry, if you are working with the binary distribution
> you won't see it, here is a pointer to it from viewcvs:
> 
> http://cvs.apache.org/viewcvs.cgi/xml-batik/contrib/tiledTranscoder/
> 
> 
> 
>>-----Original Message-----
>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>Sent: Thursday, December 04, 2003 11:31 AM
>>To: Batik Users
>>Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>>
>>
>>Gergely Hajdu wrote:
>>
>>
>>>I am using the org.apache.batik.transcoder and
>>>org.apache.batik.transcoder.image
>>>packages to create TIFF-images.I wonder how to
>>>combine these with org.apache.batik.ext.awt.image.codec.tiff
>>>packages to compress the TIFF-image I am about
>>>to create. In this code snippet, "Images/Template.svg" is the
>>>file that will be created as a TIFF-image.My code, so far :
>>
>>
>>Hi Gergely,
>>
>>    As I think I said when you first asked about Compressed
>>Tiffs you will be better off using the tileImageTranscoder
>>from the contrib area of Batik.  This directly exposes the
>>Tiff encoder so you can add the TiffEncodeParam you want.
>>
>>    It also directly exposes the width/height of the image.
>>
>>    It also rasterizes the image in chunks so you don't
>>need 2GB of ram to raserize large images.
>>
>>    It doesn't have all the funky switches that the
>>normal transcoders have.
>>
>>
>>
>>
>>>// create a JPEG transcoder
>>>TIFFTranscoder transcoder = new TIFFTranscoder();
>>>// create the transcoder input
>>>String svgURI = new File("Images/Template.svg").toURL().toString();
>>>TranscoderInput input = new TranscoderInput(svgURI);
>>>
>>>// create the transcoder output
>>>OutputStream ostream = new
>>
>>FileOutputStream("Archived_Images/Template.tif");
>>
>>
>>>TranscoderOutput output = new TranscoderOutput(ostream);
>>>/* HERE I WOULD LIKE TO INCLUDE CODE FOR DOING COMPRESSION, USING CLASSES
>>
>>>FROM org.apache.batik.ext.awt.image.codec.tiff package. BUT I JUST DON'T
>>
>>>KNOW
>>>WHAT TO WRITE */
>>>// save the image
>>>transcoder.transcode(input, output);
>>>Thanks in advance
>>>/Gergely
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


RE: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Gergely Hajdu <gh...@abprodata.com>.
Hi Thomas,

I have downloaded the file and running the static-main method of
the TileImageEncoder class. But I got the following error-message :

ava.lang.NoSuchMethodError
	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown
Source)
	at testing.TiledImageTranscoder.transcode(TiledImageTranscoder.java:41)
	at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown
Source)
	at testing.TiledImageTranscoder.main(TiledImageTranscoder.java:80)
Exception in thread "main"

When I try to run the line that calls the superclass (line 41)
SVGAbstractTranscoder.transcode(document, uri, output)

protected void transcode(Document document,String uri,TranscoderOutput
output)
			throws TranscoderException {

	// Sets up root, curTxf & curAoi
	super.transcode(document, uri, output);

Do you have any idea why ?

Thanks for helping me.
/Gergely



-----Original Message-----
From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
Sent: Thursday, December 04, 2003 11:57 AM
To: Batik Users
Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?


Gergely Hajdu wrote:

> Sorry, but I can't find the contribution where the
> TileImageTranscoder is. The only "contributor" area
> I find, is the one with the Batik Committers
> (http://xml.apache.org/batik/whoAreWe.html).


    Sorry, if you are working with the binary distribution
you won't see it, here is a pointer to it from viewcvs:

http://cvs.apache.org/viewcvs.cgi/xml-batik/contrib/tiledTranscoder/


> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Thursday, December 04, 2003 11:31 AM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
>
>
> Gergely Hajdu wrote:
>
>>I am using the org.apache.batik.transcoder and
>>org.apache.batik.transcoder.image
>>packages to create TIFF-images.I wonder how to
>>combine these with org.apache.batik.ext.awt.image.codec.tiff
>>packages to compress the TIFF-image I am about
>>to create. In this code snippet, "Images/Template.svg" is the
>>file that will be created as a TIFF-image.My code, so far :
>
>
> Hi Gergely,
>
>     As I think I said when you first asked about Compressed
> Tiffs you will be better off using the tileImageTranscoder
> from the contrib area of Batik.  This directly exposes the
> Tiff encoder so you can add the TiffEncodeParam you want.
>
>     It also directly exposes the width/height of the image.
>
>     It also rasterizes the image in chunks so you don't
> need 2GB of ram to raserize large images.
>
>     It doesn't have all the funky switches that the
> normal transcoders have.
>
>
>
>>// create a JPEG transcoder
>>TIFFTranscoder transcoder = new TIFFTranscoder();
>>// create the transcoder input
>>String svgURI = new File("Images/Template.svg").toURL().toString();
>>TranscoderInput input = new TranscoderInput(svgURI);
>>
>>// create the transcoder output
>>OutputStream ostream = new
>
> FileOutputStream("Archived_Images/Template.tif");
>
>>TranscoderOutput output = new TranscoderOutput(ostream);
>>/* HERE I WOULD LIKE TO INCLUDE CODE FOR DOING COMPRESSION, USING CLASSES
>>FROM org.apache.batik.ext.awt.image.codec.tiff package. BUT I JUST DON'T
>>KNOW
>>WHAT TO WRITE */
>>// save the image
>>transcoder.transcode(input, output);
>>Thanks in advance
>>/Gergely
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Gergely Hajdu wrote:

> Sorry, but I can't find the contribution where the
> TileImageTranscoder is. The only "contributor" area
> I find, is the one with the Batik Committers
> (http://xml.apache.org/batik/whoAreWe.html).


    Sorry, if you are working with the binary distribution
you won't see it, here is a pointer to it from viewcvs:

http://cvs.apache.org/viewcvs.cgi/xml-batik/contrib/tiledTranscoder/


> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Thursday, December 04, 2003 11:31 AM
> To: Batik Users
> Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?
> 
> 
> Gergely Hajdu wrote:
> 
>>I am using the org.apache.batik.transcoder and
>>org.apache.batik.transcoder.image
>>packages to create TIFF-images.I wonder how to
>>combine these with org.apache.batik.ext.awt.image.codec.tiff
>>packages to compress the TIFF-image I am about
>>to create. In this code snippet, "Images/Template.svg" is the
>>file that will be created as a TIFF-image.My code, so far :
> 
> 
> Hi Gergely,
> 
>     As I think I said when you first asked about Compressed
> Tiffs you will be better off using the tileImageTranscoder
> from the contrib area of Batik.  This directly exposes the
> Tiff encoder so you can add the TiffEncodeParam you want.
> 
>     It also directly exposes the width/height of the image.
> 
>     It also rasterizes the image in chunks so you don't
> need 2GB of ram to raserize large images.
> 
>     It doesn't have all the funky switches that the
> normal transcoders have.
> 
> 
> 
>>// create a JPEG transcoder
>>TIFFTranscoder transcoder = new TIFFTranscoder();
>>// create the transcoder input
>>String svgURI = new File("Images/Template.svg").toURL().toString();
>>TranscoderInput input = new TranscoderInput(svgURI);
>>
>>// create the transcoder output
>>OutputStream ostream = new
> 
> FileOutputStream("Archived_Images/Template.tif");
> 
>>TranscoderOutput output = new TranscoderOutput(ostream);
>>/* HERE I WOULD LIKE TO INCLUDE CODE FOR DOING COMPRESSION, USING CLASSES
>>FROM org.apache.batik.ext.awt.image.codec.tiff package. BUT I JUST DON'T
>>KNOW
>>WHAT TO WRITE */
>>// save the image
>>transcoder.transcode(input, output);
>>Thanks in advance
>>/Gergely
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


RE: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Gergely Hajdu <gh...@abprodata.com>.
Hi Thomas,

Sorry, but I can't find the contribution where the
TileImageTranscoder is. The only "contributor" area
I find, is the one with the Batik Committers
(http://xml.apache.org/batik/whoAreWe.html).

Regards
/Gergely

-----Original Message-----
From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
Sent: Thursday, December 04, 2003 11:31 AM
To: Batik Users
Subject: Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?


Gergely Hajdu wrote:
> I am using the org.apache.batik.transcoder and
> org.apache.batik.transcoder.image
> packages to create TIFF-images.I wonder how to
> combine these with org.apache.batik.ext.awt.image.codec.tiff
> packages to compress the TIFF-image I am about
> to create. In this code snippet, "Images/Template.svg" is the
> file that will be created as a TIFF-image.My code, so far :

Hi Gergely,

    As I think I said when you first asked about Compressed
Tiffs you will be better off using the tileImageTranscoder
from the contrib area of Batik.  This directly exposes the
Tiff encoder so you can add the TiffEncodeParam you want.

    It also directly exposes the width/height of the image.

    It also rasterizes the image in chunks so you don't
need 2GB of ram to raserize large images.

    It doesn't have all the funky switches that the
normal transcoders have.


>
> // create a JPEG transcoder
> TIFFTranscoder transcoder = new TIFFTranscoder();
> // create the transcoder input
> String svgURI = new File("Images/Template.svg").toURL().toString();
> TranscoderInput input = new TranscoderInput(svgURI);
>
> // create the transcoder output
> OutputStream ostream = new
FileOutputStream("Archived_Images/Template.tif");
> TranscoderOutput output = new TranscoderOutput(ostream);
> /* HERE I WOULD LIKE TO INCLUDE CODE FOR DOING COMPRESSION, USING CLASSES
> FROM org.apache.batik.ext.awt.image.codec.tiff package. BUT I JUST DON'T
> KNOW
> WHAT TO WRITE */
> // save the image
> transcoder.transcode(input, output);
> Thanks in advance
> /Gergely
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: How to use "org.apache.batik.ext.awt.image.codec.tiff " ?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Gergely Hajdu wrote:
> I am using the org.apache.batik.transcoder and
> org.apache.batik.transcoder.image
> packages to create TIFF-images.I wonder how to
> combine these with org.apache.batik.ext.awt.image.codec.tiff
> packages to compress the TIFF-image I am about
> to create. In this code snippet, "Images/Template.svg" is the
> file that will be created as a TIFF-image.My code, so far :

Hi Gergely,

    As I think I said when you first asked about Compressed
Tiffs you will be better off using the tileImageTranscoder
from the contrib area of Batik.  This directly exposes the
Tiff encoder so you can add the TiffEncodeParam you want.

    It also directly exposes the width/height of the image.

    It also rasterizes the image in chunks so you don't
need 2GB of ram to raserize large images.

    It doesn't have all the funky switches that the
normal transcoders have.


> 
> // create a JPEG transcoder
> TIFFTranscoder transcoder = new TIFFTranscoder();
> // create the transcoder input
> String svgURI = new File("Images/Template.svg").toURL().toString();
> TranscoderInput input = new TranscoderInput(svgURI);
> 
> // create the transcoder output
> OutputStream ostream = new FileOutputStream("Archived_Images/Template.tif");
> TranscoderOutput output = new TranscoderOutput(ostream);
> /* HERE I WOULD LIKE TO INCLUDE CODE FOR DOING COMPRESSION, USING CLASSES
> FROM org.apache.batik.ext.awt.image.codec.tiff package. BUT I JUST DON'T
> KNOW
> WHAT TO WRITE */
> // save the image
> transcoder.transcode(input, output);
> Thanks in advance
> /Gergely
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org