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 "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> on 2006/11/07 17:31:38 UTC

ImageTagRegistry and partial images?

I think this problem is occurring when I flush the ImageTagRegistry in
the middle of a download where an image is being transferred.  It looks
like it breaks on a partial image, but further can't find the "broken
link" image.

 

java.io.EOFException

      at java.io.DataInputStream.readFully(DataInputStream.java:178)

      at java.io.DataInputStream.readFully(DataInputStream.java:152)

      at
org.apache.batik.ext.awt.image.codec.png.PNGRed.readChunk(Unknown
Source)

      at org.apache.batik.ext.awt.image.codec.png.PNGRed.<init>(Unknown
Source)

      at
org.apache.batik.ext.awt.image.codec.png.PNGRegistryEntry$1.run(Unknown
Source)

java.lang.NullPointerException

      at org.apache.batik.ext.awt.image.codec.png.PNGRed.<init>(Unknown
Source)

      at
org.apache.batik.ext.awt.image.codec.png.PNGRegistryEntry$1.run(Unknown
Source)

Exception in thread "Thread-34" java.util.MissingResourceException:
Can't find bundle for base name
org.apache.batik.ext.awt.image.codec.png.resources.Messages, locale
en_US

      at
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.ja
va:836)

      at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805)

      at java.util.ResourceBundle.getBundle(ResourceBundle.java:699)

      at
org.apache.batik.i18n.LocalizableSupport.getResourceBundle(Unknown
Source)

      at org.apache.batik.i18n.LocalizableSupport.formatMessage(Unknown
Source)

      at
org.apache.batik.ext.awt.image.spi.DefaultBrokenLinkProvider.formatMessa
ge(Unknown Source)

      at
org.apache.batik.bridge.SVGBrokenLinkProvider.getBrokenLinkImage(Unknown
Source)

      at
org.apache.batik.ext.awt.image.spi.ImageTagRegistry.getBrokenLinkImage(U
nknown Source)

      at
org.apache.batik.ext.awt.image.codec.png.PNGRegistryEntry$1.run(Unknown
Source)

 

Michael Bishop


RE: ImageTagRegistry and partial images?

Posted by "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil>.
Yes, currently I'm flushing the entire cache to make it easier on the XMPP client that lets me know when the file transfer is complete.  What we did to work around the problem was to download the image to another directory, then rename it properly when the file transfer was complete.
 
I think my test could be modified; you'd have to copy the image elsewhere, then "stream" it via I/O in a separate thread and introduce an artificial delay.  I'll see if I can work something up.  It looks like Batik is trying to read the partial file and hitting an early EOF.  I just figure it'd fail silently and place the broken link image up, but looks like that breaks too.
 
Michael Bishop

________________________________

From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com]
Sent: Wed 11/8/2006 6:37 AM
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: Re: ImageTagRegistry and partial images?



Hi Michael,

"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on
11/07/2006 11:31:38 AM:

> I think this problem is occurring when I flush the ImageTagRegistry in
the
> middle of a download where an image is being transferred.
> It looks like it breaks on a partial image,

   Yes, flushing an image in the middle of a download will cause problems
with
the image being downloaded to fail.  However, I think this will only
happen if
you have multiple references to the same URL.  Are you flushing the entire
cache?

   I'll have to think about this a bit more to figure out the best way to
correct this.  Do you know can I easily modify your previous example to
cause this problem?

>  but further can?t find the ?broken link? image.

   Yes, it looks like it's looking in the wrong place for the localization
file.  It looks like this will actually be a bit icky to fix, but I don't
think this is really a problem.  I believe the real broken image is
provided elsewhere.


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



Re: ImageTagRegistry and partial images?

Posted by th...@kodak.com.
Hi Michael,

"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on 
11/07/2006 11:31:38 AM:

> I think this problem is occurring when I flush the ImageTagRegistry in 
the 
> middle of a download where an image is being transferred.
> It looks like it breaks on a partial image,

   Yes, flushing an image in the middle of a download will cause problems 
with
the image being downloaded to fail.  However, I think this will only 
happen if
you have multiple references to the same URL.  Are you flushing the entire
cache?

   I'll have to think about this a bit more to figure out the best way to
correct this.  Do you know can I easily modify your previous example to 
cause this problem?

>  but further can?t find the ?broken link? image.

   Yes, it looks like it's looking in the wrong place for the localization
file.  It looks like this will actually be a bit icky to fix, but I don't
think this is really a problem.  I believe the real broken image is 
provided elsewhere.


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