Error when trying to export empty map as png.

I have created a hex map that has cells 132 wide by 153 high.
Board width is set to 33660 wide by 68085 (255*445 cells)

When trying to export a blank png file with just the hex grid - I get the following error.

How do I get around it? I have just installed the latest Java Run time
Cheers
Loz

Model: none
OS: XP Sp 3
CPU: Intel Core 2 Duo 2.40GHz
Memory: 4GB
Video: GeForce A295Gtx
VASSAL: 3.1.14
Java: 1.6.0_22
Module: New

20 Oct 2010 17:52:28.781 0 – Starting
20 Oct 2010 17:52:28.781 0 – OS Windows XP
20 Oct 2010 17:52:28.781 0 – Java version 1.6.0_22
20 Oct 2010 17:52:28.781 0 – VASSAL version 3.1.14
20 Oct 2010 17:52:28.859 0 – Manager
20 Oct 2010 17:52:37.812 0 – Loading module file E:\Documents and Settings\Loz\War in the Dessert
20 Oct 2010 17:52:37.812 0 – Loading module Test
20 Oct 2010 17:52:38.046 0 E:\Program Files\Java\jre6\bin\java -Xms256M -Xmx1028M -DVASSAL.id=1 -Duser.home=E:\Documents and Settings\Loz -cp lib\Vengine.jar VASSAL.launch.Player
20 Oct 2010 17:52:41.734 1 – Test version 0.0
20 Oct 2010 17:52:41.734 1

20 Oct 2010 17:52:52.218 1 java.util.concurrent.ExecutionException: java.lang.NegativeArraySizeException
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.jdesktop.swingworker.SwingWorker.get(Unknown Source)
at VASSAL.build.module.map.ImageSaver$SnapshotTask.done(ImageSaver.java:413)
at org.jdesktop.swingworker.SwingWorker$5.run(Unknown Source)
at org.jdesktop.swingworker.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
at org.jdesktop.swingworker.AccumulativeRunnable.run(Unknown Source)
at org.jdesktop.swingworker.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at VASSAL.build.module.map.ImageSaver.writeMapAsImage(ImageSaver.java:220)
at VASSAL.build.module.map.ImageSaver$1.actionPerformed(ImageSaver.java:85)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NegativeArraySizeException
at java.awt.image.DataBufferInt.(Unknown Source)
at java.awt.image.Raster.createPackedRaster(Unknown Source)
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
at java.awt.image.BufferedImage.(Unknown Source)
at VASSAL.build.module.map.ImageSaver$SnapshotTask.doInBackground(ImageSaver.java:362)
at VASSAL.build.module.map.ImageSaver$SnapshotTask.doInBackground(ImageSaver.java:260)
at org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.jdesktop.swingworker.SwingWorker.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

On Oct 20, 2010, at 11:09 AM, lozgreen wrote:

I have created a hex map that has cells 132 wide by 153 high.
Board width is set to 33660 wide by 68085 (255*445 cells)

When trying to export a blank png file with just the hex grid - I get
the following error.
How do I get around it? I have just installed the latest Java Run time

Well, the workaround would be to make the image smaller.

It looks like the total image size in hxw pixels has to fit into a 32-
bit integer.
That limits you to 2147483647
What you have is 33660 * 68085 = 2291741100

Try making the cells a bit smaller, say 124x143 instead.

Cheers
Loz

Model: none
OS: XP Sp 3 CPU: Intel Core 2 Duo 2.40GHz Memory: 4GB Video: GeForce
A295Gtx VASSAL: 3.1.14 Java: 1.6.0_22
Module: New

20 Oct 2010 17:52:28.781 0 – Starting
20 Oct 2010 17:52:28.781 0 – OS Windows XP
20 Oct 2010 17:52:28.781 0 – Java version 1.6.0_22
20 Oct 2010 17:52:28.781 0 – VASSAL version 3.1.14
20 Oct 2010 17:52:28.859 0 – Manager
20 Oct 2010 17:52:37.812 0 – Loading module file E:\Documents and
Settings\Loz\War in the Dessert
20 Oct 2010 17:52:37.812 0 – Loading module Test
20 Oct 2010 17:52:38.046 0 E:\Program Files\Java\jre6\bin\java -
Xms256M
-Xmx1028M -DVASSAL.id=1 -Duser.home=E:\Documents and Settings\Loz -cp
lib\Vengine.jar VASSAL.launch.Player
20 Oct 2010 17:52:41.734 1 – Test version 0.0
20 Oct 2010 17:52:41.734 1
20 Oct 2010 17:52:52.218 1 java.util.concurrent.ExecutionException:
java.lang.NegativeArraySizeException
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.jdesktop.swingworker.SwingWorker.get(Unknown Source)
at
VASSAL.build.module.map.ImageSaver$SnapshotTask.done(ImageSaver.java:
413)
at org.jdesktop.swingworker.SwingWorker$5.run(Unknown Source)
at
org.jdesktop.swingworker.SwingWorker
$DoSubmitAccumulativeRunnable.run(Unknown
Source)
at org.jdesktop.swingworker.AccumulativeRunnable.run(Unknown Source)
at
org.jdesktop.swingworker.SwingWorker
$DoSubmitAccumulativeRunnable.actionPerformed(Unknown
Source)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at
VASSAL.build.module.map.ImageSaver.writeMapAsImage(ImageSaver.java:
220)
at
VASSAL.build.module.map.ImageSaver$1.actionPerformed(ImageSaver.java:
85)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NegativeArraySizeException
at java.awt.image.DataBufferInt.(Unknown Source)
at java.awt.image.Raster.createPackedRaster(Unknown Source)
at
java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown
Source)
at java.awt.image.BufferedImage.(Unknown Source)
at
VASSAL.build.module.map.ImageSaver
$SnapshotTask.doInBackground(ImageSaver.java:362)
at
VASSAL.build.module.map.ImageSaver
$SnapshotTask.doInBackground(ImageSaver.java:260)
at org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.jdesktop.swingworker.SwingWorker.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Read this topic online here:
Error when trying to export empty map as png.


messages mailing list
messages@vassalengine.org
vassalengine.org/mailman/listinfo/messages

Thus spake lozgreen:

I have created a hex map that has cells 132 wide by 153 high.
Board width is set to 33660 wide by 68085 (255*445 cells)

I think you might not appreciate how colossally huge the image you’re
trying to save is. A 33660x68085 image contains 8.5GB of pixel data.
You can’t do anything useful with an image that size on a comptuer that
has only 4GB of RAM.

It is a bug that VASSAL lets you try to create an image that size, which
I’ll fix. However, there’s nothing that we (or anybody) can do to make
it possible for that image to fit uncompressed in RAM on your machine.

What will happen after I fix this is that the map image will be sliced
into pieces of a more manageable size. Alternatively, you could make the
size of your cells smaller.


J.

Have made the cells smaller and it worked.

Cheers Guys :slight_smile: