You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Tavmjong Bah <ta...@free.fr> on 2008/05/18 12:54:41 UTC

Fedora 9: SVG graphic with PNG

Hi again,

	Fop (0.95beta) is included in Fedora 9. I am having trouble with
including an SVG graphic that in turn includes a PNG (SVG graphics
without including a PNG work fine).

SEVERE: svg graphic could not be rendered: Unsupported DataBuffer type: java.awt.image.DataBufferUShort
java.lang.UnsupportedOperationException: Unsupported DataBuffer type: java.awt.image.DataBufferUShort
        at org.apache.fop.pdf.AlphaRasterImage.outputContents(AlphaRasterImage.java:169)

	I am also getting some weirdness where a few PNG files end up with the
wrong colors. I didn't have these troubles with a fop svn version from
last year with Fedora 6.

java -version reports:

java version "1.6.0"
OpenJDK  Runtime Environment (build 1.6.0-b09)
OpenJDK Client VM (build 1.6.0-b09, mixed mode)

					Thanks

					Tav




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


Re: Fedora 9: SVG graphic with PNG

Posted by thtesche <fo...@thtesche.com>.
HI,

thanks a lot. It works like a charm.

Only for the next record

Jeremias Maerki-2 wrote:
> 
> Actually, this has already been fixed but you'll have to use FOP Trunk 
> (from the Subversion repository).
> checkout with: svn co
> http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk
> 
> http://svn.apache.org/viewvc?rev=696365&view=rev
> 
> So please ignore my earlier comment.
> 
> Regards
> 
> Tom
> 
> On 02.02.2009 11:43:55 Jeremias Maerki wrote:
>> Tom, would you mind attaching this patch as a unified diff to a new
>> Bugzilla issue?
>> 
>> http://xmlgraphics.apache.org/fop/dev/index.html#patches
>> 
>> Thanks.
>> 
>> On 02.02.2009 11:31:41 thtesche wrote:
>> > 
>> > HI Vincent,
>> > 
>> > I run into the same exception but the reason was not your earlier
>> mentioned
>> > bugfix. The method doesn't support the DataBuffer.TYPE_USHORT. Our png
>> comes
>> > with this data type so I tried to fix the implementation with:
>> > 
>> >    } else if (dataType == DataBuffer.TYPE_USHORT) {
>> >             byte[] line = new byte[nbands * w];
>> >             short[] shline =new short[nbands*w];
>> > 	    for (int y = 0; y < h; y++) {
>> >                 alpha.getDataElements(0, y, w, 1, shline);
>> >                 for (int i = 0; i < w; i++) {
>> >                     line[i] = (byte)(shline[i] );
>> >                 }
>> >                 out.write(line);
>> >             }
>> > 
>> > The code worked but I'm not sure whether it's correct. Please have a
>> look at
>> > it and if possible add this handling for ushort to fop.
>> > 
>> > Regards 
>> > 
>> > Tom
>> > 
>> > 
>> > Vincent Hennebert-3 wrote:
>> > > 
>> > > Hi,
>> > > 
>> > > Tavmjong Bah wrote:
>> > >> Hi again,
>> > >>
>> > >> 	Fop (0.95beta) is included in Fedora 9. I am having trouble with
>> > >> including an SVG graphic that in turn includes a PNG (SVG graphics
>> > >> without including a PNG work fine).
>> > >>
>> > >> SEVERE: svg graphic could not be rendered: Unsupported DataBuffer
>> type:
>> > >> java.awt.image.DataBufferUShort
>> > >> java.lang.UnsupportedOperationException: Unsupported DataBuffer
>> type:
>> > >> java.awt.image.DataBufferUShort
>> > >>         at
>> > >>
>> org.apache.fop.pdf.AlphaRasterImage.outputContents(AlphaRasterImage.java:169)
>> > > 
>> > > Weird. Sounds crazy, but are you sure OpenJDK provides an
>> implemenation
>> > > for this class? Can you reproduce the problem with a Sun jvm?
>> > > 
>> > > 
>> > >> 	I am also getting some weirdness where a few PNG files end up with
>> the
>> > >> wrong colors. I didn't have these troubles with a fop svn version
>> from
>> > >> last year with Fedora 6.
>> > > 
>> > > The image package has been largely rewritten in the 0.95beta version,
>> > > and a bug has recently been fixed regarding PNG images drifting to
>> > > yellow. You’re very probably hitting this bug. Can you try
>> downloading
>> > > and building the head version of the 0.95 branch?
>> > >     svn co
>> > > http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95
>> > > then run
>> > >     ant package
>> > > 
>> > > If there’s no rush you might want to wait a couple of weeks that the
>> > > final 0.95 version is released.
>> > > 
>> > > HTH,
>> > > Vincent
>> > > 
>> > > 
>> > > -- 
>> > > Vincent Hennebert                            Anyware Technologies
>> > > http://people.apache.org/~vhennebert        
>> http://www.anyware-tech.com
>> > > Apache FOP Committer                         FOP
>> Development/Consulting
>> > > 
>> > > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> > > For additional commands, e-mail:
>> fop-users-help@xmlgraphics.apache.org
>> > > 
>> > > 
>> > > 
>> > 
>> > -- 
>> > View this message in context:
>> http://www.nabble.com/Fedora-9%3A-SVG-graphic-with-PNG-tp17301525p21787367.html
>> > Sent from the FOP - Users mailing list archive at Nabble.com.
>> > 
>> > 
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>> > 
>> 
>> 
>> 
>> 
>> Jeremias Maerki
>> 
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Fedora-9%3A-SVG-graphic-with-PNG-tp17301525p21789293.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Fedora 9: SVG graphic with PNG

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Actually, this has already been fixed but you'll have to use FOP Trunk 
(from the Subversion repository).

http://svn.apache.org/viewvc?rev=696365&view=rev

So please ignore my earlier comment.

On 02.02.2009 11:43:55 Jeremias Maerki wrote:
> Tom, would you mind attaching this patch as a unified diff to a new
> Bugzilla issue?
> 
> http://xmlgraphics.apache.org/fop/dev/index.html#patches
> 
> Thanks.
> 
> On 02.02.2009 11:31:41 thtesche wrote:
> > 
> > HI Vincent,
> > 
> > I run into the same exception but the reason was not your earlier mentioned
> > bugfix. The method doesn't support the DataBuffer.TYPE_USHORT. Our png comes
> > with this data type so I tried to fix the implementation with:
> > 
> >    } else if (dataType == DataBuffer.TYPE_USHORT) {
> >             byte[] line = new byte[nbands * w];
> >             short[] shline =new short[nbands*w];
> > 	    for (int y = 0; y < h; y++) {
> >                 alpha.getDataElements(0, y, w, 1, shline);
> >                 for (int i = 0; i < w; i++) {
> >                     line[i] = (byte)(shline[i] );
> >                 }
> >                 out.write(line);
> >             }
> > 
> > The code worked but I'm not sure whether it's correct. Please have a look at
> > it and if possible add this handling for ushort to fop.
> > 
> > Regards 
> > 
> > Tom
> > 
> > 
> > Vincent Hennebert-3 wrote:
> > > 
> > > Hi,
> > > 
> > > Tavmjong Bah wrote:
> > >> Hi again,
> > >>
> > >> 	Fop (0.95beta) is included in Fedora 9. I am having trouble with
> > >> including an SVG graphic that in turn includes a PNG (SVG graphics
> > >> without including a PNG work fine).
> > >>
> > >> SEVERE: svg graphic could not be rendered: Unsupported DataBuffer type:
> > >> java.awt.image.DataBufferUShort
> > >> java.lang.UnsupportedOperationException: Unsupported DataBuffer type:
> > >> java.awt.image.DataBufferUShort
> > >>         at
> > >> org.apache.fop.pdf.AlphaRasterImage.outputContents(AlphaRasterImage.java:169)
> > > 
> > > Weird. Sounds crazy, but are you sure OpenJDK provides an implemenation
> > > for this class? Can you reproduce the problem with a Sun jvm?
> > > 
> > > 
> > >> 	I am also getting some weirdness where a few PNG files end up with the
> > >> wrong colors. I didn't have these troubles with a fop svn version from
> > >> last year with Fedora 6.
> > > 
> > > The image package has been largely rewritten in the 0.95beta version,
> > > and a bug has recently been fixed regarding PNG images drifting to
> > > yellow. You’re very probably hitting this bug. Can you try downloading
> > > and building the head version of the 0.95 branch?
> > >     svn co
> > > http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95
> > > then run
> > >     ant package
> > > 
> > > If there’s no rush you might want to wait a couple of weeks that the
> > > final 0.95 version is released.
> > > 
> > > HTH,
> > > Vincent
> > > 
> > > 
> > > -- 
> > > Vincent Hennebert                            Anyware Technologies
> > > http://people.apache.org/~vhennebert         http://www.anyware-tech.com
> > > Apache FOP Committer                         FOP Development/Consulting
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> > > 
> > > 
> > > 
> > 
> > -- 
> > View this message in context: http://www.nabble.com/Fedora-9%3A-SVG-graphic-with-PNG-tp17301525p21787367.html
> > Sent from the FOP - Users mailing list archive at Nabble.com.
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> > 
> 
> 
> 
> 
> Jeremias Maerki
> 



Jeremias Maerki


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


Re: Fedora 9: SVG graphic with PNG

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Tom, would you mind attaching this patch as a unified diff to a new
Bugzilla issue?

http://xmlgraphics.apache.org/fop/dev/index.html#patches

Thanks.

On 02.02.2009 11:31:41 thtesche wrote:
> 
> HI Vincent,
> 
> I run into the same exception but the reason was not your earlier mentioned
> bugfix. The method doesn't support the DataBuffer.TYPE_USHORT. Our png comes
> with this data type so I tried to fix the implementation with:
> 
>    } else if (dataType == DataBuffer.TYPE_USHORT) {
>             byte[] line = new byte[nbands * w];
>             short[] shline =new short[nbands*w];
> 	    for (int y = 0; y < h; y++) {
>                 alpha.getDataElements(0, y, w, 1, shline);
>                 for (int i = 0; i < w; i++) {
>                     line[i] = (byte)(shline[i] );
>                 }
>                 out.write(line);
>             }
> 
> The code worked but I'm not sure whether it's correct. Please have a look at
> it and if possible add this handling for ushort to fop.
> 
> Regards 
> 
> Tom
> 
> 
> Vincent Hennebert-3 wrote:
> > 
> > Hi,
> > 
> > Tavmjong Bah wrote:
> >> Hi again,
> >>
> >> 	Fop (0.95beta) is included in Fedora 9. I am having trouble with
> >> including an SVG graphic that in turn includes a PNG (SVG graphics
> >> without including a PNG work fine).
> >>
> >> SEVERE: svg graphic could not be rendered: Unsupported DataBuffer type:
> >> java.awt.image.DataBufferUShort
> >> java.lang.UnsupportedOperationException: Unsupported DataBuffer type:
> >> java.awt.image.DataBufferUShort
> >>         at
> >> org.apache.fop.pdf.AlphaRasterImage.outputContents(AlphaRasterImage.java:169)
> > 
> > Weird. Sounds crazy, but are you sure OpenJDK provides an implemenation
> > for this class? Can you reproduce the problem with a Sun jvm?
> > 
> > 
> >> 	I am also getting some weirdness where a few PNG files end up with the
> >> wrong colors. I didn't have these troubles with a fop svn version from
> >> last year with Fedora 6.
> > 
> > The image package has been largely rewritten in the 0.95beta version,
> > and a bug has recently been fixed regarding PNG images drifting to
> > yellow. You’re very probably hitting this bug. Can you try downloading
> > and building the head version of the 0.95 branch?
> >     svn co
> > http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95
> > then run
> >     ant package
> > 
> > If there’s no rush you might want to wait a couple of weeks that the
> > final 0.95 version is released.
> > 
> > HTH,
> > Vincent
> > 
> > 
> > -- 
> > Vincent Hennebert                            Anyware Technologies
> > http://people.apache.org/~vhennebert         http://www.anyware-tech.com
> > Apache FOP Committer                         FOP Development/Consulting
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Fedora-9%3A-SVG-graphic-with-PNG-tp17301525p21787367.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 




Jeremias Maerki


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


Re: Fedora 9: SVG graphic with PNG

Posted by thtesche <fo...@thtesche.com>.
HI Vincent,

I run into the same exception but the reason was not your earlier mentioned
bugfix. The method doesn't support the DataBuffer.TYPE_USHORT. Our png comes
with this data type so I tried to fix the implementation with:

   } else if (dataType == DataBuffer.TYPE_USHORT) {
            byte[] line = new byte[nbands * w];
            short[] shline =new short[nbands*w];
	    for (int y = 0; y < h; y++) {
                alpha.getDataElements(0, y, w, 1, shline);
                for (int i = 0; i < w; i++) {
                    line[i] = (byte)(shline[i] );
                }
                out.write(line);
            }

The code worked but I'm not sure whether it's correct. Please have a look at
it and if possible add this handling for ushort to fop.

Regards 

Tom


Vincent Hennebert-3 wrote:
> 
> Hi,
> 
> Tavmjong Bah wrote:
>> Hi again,
>>
>> 	Fop (0.95beta) is included in Fedora 9. I am having trouble with
>> including an SVG graphic that in turn includes a PNG (SVG graphics
>> without including a PNG work fine).
>>
>> SEVERE: svg graphic could not be rendered: Unsupported DataBuffer type:
>> java.awt.image.DataBufferUShort
>> java.lang.UnsupportedOperationException: Unsupported DataBuffer type:
>> java.awt.image.DataBufferUShort
>>         at
>> org.apache.fop.pdf.AlphaRasterImage.outputContents(AlphaRasterImage.java:169)
> 
> Weird. Sounds crazy, but are you sure OpenJDK provides an implemenation
> for this class? Can you reproduce the problem with a Sun jvm?
> 
> 
>> 	I am also getting some weirdness where a few PNG files end up with the
>> wrong colors. I didn't have these troubles with a fop svn version from
>> last year with Fedora 6.
> 
> The image package has been largely rewritten in the 0.95beta version,
> and a bug has recently been fixed regarding PNG images drifting to
> yellow. You’re very probably hitting this bug. Can you try downloading
> and building the head version of the 0.95 branch?
>     svn co
> http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95
> then run
>     ant package
> 
> If there’s no rush you might want to wait a couple of weeks that the
> final 0.95 version is released.
> 
> HTH,
> Vincent
> 
> 
> -- 
> Vincent Hennebert                            Anyware Technologies
> http://people.apache.org/~vhennebert         http://www.anyware-tech.com
> Apache FOP Committer                         FOP Development/Consulting
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Fedora-9%3A-SVG-graphic-with-PNG-tp17301525p21787367.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Fedora 9: SVG graphic with PNG

Posted by Tavmjong Bah <ta...@free.fr>.
Vincent,

	Thanks again for the responses...

> > 	Fop (0.95beta) is included in Fedora 9. I am having trouble with
> > including an SVG graphic that in turn includes a PNG (SVG graphics
> > without including a PNG work fine).
> >
> > SEVERE: svg graphic could not be rendered: Unsupported DataBuffer type: java.awt.image.DataBufferUShort
> > java.lang.UnsupportedOperationException: Unsupported DataBuffer type: java.awt.image.DataBufferUShort
> >         at org.apache.fop.pdf.AlphaRasterImage.outputContents(AlphaRasterImage.java:169)
> 
> Weird. Sounds crazy, but are you sure OpenJDK provides an implemenation
> for this class? Can you reproduce the problem with a Sun jvm?

I was hoping not to have to install jvm and build fop myself... looks
like I might have to.

OK, I think I have installed Sun java. I am not a java expert... this is
what I get when I type java -version:

java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)

and javac -version:

javac 1.6.0_06

And I get the same error. Drats!

> > 	I am also getting some weirdness where a few PNG files end up with the
> > wrong colors. I didn't have these troubles with a fop svn version from
> > last year with Fedora 6.
> 
> The image package has been largely rewritten in the 0.95beta version,
> and a bug has recently been fixed regarding PNG images drifting to
> yellow. You’re very probably hitting this bug. Can you try downloading
> and building the head version of the 0.95 branch?
>     svn co http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95
> then run
>     ant package

That fixed the PNG problem.

					Thanks for your help,

					Tav




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


Re: Fedora 9: SVG graphic with PNG

Posted by Vincent Hennebert <vi...@anyware-tech.com>.
Hi,

Tavmjong Bah wrote:
> Hi again,
>
> 	Fop (0.95beta) is included in Fedora 9. I am having trouble with
> including an SVG graphic that in turn includes a PNG (SVG graphics
> without including a PNG work fine).
>
> SEVERE: svg graphic could not be rendered: Unsupported DataBuffer type: java.awt.image.DataBufferUShort
> java.lang.UnsupportedOperationException: Unsupported DataBuffer type: java.awt.image.DataBufferUShort
>         at org.apache.fop.pdf.AlphaRasterImage.outputContents(AlphaRasterImage.java:169)

Weird. Sounds crazy, but are you sure OpenJDK provides an implemenation
for this class? Can you reproduce the problem with a Sun jvm?


> 	I am also getting some weirdness where a few PNG files end up with the
> wrong colors. I didn't have these troubles with a fop svn version from
> last year with Fedora 6.

The image package has been largely rewritten in the 0.95beta version,
and a bug has recently been fixed regarding PNG images drifting to
yellow. You’re very probably hitting this bug. Can you try downloading
and building the head version of the 0.95 branch?
    svn co http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95
then run
    ant package

If there’s no rush you might want to wait a couple of weeks that the
final 0.95 version is released.

HTH,
Vincent


-- 
Vincent Hennebert                            Anyware Technologies
http://people.apache.org/~vhennebert         http://www.anyware-tech.com
Apache FOP Committer                         FOP Development/Consulting

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