Results 1 to 3 of 3

Thread: Unwritable Image

  1. #1
    Join Date
    Dec 1969
    Location
    .
    Posts
    29

    Default Unwritable Image

    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 ();
    ui=_IS40_CloseDest(hDest);

    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.

  2. #2
    Join Date
    Mar 2006
    Posts
    895

    Default Re: Unwritable Image

    i can't reproduce the problem. here's the code i'm using:

    Code:
     for (int i=0;i < 10;i++)
     {
         UINT32 w = 640, h=480;
         BYTE * buf = new BYTE [640 * 480 * 3];
         HISDEST hDest = IS40_OpenNullDest(0);
         UINT32 sz = IS40_WriteJPG(hDest, buf, w, h, 24, w * 3, 90, NULL, 0);         
         TRACE("%d\n", sz);
         IS40_CloseDest(hDest);
         delete [] buf;
     }

  3. #3
    Join Date
    Dec 1969
    Location
    .
    Posts
    29

    Default Re: Unwritable Image

    Sorry, it looks like the pointer to the RGB got invalidated somewhere. My fault.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •