I must have got something wrong but I can't see it.
I use the following bit of code to find out how big the JPEG will be when I'm about to write an image to a memory block. The hRGB points to an RGB image that has just been read elsewhere in the program.
hDest = _IS40_OpenNullDest(0);
ui = _IS40_WriteJPG (hDest, hRGB, iwid, ihgt, 24, iwid*3, 80, NULL, 1<<5);
dw = _IS40_GetLastError ();
When the image dimensions are similar to thumbnail size, like 160x120 it's fine. When I do two 640x480 images, the first one returns a reasonable size, but all subsequent images return 0, with a last error of 4.
Thanks for any hints please.