AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
November 1998

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



1998.11.30 00:00 "Bug report for TIFF library v3.4beta037", by Stuart Mackinnon

I am using TIFF Library v3.4beta037 under Win32 (not using the standard
Win32 contrib code - using different file I/O classes internal to our app).

Using rgb2ycbcr I produced an image with 1:1 sampling. I then attempted to
use TIFFRGBAImage (ie. tif_getimage.c) to read the ycbcr image. It crashed.
The reason being that the putcontig8bitYCbCr11tile callback to decode the
pixels only does w>>1 pixels - which is wrong. There is no subsampling so
it should infact be doing the whole width.

More specifically:

/*
 * 8-bit packed YCbCr samples w/ no subsampling => RGB
 */
DECLAREContigPutFunc(putcontig8bitYCbCr11tile)
{
    YCbCrSetup;

    (void) y;
    /* XXX adjust fromskew */
    do {
        x = w>>1;            <----------------- **** This is wrong! ****
        do {
            int Cb = pp[1];
            int Cr = pp[2];

            YCbCrtoRGB(*cp++, pp[0]);

            pp += 3;
        } while (--x);
        cp += toskew;
        pp += fromskew;
    } while (--h);
}

The code should be changed to make x = w

Regards,
-- 

+- Stuart MacKinnon ------------------------------ stuart@eyeonline.com ---+
| Senior Programmer at eyeon Software            http://www.eyeonline.com  |
+--------------------------------------------------------------------------+