This is the method Im using to resize an image.
I just doubled the size in this example 'multiplied by 2'.
this.w = w.get(0)*2; //NEW WIDTH
this.h = h.get(0)*2; //NEW HEIGHT
ByteBuffer newImage = BufferUtils.createByteBuffer(
this.w * this.h * comp.get(0) );
int alpha;
if (comp.get(0) == 4) alpha = comp.get(0)-1;
else alpha = STBImageResize.STBIR_ALPHA_CHANNEL_NONE;
STBImageResize.stbir_resize(
image, //BUFFER LOADED FROM stbi_load_from_memory
w.get(0),
h.get(0),
w.get(0)*comp.get(0),
newImage,
this.w,
this.h,
this.w*comp.get(0),
STBImageResize.STBIR_TYPE_UINT8,
comp.get(0),
alpha,
0,
STBImageResize.STBIR_EDGE_ZERO,
STBImageResize.STBIR_EDGE_ZERO,
STBImageResize.STBIR_FILTER_CUBICBSPLINE,
STBImageResize.STBIR_FILTER_CUBICBSPLINE,
STBImageResize.STBIR_COLORSPACE_SRGB);
STBImage.stbi_image_free(image);
image = newImage;