fix misspelling of IPTC as IPCT

the letters have been accidentally swapped for years

add a compat macro so older code still works
This commit is contained in:
John Cupitt 2017-12-31 10:23:27 +00:00
parent 1feaeb230e
commit 77287a938f
11 changed files with 32 additions and 27 deletions

View File

@ -1,10 +1,11 @@
10/12/17 started 8.6.1
- stop window new/free cycling .. faster zoom out on large images in nip2
- stop window new/free cycling .. faster zoom out on some large images in nip2
- fix some compiler warnings
- remove the 64-image limit on bandary operations
- better version date [bmwiedemann]
- bump wrapper script version [bgilbert]
- fix a memleak with an error during jpeg buffer write [lovell]
- fix a memleak on error during jpeg buffer write [lovell]
- fix misspelling of IPTC as IPCT [lovell]
15/4/17 started 8.6.0
- supports fits images with leading non-image HDUs, thanks benepo

View File

@ -52,7 +52,7 @@
* - attach rationals as a/b, don't convert to double
* 21/11/12
* - don't insist exif must have data
* - attach IPCT data (app13), thanks Gary
* - attach IPTC data (app13), thanks Gary
* 6/7/13
* - null-terminate exif strings, thanks Mike
* 24/2/14
@ -468,11 +468,11 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out )
break;
case JPEG_APP0 + 13:
/* Possible IPCT data block.
/* Possible IPTC data block.
*/
if( p->data_length > 5 &&
vips_isprefix( "Photo", (char *) p->data ) &&
attach_blob( out, VIPS_META_IPCT_NAME,
attach_blob( out, VIPS_META_IPTC_NAME,
p->data, p->data_length ) )
return( -1 );
break;
@ -703,7 +703,7 @@ static int
vips__jpeg_read( ReadJpeg *jpeg, VipsImage *out, gboolean header_only )
{
/* Need to read in APP1 (EXIF metadata), APP2 (ICC profile), APP13
* (photoshop IPCT).
* (photoshop IPTC).
*/
jpeg_save_markers( &jpeg->cinfo, JPEG_APP0 + 1, 0xffff );
jpeg_save_markers( &jpeg->cinfo, JPEG_APP0 + 2, 0xffff );

View File

@ -368,8 +368,8 @@ vips_foreign_load_jpeg_buffer_init( VipsForeignLoadJpegBuffer *buffer )
* #VIPS_META_ICC_NAME. You need to use something like
* vips_icc_import() to get CIE values from the file.
*
* EXIF metadata is attached as #VIPS_META_EXIF_NAME, IPCT as
* #VIPS_META_IPCT_NAME, and XMP as #VIPS_META_XMP_NAME.
* EXIF metadata is attached as #VIPS_META_EXIF_NAME, IPTC as
* #VIPS_META_IPTC_NAME, and XMP as #VIPS_META_XMP_NAME.
*
* The int metadata item "jpeg-multiscan" is set to the result of
* jpeg_has_multiple_scans(). Interlaced jpeg images need a large amount of

View File

@ -450,7 +450,7 @@ vips_foreign_save_jpeg_mime_init( VipsForeignSaveJpegMime *mime )
* in jpg parlance). These files may be better for display over a slow network
* conection, but need much more memory to encode and decode.
*
* If @strip is set, no EXIF data, IPCT data, ICC profile or XMP metadata is
* If @strip is set, no EXIF data, IPTC data, ICC profile or XMP metadata is
* written into the output file.
*
* If @no_subsample is set, chrominance subsampling is disabled. This will
@ -505,7 +505,7 @@ vips_foreign_save_jpeg_mime_init( VipsForeignSaveJpegMime *mime )
* the file. #VIPS_META_RESOLUTION_UNIT is used to set the EXIF resolution
* unit. #VIPS_META_ORIENTATION is used to set the EXIF orientation tag.
*
* IPCT as #VIPS_META_IPCT_NAME and XMP as #VIPS_META_XMP_NAME
* IPTC as #VIPS_META_IPTC_NAME and XMP as #VIPS_META_XMP_NAME
* are coded and attached.
*
* See also: vips_jpegsave_buffer(), vips_image_write_to_file().

View File

@ -158,7 +158,7 @@
* - close the read down early for a header read ... this saves an
* fd during file read, handy for large numbers of input images
* 29/9/15
* - load IPCT metadata
* - load IPTC metadata
* - load photoshop metadata
* 21/12/15
* - load TIFFTAG_IMAGEDESCRIPTION
@ -1283,7 +1283,7 @@ rtiff_set_header( Rtiff *rtiff, VipsImage *out )
(VipsCallbackFn) vips_free, data_copy, data_length );
}
/* Read any IPCT metadata.
/* Read any IPTC metadata.
*/
if( TIFFGetField( rtiff->tiff,
TIFFTAG_RICHTIFFIPTC, &data_length, &data ) &&
@ -1291,7 +1291,7 @@ rtiff_set_header( Rtiff *rtiff, VipsImage *out )
data_length ) {
void *data_copy;
/* For no very good reason, libtiff stores IPCT as an array of
/* For no very good reason, libtiff stores IPTC as an array of
* long, not byte.
*/
data_length *= 4;
@ -1299,7 +1299,7 @@ rtiff_set_header( Rtiff *rtiff, VipsImage *out )
if( !(data_copy = vips_malloc( NULL, data_length )) )
return( -1 );
memcpy( data_copy, data, data_length );
vips_image_set_blob( out, VIPS_META_IPCT_NAME,
vips_image_set_blob( out, VIPS_META_IPTC_NAME,
(VipsCallbackFn) vips_free, data_copy, data_length );
}

View File

@ -361,7 +361,7 @@ vips_foreign_load_tiff_buffer_init( VipsForeignLoadTiffBuffer *buffer )
*
* Any ICC profile is read and attached to the VIPS image as
* #VIPS_META_ICC_NAME. Any XMP metadata is read and attached to the image
* as #VIPS_META_XMP_NAME. Any IPCT is attached as #VIPS_META_IPCT_NAME. The
* as #VIPS_META_XMP_NAME. Any IPTC is attached as #VIPS_META_IPTC_NAME. The
* image description is
* attached as #VIPS_META_IMAGEDESCRIPTION. Data in the photoshop tag is
* attached as #VIPS_META_PHOTOSHOP_NAME.

View File

@ -539,7 +539,7 @@ vips_foreign_save_tiff_buffer_init( VipsForeignSaveTiffBuffer *buffer )
* The value of #VIPS_META_XMP_NAME is written to
* the XMP tag. #VIPS_META_ORIENTATION (if set) is used to set the value of
* the orientation
* tag. #VIPS_META_IPCT (if set) is used to set the value of the IPCT tag.
* tag. #VIPS_META_IPTC (if set) is used to set the value of the IPTC tag.
* #VIPS_META_PHOTOSHOP_NAME (if set) is used to set the value of the PHOTOSHOP
* tag.
*

View File

@ -55,7 +55,7 @@
* - optionally parse rationals as a/b
* - update exif image dimensions
* 21/11/12
* - attach IPCT data (app13), thanks Gary
* - attach IPTC data (app13), thanks Gary
* 2/10/13 Lovell Fuller
* - add optimize_coding parameter
* - add progressive mode
@ -594,7 +594,7 @@ write_vips( Write *write, int qfac, const char *profile,
write_blob( write,
VIPS_META_XMP_NAME, JPEG_APP0 + 1 ) ||
write_blob( write,
VIPS_META_IPCT_NAME, JPEG_APP0 + 13 ) )
VIPS_META_IPTC_NAME, JPEG_APP0 + 13 ) )
return( -1 );
/* A profile supplied as an argument overrides an embedded

View File

@ -154,7 +154,7 @@
* - squash >128 rather than >0, nicer results for shrink
* - add miniswhite option
* 29/9/15
* - try to write IPCT metadata
* - try to write IPTC metadata
* - try to write photoshop metadata
* 11/11/15
* - better alpha handling, thanks sadaqatullahn
@ -462,17 +462,17 @@ wtiff_embed_ipct( Wtiff *wtiff, TIFF *tif )
void *data;
size_t data_length;
if( !vips_image_get_typeof( wtiff->im, VIPS_META_IPCT_NAME ) )
if( !vips_image_get_typeof( wtiff->im, VIPS_META_IPTC_NAME ) )
return( 0 );
if( vips_image_get_blob( wtiff->im, VIPS_META_IPCT_NAME,
if( vips_image_get_blob( wtiff->im, VIPS_META_IPTC_NAME,
&data, &data_length ) )
return( -1 );
/* For no very good reason, libtiff stores IPCT as an array of
/* For no very good reason, libtiff stores IPTC as an array of
* long, not byte.
*/
if( data_length & 3 ) {
g_warning( "%s", _( "rounding up IPCT data length" ) );
g_warning( "%s", _( "rounding up IPTC data length" ) );
data_length /= 4;
data_length += 1;
}
@ -482,7 +482,7 @@ wtiff_embed_ipct( Wtiff *wtiff, TIFF *tif )
TIFFSetField( tif, TIFFTAG_RICHTIFFIPTC, data_length, data );
#ifdef DEBUG
printf( "vips2tiff: attached IPCT from meta\n" );
printf( "vips2tiff: attached IPTC from meta\n" );
#endif /*DEBUG*/
return( 0 );

View File

@ -53,11 +53,11 @@ extern "C" {
#define VIPS_META_XMP_NAME "xmp-data"
/**
* VIPS_META_IPCT_NAME:
* VIPS_META_IPTC_NAME:
*
* The name that read and write operations use for the image's IPCT data.
* The name that read and write operations use for the image's IPTC data.
*/
#define VIPS_META_IPCT_NAME "ipct-data"
#define VIPS_META_IPTC_NAME "iptc-data"
/**
* VIPS_META_PHOTOSHOP_NAME:

View File

@ -41,6 +41,10 @@ extern "C" {
/* Renamed types.
*/
/* We have this misspelt in earlier versions :(
*/
#define VIPS_META_IPCT_NAME VIPS_META_IPTC_NAME
#define IM_D93_X0 VIPS_D93_X0
#define IM_D93_Y0 VIPS_D93_Y0
#define IM_D93_Z0 VIPS_D93_Z0