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
April 2007

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!



2007.04.09 16:55 "Modify decode tiff file including JPG data", by <lyang@founder.com>

Hello

In verion 3.8.2, when reading tiff file including JPG data, there turns out
to be a black block.

I checked the lib and find that, this may caused by a place that Color Space
Converting from CMYK to RGB is not correct. I list it here and sharing it

It is in the file tif_getimage.c. The function is
DECLAREContigPutFunc(putRGBcontig8bitCMYKtile) 

 

there used to be 

 

DECLAREContigPutFunc(putRGBcontig8bitCMYKtile)

{

    int samplesperpixel = img->samplesperpixel;

    uint16 r, g, b, k;

 

    (void) x; (void) y;

    fromskew *= samplesperpixel;

    while (h-- > 0) {

         UNROLL8(w, NOP,

             k = 255 - pp[3];

             r = (k*(255-pp[0]))/255;

             g = (k*(255-pp[1]))/255;

             b = (k*(255-pp[2]))/255;

             *cp++ = PACK(r, g, b);

             pp += samplesperpixel);

         cp += toskew;

         pp += fromskew;

    }

} 

 

and currently, I change it to 

 

DECLAREContigPutFunc(putRGBcontig8bitCMYKtile)

{

    int samplesperpixel = img->samplesperpixel;

    uint16 r, g, b, k;

 

    (void) x; (void) y;

    fromskew *= samplesperpixel;

    while (h-- > 0) {

         UNROLL8(w, NOP,

                   r = pp[0];

                   g = pp[1];

                   b = pp[2];

                   k = pp[3];

                   *cp++ = PACK4(r,g,b,k);

             pp += samplesperpixel);

         cp += toskew;

         pp += fromskew;

    }

}

 

then, the tiff file with JPG data can be read.