final int error = glu.gluScaleImage(pixFormat, actualWidth, actualHeight, pixDataType,
image.getData(0), w, h, pixDataType, scaledImage);
if (error != 0) {
final int errorCode = gl.glGetError();
if (errorCode != GL.GL_NO_ERROR) {
throw new GLException(glu.gluErrorString(errorCode));
}
}
image.setWidth(w);
image.setHeight(h);