Skip to content

Commit 96604db

Browse files
committed
turning on subifd enable pyramid mode
see libvips/pyvips#277
1 parent cf1228b commit 96604db

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

libvips/foreign/vips2tiff.c

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@
199199
* - add bitdepth support for 2 and 4 bit greyscale images
200200
* 29/9/21 LionelArn2
201201
* - loop for the whole output image, rather than per page
202+
* 20/10/21 [jacopoabramo]
203+
* - subifd enables pyramid
204+
* - add support for page_height param
202205
*/
203206

204207
/*
@@ -230,8 +233,8 @@
230233

231234
/*
232235
#define DEBUG_VERBOSE
233-
#define DEBUG
234236
*/
237+
#define DEBUG
235238

236239
#ifdef HAVE_CONFIG_H
237240
#include <config.h>
@@ -1216,6 +1219,22 @@ wtiff_new( VipsImage *input, const char *filename,
12161219
wtiff->n_pages = wtiff->ready->Ysize / wtiff->page_height;
12171220
}
12181221

1222+
/* subifd turns on pyramid mode.
1223+
*/
1224+
if( wtiff->subifd )
1225+
wtiff->pyramid = TRUE;
1226+
1227+
/* Pyramid images must be tiled.
1228+
*/
1229+
if( wtiff->pyramid )
1230+
wtiff->tile = TRUE;
1231+
1232+
/* Multi-page pyramids must be in subifd mode.
1233+
*/
1234+
if( wtiff->pyramid &&
1235+
wtiff->toilet_roll )
1236+
wtiff->subifd = TRUE;
1237+
12191238
/* We can only pyramid LABQ and non-complex images.
12201239
*/
12211240
if( wtiff->pyramid ) {
@@ -1229,18 +1248,6 @@ wtiff_new( VipsImage *input, const char *filename,
12291248
}
12301249
}
12311250

1232-
/* Pyramid images must be tiled.
1233-
*/
1234-
if( wtiff->pyramid &&
1235-
!wtiff->tile )
1236-
wtiff->tile = TRUE;
1237-
1238-
/* Multi-page pyramids must be in subifd mode.
1239-
*/
1240-
if( wtiff->pyramid &&
1241-
wtiff->toilet_roll )
1242-
wtiff->subifd = TRUE;
1243-
12441251
/* If compression is off and we're writing a >4gb image, automatically
12451252
* enable bigtiff.
12461253
*

0 commit comments

Comments
 (0)