Skip to content

Commit 59f9b2c

Browse files
committed
start hacking
1 parent 2672bb6 commit 59f9b2c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

libvips/foreign/tiff2vips.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@
271271
#include "jpeg.h"
272272
#endif /*HAVE_JPEG*/
273273

274+
274275
/* Aperio TIFFs (svs) use these compression types for jp2k-compressed tiles.
275276
*/
276277
#define JP2K_YCC 33003
@@ -280,6 +281,11 @@
280281
*/
281282
#define JP2K_LOSSY 33004
282283

284+
// only in recent libtiffs
285+
#ifndef TIFFTAG_IMAGESOURCEDATA
286+
#define TIFFTAG_IMAGESOURCEDATA (37724)
287+
#endif
288+
283289
/* Compression types we handle ourselves.
284290
*/
285291
static int rtiff_we_decompress[] = {
@@ -1904,6 +1910,9 @@ rtiff_set_header(Rtiff *rtiff, VipsImage *out)
19041910
if (TIFFGetField(rtiff->tiff, TIFFTAG_PHOTOSHOP, &data_len, &data))
19051911
vips_image_set_blob_copy(out, VIPS_META_PHOTOSHOP_NAME, data, data_len);
19061912

1913+
if (TIFFGetField(rtiff->tiff, TIFFTAG_IMAGESOURCEDATA, &data_len, &data))
1914+
vips_image_set_blob_copy(out, VIPS_META_PHOTOSHOP_DATA, data, data_len);
1915+
19071916
if (rtiff->header.image_description)
19081917
vips_image_set_string(out, VIPS_META_IMAGEDESCRIPTION,
19091918
rtiff->header.image_description);

libvips/include/vips/header.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ extern "C" {
6767
*/
6868
#define VIPS_META_PHOTOSHOP_NAME "photoshop-data"
6969

70+
/**
71+
* VIPS_META_PHOTOSHOP_DATA:
72+
*
73+
* The name that TIFF read and write operations use for the image's
74+
* TIFFTAG_IMAGESOURCEDATA data.
75+
*/
76+
#define VIPS_META_PHOTOSHOP_DATA "photoshop-image-data"
77+
7078
/**
7179
* VIPS_META_ICC_NAME:
7280
*

0 commit comments

Comments
 (0)