tag non-int rgb tiff as scrgb

Photoshop uses 0 - 1 and no gamma for float RGB, so we tag float /
complex RGB tiffs as scRGB

thanks Murat
This commit is contained in:
John Cupitt 2016-04-11 12:37:48 +01:00
parent 511a0a7da5
commit f58190bccd
2 changed files with 14 additions and 3 deletions

View File

@ -22,6 +22,7 @@
- added VIPS_COUNT_PIXELS(), overcomputation tracking - added VIPS_COUNT_PIXELS(), overcomputation tracking
- @out_format in vips_system() can contain [options] - @out_format in vips_system() can contain [options]
- webpsave_buffer no longer ignores @lossless, thanks aaron42net - webpsave_buffer no longer ignores @lossless, thanks aaron42net
- float tiff tagged as scRGB to match photoshop convention, thanks Murat
24/3/16 started 8.2.4 24/3/16 started 8.2.4
- fix nohalo and vsqbs interpolators, thanks Rafael - fix nohalo and vsqbs interpolators, thanks Rafael

View File

@ -162,6 +162,9 @@
* - load photoshop metadata * - load photoshop metadata
* 21/12/15 * 21/12/15
* - load TIFFTAG_IMAGEDESCRIPTION * - load TIFFTAG_IMAGEDESCRIPTION
* 11/4/16
* - non-int RGB images are tagged as scRGB ... matches photoshop
* convention
*/ */
/* /*
@ -688,7 +691,8 @@ parse_greyscale( ReadTiff *rtiff, VipsImage *out )
return( -1 ); return( -1 );
out->Bands = rtiff->samples_per_pixel; out->Bands = rtiff->samples_per_pixel;
if( (out->BandFmt = guess_format( rtiff )) == VIPS_FORMAT_NOTSET ) out->BandFmt = guess_format( rtiff );
if( out->BandFmt == VIPS_FORMAT_NOTSET )
return( -1 ); return( -1 );
out->Coding = VIPS_CODING_NONE; out->Coding = VIPS_CODING_NONE;
@ -957,15 +961,21 @@ static int
parse_copy( ReadTiff *rtiff, VipsImage *out ) parse_copy( ReadTiff *rtiff, VipsImage *out )
{ {
out->Bands = rtiff->samples_per_pixel; out->Bands = rtiff->samples_per_pixel;
if( (out->BandFmt = guess_format( rtiff )) == VIPS_FORMAT_NOTSET ) out->BandFmt = guess_format( rtiff );
if( out->BandFmt == VIPS_FORMAT_NOTSET )
return( -1 ); return( -1 );
out->Coding = VIPS_CODING_NONE; out->Coding = VIPS_CODING_NONE;
if( rtiff->samples_per_pixel >= 3 && if( rtiff->samples_per_pixel >= 3 &&
(rtiff->photometric_interpretation == PHOTOMETRIC_RGB || (rtiff->photometric_interpretation == PHOTOMETRIC_RGB ||
rtiff->photometric_interpretation == PHOTOMETRIC_YCBCR) ) { rtiff->photometric_interpretation == PHOTOMETRIC_YCBCR) ) {
if( rtiff->bits_per_sample == 16 ) if( out->BandFmt == VIPS_FORMAT_USHORT )
out->Type = VIPS_INTERPRETATION_RGB16; out->Type = VIPS_INTERPRETATION_RGB16;
else if( !vips_band_format_isint( out->BandFmt ) )
/* Most float images use 0 - 1 for black - white.
* Photoshop uses 0 - 1 and no gamma.
*/
out->Type = VIPS_INTERPRETATION_scRGB;
else else
out->Type = VIPS_INTERPRETATION_sRGB; out->Type = VIPS_INTERPRETATION_sRGB;
} }