Return-Path: <tiff-admin@remotesensing.org>
Received: from inas001.isp.belgacom.be (inas001.isp.belgacom.be [195.238.2.16])
        by six.skynet.be (8.12.9/8.12.9/Skynet-MAILSTORE-2.14) with ESMTP id i1GMguti029315
        for <joris.at.lebbeke@skynet.be>; Mon, 16 Feb 2004 23:42:56 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from gee.skynet.be (gee.skynet.be [195.238.2.99])
        by inas001.isp.belgacom.be (8.12.9/8.12.9/Skynet-IN-AS-2.03) with ESMTP id i1GMgdug020384
        for <joris.at.lebbeke@skynet.be>; Mon, 16 Feb 2004 23:42:53 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com ([208.24.120.42])
        by gee.skynet.be (8.12.9/8.12.9/Skynet-IN-2.32) with ESMTP id i1GMgRTE004255
        for <joris.at.lebbeke@skynet.be>; Mon, 16 Feb 2004 23:42:28 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com (localhost.localdomain [127.0.0.1])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id i1GMfDl30122;
	Mon, 16 Feb 2004 17:41:13 -0500
Received: from plotka.fastcom.no (plotka.fastcom.no [212.20.193.190])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id i1G9sDl21995
	for <tiff@remotesensing.org>; Mon, 16 Feb 2004 04:54:13 -0500
Received: from itbrkt (unknown [212.125.218.203])
	by plotka.fastcom.no (Postfix) with SMTP id A18A31C236
	for <tiff@remotesensing.org>; Mon, 16 Feb 2004 11:06:29 +0100 (NFT)
From: =?iso-8859-1?Q?Kenneth_Tj=F8stheim?= <kenneth.tjostheim@powelgemini.no>
To: <tiff@remotesensing.org>
Message-ID: <000401c3f472$d3214d50$cbda7dd4@POWELGEMINI.NO>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Importance: Normal
Subject: [Tiff] TIFF BUG: RGB gets swapped on YCBCR
Sender: tiff-admin@remotesensing.org
Errors-To: tiff-admin@remotesensing.org
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.0.11
Precedence: bulk
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Post: <mailto:tiff@remotesensing.org>
List-Subscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
List-Id: TIFF and libtiff discussion <tiff.remotesensing.org>
List-Unsubscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://remotesensing.org/pipermail/tiff/>
Date: Mon, 16 Feb 2004 10:54:08 +0100
X-UIDL: cfe8d55ba2227ddb7c38308f62d49842

I really don't know what is wrong, but I have some images that becomes BGR
instead of RGB. (Others are OK)
They are tiled and layered: 6400x2400 tile size 128x128
Could be I am not using it correctly but ???
Have tried to swap R with B and then they gets OK, but then others gets bad.


TIFFRGBAImageBegin()
{
  ....

    switch (img->photometric) {
    case PHOTOMETRIC_YCBCR:
	if (planarconfig != PLANARCONFIG_CONTIG) {
	    sprintf(emsg, "Sorry, can not handle YCbCr images with %s=%d",
		"Planarconfiguration", planarconfig);
	    return (0);
	}
	/* It would probably be nice to have a reality check here. */
	if (planarconfig == PLANARCONFIG_CONTIG)
	    /* can rely on libjpeg to convert to RGB */
	    /* XXX should restore current state on exit */
	    switch (compress) {
		case COMPRESSION_OJPEG:
		case COMPRESSION_JPEG:
		    TIFFSetField(tif, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB);
		    img->photometric = PHOTOMETRIC_RGB;


DEBUGGING GETS ME HERE


                    break;

                default:
                    /* do nothing */;
                    break;
	    }
	break;

}

tiffinfo CC038114.TIF
TIFFReadDirectory: Warning, e:CC038114.TIF: unknown field with tag 33918
(0x847e
) encountered.
TIFF Directory at offset 0x2003dc
  Subfile Type: (0 = 0x0)
  Image Width: 6400 Image Length: 4800
  Tile Width: 128 Tile Length: 128
  Resolution: 1000, 1000 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Samples/Pixel: 3
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Tag 33918:
2,10,104,0,0,0,0,16425,0,0,0,0,0,0,0,0,0,0,21600,-16039,0,0,0,0,0,0
,0,16425,0,0,0,0,0,0,22138,16753,0,0,0,0,0,0,0,0,0,0,0,16368,0,0,0,0,0,0,0,0
,0,0
,0,0,0,0,0,0,0,0,0,16368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0
,0,0,0,0,0,0,0,0,0,0,0,0
  JPEG Tables: (1722 bytes)
TIFFReadDirectory: Warning, e:CC038114.TIF: unknown field with tag 33919
(0x847f) encountered.
TIFF Directory at offset 0x291a58
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 3200 Image Length: 2400
  Tile Width: 128 Tile Length: 128
  Resolution: 0.15625, 0.208333 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Samples/Pixel: 3
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Tag 33919: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  JPEG Tables: (574 bytes)
TIFFReadDirectory: Warning, e:CC038114.TIF: unknown field with tag 33919
(0x847f) encountered.
TIFF Directory at offset 0x2be9b8
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 1600 Image Length: 1200
  Tile Width: 128 Tile Length: 128
  Resolution: 0.15625, 0.208333 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Samples/Pixel: 3
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Tag 33919: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  JPEG Tables: (574 bytes)
TIFFReadDirectory: Warning, e:CC038114.TIF: unknown field with tag 33919
(0x847f) encountered.
TIFF Directory at offset 0x2cc3ec
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 800 Image Length: 600
  Tile Width: 128 Tile Length: 128
  Resolution: 0.15625, 0.208333 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Samples/Pixel: 3
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Tag 33919: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  JPEG Tables: (574 bytes)
TIFFReadDirectory: Warning, e:CC038114.TIF: unknown field with tag 33919
(0x847f) encountered.
TIFF Directory at offset 0x2d0d1c
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 400 Image Length: 300
  Tile Width: 128 Tile Length: 128
  Resolution: 0.15625, 0.208333 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Samples/Pixel: 3
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Tag 33919: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  JPEG Tables: (574 bytes)
TIFFReadDirectory: Warning, e:CC038114.TIF: unknown field with tag 33919
(0x847f) encountered.
TIFF Directory at offset 0x2d25e4
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 200 Image Length: 150
  Tile Width: 128 Tile Length: 128
  Resolution: 0.15625, 0.208333 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Samples/Pixel: 3
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Tag 33919: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  JPEG Tables: (574 bytes)
TIFFReadDirectory: Warning, e:CC038114.TIF: unknown field with tag 33919
(0x847f) encountered.
TIFF Directory at offset 0x2d3040
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 100 Image Length: 75
  Tile Width: 128 Tile Length: 128
  Resolution: 0.15625, 0.208333 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Samples/Pixel: 3
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Tag 33919: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  JPEG Tables: (574 bytes)
TIFFReadDirectory: Warning, e:CC038114.TIF: unknown field with tag 33919
(0x847f) encountered.
TIFF Directory at offset 0x2d3904
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 50 Image Length: 37
  Tile Width: 128 Tile Length: 128
  Resolution: 0.15625, 0.208333 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Samples/Pixel: 3
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Tag 33919: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  JPEG Tables: (574 bytes)
TIFFReadDirectory: Warning, e:CC038114.TIF: unknown field with tag 33919
(0x847f) encountered.
TIFF Directory at offset 0x2d3ff4
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 25 Image Length: 18
  Tile Width: 128 Tile Length: 128
  Resolution: 0.15625, 0.208333 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Samples/Pixel: 3
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Tag 33919: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  JPEG Tables: (574 bytes)

_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://remotesensing.org/mailman/listinfo/tiff
