issue 1
(ArrayOutOfBoundsExcption for some images) commented on by rantav
- I found a workaround for this bug.
I found out that if I use a BufferedImage of type RGB (BufferedImage.TYPE_INT_RGB) then the number of bands is
one and the program runs correctly.
In my case that's sort of OK since I don't care too much about transparency or other features.
I found a workaround for this bug.
I found out that if I use a BufferedImage of type RGB (BufferedImage.TYPE_INT_RGB) then the number of bands is
one and the program runs correctly.
In my case that's sort of OK since I don't care too much about transparency or other features.
Aug 27, 2009
issue 1
(ArrayOutOfBoundsExcption for some images) commented on by rantav
- From little debugging I did, without actually knowing what BufferedImage is or what Raster is, what I think is
happening is that for some images the Raster.getNumBands() returns 2 and not 1 so the preallocated array col01
in the call to getPixels is not large enough.
Does this make sense?
From little debugging I did, without actually knowing what BufferedImage is or what Raster is, what I think is
happening is that for some images the Raster.getNumBands() returns 2 and not 1 so the preallocated array col01
in the call to getPixels is not large enough.
Does this make sense?
Aug 27, 2009
issue 1
(ArrayOutOfBoundsExcption for some images) reported by rantav
- What steps will reproduce the problem?
1. I run the application from the command line, using, for example -i /tmp/100x100.png -nh 50 -nw 50
2. For some images, not all, but some I get an ArrayOutOfBoundsException
Exception in thread "Thread-0" java.lang.ArrayIndexOutOfBoundsException: 200
at sun.awt.image.ByteInterleavedRaster.getPixels(ByteInterleavedRaster.java:1024)
at net.semanticmetadata.seams.ImageSeamOperations.getGradientImage(ImageSeamOperations.java:481)
at net.semanticmetadata.seams.ImageSeamOperations.generateEnergyImage(ImageSeamOperations.java:461)
at net.semanticmetadata.seams.ImageSeamOperations.findOptimalHorizontalSeam(ImageSeamOperations.java:58)
at net.semanticmetadata.seams.ImageSeamOperations.carveHorizontalSeam(ImageSeamOperations.java:314)
at net.semanticmetadata.seams.SeamCarving.main(SeamCarving.java:118)
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Using v4. On OS X
$ java -version
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-304)
Java HotSpot(TM) Client VM (build 1.5.0_19-137, mixed mode, sharing)
Please provide any additional information below.
The line is: r01.getPixels(x, 0, 1, h, col01);
I don't know why for some images this works well but for others not... Do you have an idea?
I'm running Java 1.5, so I removed all the Java 1.6 code that you had, and simply using the command line interface.
I'll attach a file of an image that fails
What steps will reproduce the problem?
1. I run the application from the command line, using, for example -i /tmp/100x100.png -nh 50 -nw 50
2. For some images, not all, but some I get an ArrayOutOfBoundsException
Exception in thread "Thread-0" java.lang.ArrayIndexOutOfBoundsException: 200
at sun.awt.image.ByteInterleavedRaster.getPixels(ByteInterleavedRaster.java:1024)
at net.semanticmetadata.seams.ImageSeamOperations.getGradientImage(ImageSeamOperations.java:481)
at net.semanticmetadata.seams.ImageSeamOperations.generateEnergyImage(ImageSeamOperations.java:461)
at net.semanticmetadata.seams.ImageSeamOperations.findOptimalHorizontalSeam(ImageSeamOperations.java:58)
at net.semanticmetadata.seams.ImageSeamOperations.carveHorizontalSeam(ImageSeamOperations.java:314)
at net.semanticmetadata.seams.SeamCarving.main(SeamCarving.java:118)
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Using v4. On OS X
$ java -version
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-304)
Java HotSpot(TM) Client VM (build 1.5.0_19-137, mixed mode, sharing)
Please provide any additional information below.
The line is: r01.getPixels(x, 0, 1, h, col01);
I don't know why for some images this works well but for others not... Do you have an idea?
I'm running Java 1.5, so I removed all the Java 1.6 code that you had, and simply using the command line interface.
I'll attach a file of an image that fails