My favorites | Sign in
Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 1: ResampleOp.createSubSampling() ArrayIndexOutOfBoundsException
3 people starred this issue and may be notified of changes. Back to list
Status:  Verified
Owner:  m...@nobel-joergensen.com
Closed:  Jun 2009
Type-Defect
Priority-Medium


Sign in to add a comment
 
Reported by google....@badgers-in-foil.co.uk, Mar 15, 2009
Using the 0.7 release,

java.lang.ArrayIndexOutOfBoundsException: 8436
  at
com.mortennobel.imagescaling.ResampleOp.createSubSampling(ResampleOp.java:240)
  at com.mortennobel.imagescaling.ResampleOp.doFilter(ResampleOp.java:133)
  at
com.mortennobel.imagescaling.AdvancedResizeOp.filter(AdvancedResizeOp.java:69)

The image I'm scaling is 1367x888.  The code I'm using is roughly,

  int WIDTH_THUMBNAIL = 57;
  DimensionConstrain dimThumb
    = DimensionConstrain.createMaxDimension(WIDTH_THUMBNAIL,
                                            (int)(WIDTH_THUMBNAIL/1.5));
  BufferedImage image = ImageIO.read(data);
  ResampleOp resampleOp = new ResampleOp(dimThumb);
  resampleOp.setFilter(ResampleFilters.getLanczos3Filter());
  BufferedImage rescaled = resampleOp.filter(image, null);

Comment 1 by google....@badgers-in-foil.co.uk, Mar 15, 2009
I'd also note that the code worked fine until I adjusted WIDTH_THUMBNAIL to the value
given.
Comment 2 by janne.hietamaki, Apr 27, 2009
The following code: 
	BufferedImage inputImage = ImageIO.read(new FileInputStream("test.jpg"));
        new ResampleOp(51, 51).filter(inputImage, null);

Fails every time with exception:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3774
	at com.mortennobel.imagescaling.ResampleOp.createSubSampling(ResampleOp.java:240)
	at com.mortennobel.imagescaling.ResampleOp.doFilter(ResampleOp.java:133)
	at com.mortennobel.imagescaling.AdvancedResizeOp.filter(AdvancedResizeOp.java:81)

When scaling image: http://www.koskue.net/test.jpg 

When width is something else than 51 everything works just fine.
Comment 3 by m...@nobel-joergensen.com, Jun 07, 2009
Thanks for the feedback - and sorry for not responding before now (I didn't configure
the google code to notify me on new issues).

I have reproduced the bug and will hopefully soon have a patched version ready.
Status: Started
Owner: mor...@nobel-joergensen.com
Comment 4 by m...@nobel-joergensen.com, Jun 09, 2009
Fixed in version 0.7.2
Status: Verified
Sign in to add a comment

Hosted by Google Code