Broken image debugging

Broken image message.

I’m updating the Heroes of the Blitzkreig extension for my Lock 'n Load module and I’m getting a “Broken image” error in the chat window for 4 out of 6 of the images. I saw a note in the source about color profiles but all 6 images seem to be identical in those respects. Any tips for what/where I can look to find out what is triggering the problem?

All 6 images are just compressed JPEG images created with Preview in OS X 10.8.4 with roughly 30% image quality.

Thus spake zgrose:

Broken image message.

I’m updating the Heroes of the Blitzkreig extension for my Lock 'n Load
module and I’m getting a “Broken image” error in the chat window for 4
out of 6 of the images. I saw a note in the source about color profiles
but all 6 images seem to be identical in those respects. Any tips for
what/where I can look to find out what is triggering the problem?

All 6 images are just compressed JPEG images created with Preview in OS
X 10.8.4 with roughly 30% image quality.

We can’t help you with this without being able to examine the image files.
Post one of the faulty ones here.


J.

7MB in size

This was one of them having an issue:

dl.dropboxusercontent.com/u/389 … oard25.jpg

Thus spake zgrose:

7MB in size

This was one of them having an issue:

dl.dropboxusercontent.com/u/389 … oard25.jpg

  • Are you certain this was one of the problematic images? I’m able to
    load it into a module without issue using the current dev build,
    3.2.8-svn8785.

  • Which version of VASSAL are you using? (The last time anything changed
    w/r/t “Broken image” messages for JPEGs was in 3.1.18.)

  • Which version of Java are you using?

  • Post the contents of your errorLog here after you’ve triggered the
    problem.


J.

I was in 3.1.20 since I’m mostly a VASL player. Downloaded 3.2.7 and here is what I get. I grabbed a different board just in case as well.

This board: dl.dropboxusercontent.com/u/389 … ssal-3.jpg
Looks like is throwing: Caused by: java.awt.color.CMMException: Invalid image format

2013-07-14 10:18:27,632 [0-main] INFO VASSAL.launch.StartUp - Starting 2013-07-14 10:18:27,638 [0-main] INFO VASSAL.launch.StartUp - OS Mac OS X 10.8.4 2013-07-14 10:18:27,638 [0-main] INFO VASSAL.launch.StartUp - Java version 1.6.0_51 2013-07-14 10:18:27,638 [0-main] INFO VASSAL.launch.StartUp - VASSAL version 3.2.7 2013-07-14 10:18:28,064 [0-AWT-EventQueue-0] INFO VASSAL.launch.ModuleManager - Manager 2013-07-14 10:18:43,520 [0-SwingWorker-pool-1063636667-thread-1] INFO VASSAL.launch.AbstractLaunchAction - Loading module file /Users/zgrose/Dropbox/VASSAL/VLnL/VLnL2/VLnL-Core-2.0.vmod 2013-07-14 10:18:43,667 [0-SwingWorker-pool-1063636667-thread-1] INFO VASSAL.launch.TilingHandler - No images to tile. 2013-07-14 10:18:43,670 [0-SwingWorker-pool-1063636667-thread-1] INFO VASSAL.launch.TilingHandler - No images to tile. 2013-07-14 10:18:44,338 [0-SwingWorker-pool-1063636667-thread-1] INFO VASSAL.tools.io.ProcessLauncher - launching /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -classpath /Applications/VASSAL-3.2.7.app/Contents/Resources/Java/Vengine.jar -Xmx87M -DVASSAL.id=4 -Duser.home=/Users/zgrose -DVASSAL.port=58124 VASSAL.tools.image.tilecache.ZipFileImageTiler /Users/zgrose/Dropbox/VASSAL/VLnL/VLnL2/VLnL-Core-2.0_ext/VLnL-Blitz-1.0.vmod /Users/zgrose/Library/Application Support/VASSAL/tiles/53683b8cbb8e1245a4547f23b920c6c44a8f0f46 256 256 2013-07-14 10:18:45,137 [4-main] INFO VASSAL.tools.image.tilecache.ZipFileImageTiler - Starting 2013-07-14 10:18:45,175 [4-main] INFO VASSAL.tools.image.tilecache.FileArchiveImageTiler - Tiling images/-map25OKvassal-3.jpg 2013-07-14 10:18:45,283 [4-main] ERROR VASSAL.tools.image.tilecache.FileArchiveImageTiler - VASSAL.tools.image.BrokenImageException: images/-map25OKvassal-3.jpg at VASSAL.tools.image.ImageIOImageLoader.wrapImageIO(ImageIOImageLoader.java:371) ~[Vengine.jar:na] at VASSAL.tools.image.ImageIOImageLoader.load(ImageIOImageLoader.java:301) ~[Vengine.jar:na] at VASSAL.tools.image.tilecache.FileArchiveImageTiler.run(FileArchiveImageTiler.java:77) ~[Vengine.jar:na] at VASSAL.tools.image.tilecache.ZipFileImageTiler.main(ZipFileImageTiler.java:167) [Vengine.jar:na] Caused by: java.awt.color.CMMException: Invalid image format at sun.awt.color.CMM.checkStatus(CMM.java:131) ~[na:1.6.0_51] at sun.awt.color.ICC_Transform.<init>(ICC_Transform.java:88) ~[na:1.6.0_51] at java.awt.image.ColorConvertOp.filter(ColorConvertOp.java:516) ~[na:1.6.0_51] at com.sun.imageio.plugins.jpeg.JPEGImageReader.acceptPixels(JPEGImageReader.java:1235) ~[na:1.6.0_51] at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method) ~[na:1.6.0_51] at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1203) ~[na:1.6.0_51] at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:1014) ~[na:1.6.0_51] at javax.imageio.ImageIO.read(ImageIO.java:1422) ~[na:1.6.0_51] at VASSAL.tools.image.ImageIOImageLoader$1.run(ImageIOImageLoader.java:407) ~[Vengine.jar:na] at VASSAL.tools.image.ImageIOImageLoader$1.run(ImageIOImageLoader.java:394) ~[Vengine.jar:na] at VASSAL.tools.image.ImageIOImageLoader.wrapImageIO(ImageIOImageLoader.java:353) ~[Vengine.jar:na] ... 3 common frames omitted 2013-07-14 10:18:45,284 [4-main] INFO VASSAL.tools.image.tilecache.ZipFileImageTiler - Exiting 2013-07-14 10:18:45,636 [0-SwingWorker-pool-1063636667-thread-1] INFO VASSAL.launch.AbstractLaunchAction - Loading module Lock 'n Load 2013-07-14 10:18:45,637 [0-SwingWorker-pool-1063636667-thread-1] INFO VASSAL.tools.io.ProcessLauncher - launching /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Xms256M -Xmx512M -DVASSAL.id=1 -DVASSAL.port=58128 -Duser.home=/Users/zgrose -cp /Applications/VASSAL-3.2.7.app/Contents/Resources/Java/Vengine.jar -Xdock:name=Lock 'n Load -Xdock:icon=/Applications/VASSAL-3.2.7.app/Contents/Resources/VASSAL.icns -Dapple.awt.graphics.UseQuartz=false VASSAL.launch.Player --load -- /Users/zgrose/Dropbox/VASSAL/VLnL/VLnL2/VLnL-Core-2.0.vmod 2013-07-14 10:18:46,499 [1-main] INFO VASSAL.launch.StartUp - Starting 2013-07-14 10:18:46,512 [1-main] INFO VASSAL.launch.StartUp - OS Mac OS X 10.8.4 2013-07-14 10:18:46,512 [1-main] INFO VASSAL.launch.StartUp - Java version 1.6.0_51 2013-07-14 10:18:46,512 [1-main] INFO VASSAL.launch.StartUp - VASSAL version 3.2.7 2013-07-14 10:18:46,512 [1-main] INFO VASSAL.launch.Launcher - Player 2013-07-14 10:18:47,899 [1-IconFactory-preload] INFO VASSAL.tools.icon.IconFactory - VASSAL images folder found at jar:file:/Applications/VASSAL-3.2.7.app/Contents/Resources/Java/Vengine.jar!/images/ 2013-07-14 10:18:47,905 [1-IconFactory-preload] INFO VASSAL.tools.icon.IconFactory - Icon family go-up created for go-up.png 2013-07-14 10:18:47,905 [1-IconFactory-preload] INFO VASSAL.tools.icon.IconFactory - Icon family go-down created for go-down.png 2013-07-14 10:18:47,906 [1-IconFactory-preload] INFO VASSAL.tools.icon.IconFactory - Icon family calculator created for calculator.png 2013-07-14 10:18:47,906 [1-IconFactory-preload] INFO VASSAL.tools.icon.IconFactory - Icon family network-server created for network-server.png 2013-07-14 10:18:47,906 [1-IconFactory-preload] INFO VASSAL.tools.icon.IconFactory - Icon family yes created for yes.png 2013-07-14 10:18:47,906 [1-IconFactory-preload] INFO VASSAL.tools.icon.IconFactory - Icon family no created for no.png 2013-07-14 10:18:47,906 [1-IconFactory-preload] INFO VASSAL.tools.icon.IconFactory - Icon family VASSAL-jabber created for VASSAL-jabber.png 2013-07-14 10:18:47,906 [1-IconFactory-preload] INFO VASSAL.tools.icon.IconFactory - Icon family VASSAL created for VASSAL.png 2013-07-14 10:18:47,906 [1-IconFactory-preload] INFO VASSAL.tools.icon.IconFactory - Icon family network-idle created for network-idle.png 2013-07-14 10:18:47,907 [1-IconFactory-preload] INFO VASSAL.tools.icon.IconFactory - Icon family jabber created for jabber.png 2013-07-14 10:18:47,907 [1-IconFactory-preload] INFO VASSAL.tools.icon.IconFactory - Icon family bug created for bug.svg 2013-07-14 10:18:48,668 [1-AWT-EventQueue-0] WARN VASSAL.launch.BasicModule - Lock 'n Load version 2.0.6 2013-07-14 10:18:48,680 [1-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension /Users/zgrose/Dropbox/VASSAL/VLnL/VLnL2/VLnL-Core-2.0_ext/VLnL-Battles-1.0.vmod 2013-07-14 10:18:48,696 [1-AWT-EventQueue-0] WARN VASSAL.tools.logging.LoggedOutputStream - -- Extension VLnL-Battles-1.0 v1.0.2 loaded 2013-07-14 10:18:48,697 [1-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension /Users/zgrose/Dropbox/VASSAL/VLnL/VLnL2/VLnL-Core-2.0_ext/VLnL-Blitz-1.0.vmod 2013-07-14 10:18:48,845 [1-AWT-EventQueue-0] WARN VASSAL.tools.logging.LoggedOutputStream - -- Extension VLnL-Blitz-1.0 v1.0.6 loaded

Thus spake zgrose:

I was in 3.1.20 since I’m mostly a VASL player. Downloaded 3.2.7 and
here is what I get. I grabbed a different board just in case as well.

This board: dl.dropboxusercontent.com/u/389 … ssal-3.jpg[1]

I downloaded this image and put it into a test module using
3.2.8-svn8785 and Java 1.7.0_25 on Linux, but can’t reproduce the
problem.

2013-07-14 10:18:27,638 [0-main] INFO VASSAL.launch.StartUp - OS Mac OS
X 10.8.4
2013-07-14 10:18:27,638 [0-main] INFO VASSAL.launch.StartUp - Java
version 1.6.0_51

The Java bug you’re hitting is this one:

bugs.sun.com/view_bug.do?bug_id=6444360

Oracle’s tracker lists it as not fixed, but I suspect that it actually
is fixed in Java 7, or possibly in the OpenJDK JVM which I’m using—
otherwise, I would not be able to load the image successfully myself.
Some other JPEG loading bugs in Java we’re able to work around (because
they give us image data which is incorrect, but in a known way, so we
can correct it ourselves), but because this bug happens in the middle of
decoding of the JPEG, we don’t get back any image data at all…

It would be interesting to know if you still have this problem with
Java 7 on your Mac, but you might find getting Java 7 working with
VASSAL on a Mac to be a bit challenging due to Oracle’s Java 7 for Macs
violating many of the assumptions which held for Apple’s Java 6.

After poking around a bit, I found a mention that pre-Java 7 can’t
handle JPEGs with color profiles where the rendering intent is “Media
Relative Colormetric” instead of “Perceptual”. In order to detect
whether this is the problem you’re facing, I’ll need to have a look
at your image with a hex editor.


J.

Thus spake Joel Uckelman:

After poking around a bit, I found a mention that pre-Java 7 can’t
handle JPEGs with color profiles where the rendering intent is “Media
Relative Colormetric” instead of “Perceptual”. In order to detect
whether this is the problem you’re facing, I’ll need to have a look
at your image with a hex editor.

…and it turns out that this is your problem. The ICC_PROFILE in the
APP2 chunk of your JPEG has a 1 instead of a 0 at the its offset 64,
which is the RenderingIntent tag.

Since we’re already partialy decoding JPEGs to work around an unrelated
color space problem and I now know exactly where to look to detect this,
I can adjust the byte stream to change this byte from 1 to 0 before
Java’s ImageIO tries to decode the image. I’m going to work on this now,
so might be back with a fix for you to try later this evening.

Java’s ImageIO is a such a deplorable cock-up. This is the second
ImageIO problem I’ve had to deal with this weekend.


J.

OK. Looks like my wife’s Photoshop can save as different intents, I’ll see if I can workaround that way as well.

Now I’m cooking with gas. The option in Photoshop CS6 is at

Edit menu → Color Settings item → More Options button → Conversion Options frame → Intent drop-down

Thus spake zgrose:

Now I’m cooking with gas. The option in Photoshop CS6 is at

Edit menu → Color Settings item → More Options button → Conversion
Options frame → Intent drop-down

I’ve added this problem to our bug tracker as Bug 10322:

vassalengine.org/tracker/sho … i?id=10322

Since you have an easy workaround, this problem doesn’t affect many
people, and it’s going to be a fair bit of work to fix, I probably won’t
code the workaround I described.


J.