HamletComplex
YaBB Newbies
Offline
Posts: 1
Bug/limit dealing with image sizes?
Apr 23rd , 2005, 11:37am
I'm working from the included Linear Image example. The code has the following lines, among other things: int[] aPixels = new int[200*200]; size(200, 200); a = loadImage("florence03.jpg"); Since florence03.jpg is 200x200 px itself, it seems safe to assume that to deal with any other size image, I only have to modify those first two lines to match whatever the dimensions of my new image are, right? So, I change the dimensions to 728x90(don't ask), feed it a matching image, and after working to the bottom of the image, instead of reversing direction, Processing barfs up: java.lang.ArrayIndexOutOfBoundsException: 65520 at Temporary_6528_815.draw(Temporary_6528_815.java:50) at processing.core.PApplet.display(PApplet.java:1070) at processing.core.PGraphics.requestDisplay(PGraphics.java:362) at processing.core.PApplet.run(PApplet.java:916) at java.lang.Thread.run(Unknown Source) I've taken the same image and regenerated it as a GIF and JPG, also made sure they're fairly plain(no interlacing/progressive, etc), with no improvement. Next, I leave my image in there, but force aPixels and the window size back to 200x200 and everything is suddenly fine, although the image is obviously mangled when I hold a key down. So, let's assume that the problem is still somehow my image. I go back to loading florence03.jpg at 200square, and everything is back to normal. I force aPixels and size to 400x400, still no problem, although it chugs. Then I force aPixels and size to 728x90(still using florence03.jpg), and the error above reappears. I actually resize florence03 to 728x90, and the problem reoccurs. I think I've safely established that the images aren't the problem. I haven't touched a single thing beyond the lines above. Am I missing something that should be obvious? Please keep in mind that this is pretty much the first thing I've tried. It seemed simple enough *grin*