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
May 2005

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!



Thread

2005.05.25 09:52 "Jpeg and YCbCr", by Kelvin Zhong
2005.05.25 10:41 "Re: Jpeg and YCbCr", by Jean-yves Le Ridant
2005.05.26 01:50 "Re: Jpeg and YCbCr", by Kelvin Zhong
2005.05.26 08:37 "Re: Jpeg and YCbCr", by Jean-yves Le Ridant
2005.05.26 10:02 "Re: Jpeg and YCbCr", by Kelvin Zhong
2005.05.26 12:24 "Re: Jpeg and YCbCr", by Jean-yves Le Ridant
2005.05.26 13:03 "Re: Jpeg and YCbCr", by Joris Van Damme
2005.05.26 14:10 "Re: Jpeg and YCbCr", by Jean-yves Le Ridant
2005.05.26 16:23 "Re: Jpeg and YCbCr", by Joris Van Damme
2005.05.26 16:50 "Re: Jpeg and YCbCr", by Bob Friesenhahn
2005.05.26 17:00 "Re: Jpeg and YCbCr", by Joris Van Damme
2005.05.26 19:30 "Re: Jpeg and YCbCr", by Chris Cox
2005.05.26 19:34 "Re: Jpeg and YCbCr", by Bob Friesenhahn
2005.05.26 19:41 "Re: Jpeg and YCbCr", by Chris Cox
2005.05.26 19:38 "Re: Jpeg and YCbCr", by Chris Losinger
2005.05.26 19:43 "Re: Jpeg and YCbCr", by Chris Cox
2005.05.26 19:48 "Re: Jpeg and YCbCr", by Bob Friesenhahn
2005.05.28 18:01 "Re: Jpeg and YCbCr", by Joris Van Damme
2005.05.30 09:42 "Re: Jpeg and YCbCr", by Jean-yves Le Ridant
2005.05.30 10:31 "Re: Jpeg and YCbCr", by Marti Maria
2005.05.30 13:04 "Re: Jpeg and YCbCr", by Jean-yves Le Ridant
2005.05.30 14:39 "Re: Jpeg and YCbCr", by Marti Maria
2005.05.31 18:36 "Re: Jpeg and YCbCr", by Chris Cox
2005.05.31 18:35 "Re: Jpeg and YCbCr", by Chris Cox
2005.05.31 18:54 "Re: Jpeg and YCbCr", by Bob Friesenhahn
2005.05.31 19:00 "Re: Jpeg and YCbCr", by Chris Cox
2005.05.26 08:58 "Re: Jpeg and YCbCr", by Kelvin Zhong
2005.05.26 10:10 "Re: Jpeg and YCbCr", by Jean-yves Le Ridant

2005.05.26 01:50 "Re: Jpeg and YCbCr", by Kelvin Zhong

> This operations are done by libtiff if you uncomment
> TIFFSetField(m_tif, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB);
> in the program you have posted.
> 
> Best would be to have a tiffinfo of tiffdump of the file that
> acdsee don't want to open.

Thanks Jean-Yves,

I have already done the things like you said,comment the
TIFFSetFiled(m_tif,TIFFTAG_JPEGCOLORMODE,JPEGCOLORMODE_RGB)...,but still
doesn't work.


I created a JPEG-IN-TIFF file with ACDSEE. (FILE 1)
WITH tiffdump,i see follows:
Magic: 0x4949 <little-endian> Version: 0x2a
Directory 0: offset 12576 (0x3120) next 0 (0)
ImageWidth (256) SHORT (3) 1<422>
ImageLength (257) SHORT (3) 1<158>
BitsPerSample (258) SHORT (3) 3<8 8 8>
Compression (259) SHORT (3) 1<7>
Photometric (262) SHORT (3) 1<6>
StripOffsets (273) LONG (4) 1<8>
Orientation (274) SHORT (3) 1<1>
SamplesPerPixel (277) SHORT (3) 1<3>
StripByteCounts (279) LONG (4) 1<12567>
XResolution (282) RATIONAL (5) 1<96>
YResolution (283) RATIONAL (5) 1<96>
PlanarConfig (284) SHORT (3) 1<1>
ResolutionUnit (296) SHORT (3) 1<2>
347 (0x15b) UNDEFINED (7) 574<0xff 0xd8 0xff 0xdb 00 0x43 00 0x8 0x6 0x6 0x7
0x6
 0x5 0x8 0x7 0x7 0x7 0x9 0x9 0x8 0xa 0xc 0x14 0xd ...>
YCbCrSubsampling (530) SHORT (3) 2<1 1>
ReferenceBlackWhite (532) RATIONAL (5) 6<0 255 128 255 128 255>

then i use my code to read this pic, 
and save it with compression = COMPRESSION_JPEG & photometric =
PHOTOMETRIC_YCBCR 
with tiffdump,i saw follows:(FILE 2)
Magic: 0x4949 <little-endian> Version: 0x2a
Directory 0: offset 19642 (0x4cba) next 0 (0)
ImageWidth (256) SHORT (3) 1<422>
ImageLength (257) SHORT (3) 1<158>
BitsPerSample (258) SHORT (3) 3<8 8 8>
Compression (259) SHORT (3) 1<7>
Photometric (262) SHORT (3) 1<6>
StripOffsets (273) LONG (4) 1<8>
Orientation (274) SHORT (3) 1<1>
SamplesPerPixel (277) SHORT (3) 1<3>
RowsPerStrip (278) SHORT (3) 1<158>
StripByteCounts (279) LONG (4) 1<19633>
XResolution (282) RATIONAL (5) 1<96.512>
YResolution (283) RATIONAL (5) 1<96.512>
PlanarConfig (284) SHORT (3) 1<1>
ResolutionUnit (296) SHORT (3) 1<2>
347 (0x15b) UNDEFINED (7) 574<0xff 0xd8 0xff 0xdb 00 0x43 00 0x8 0x6 0x6 0x7
0x6
 0x5 0x8 0x7 0x7 0x7 0x9 0x9 0x8 0xa 0xc 0x14 0xd ...>
YCbCrSubsampling (530) SHORT (3) 2<1 1>
ReferenceBlackWhite (532) RATIONAL (5) 6<0 255 128 255 128 255>

After doing some comparing things,i found almost every tag is same.
except for the StripBytesCounts ,and the file i created has one tag
RowsPerStrip which
the file ACDSEE created didn't have.
but this file(i created) still can't be opened by ACDSEE5.


I opened this file(I created,file 2) in LeadTools ,the image color seems
changed a lot.
so i modify the Photometric tag value from 6 to 2,(PHOTOMETRIC_YCBCR =6,&
PHOTOMETRIC_RGB=2),this time the color seemed right.(in Leadtools,ACDSEE
can't open it).

so I doubt if the libtiff really write the image data as i want to write ?
with compression = COMPRESSION_JPEG & photometric = PHOTOMETRIC_YCBCR ?
(as i think, even if i set photometric = PHOTOMETRIC_YCBCR ,it still write
the image 
data as photometric = PHOTOMETRIC_RGB,... so when i changed the Photometric
tag value from 6 to 2, the color seems right...)

related codes & similar questions can be found with title:
2005.5.24:"Question about Jpeg-in-tiff, JPEG IN TIFF created by libtiff
can't be read by acdsee", by <yourpattern@126.com>
thanks in advance, 

Kingore@126.com
Kelvin Zhong