Inverted order of TIFF tag writing when saving multi-page subifd pyramids (#3047)

* Inverted order of TIFF tag writing when saving multi-page subifd pyramids to ensure that subifd pyramid layers are correctly tagged as reduced-image subfile type and not as pages

* Use if-else clause to avoid tag overwriting
This commit is contained in:
Ruven 2022-09-13 18:56:42 +02:00 committed by GitHub
parent 3081821636
commit 4985fec6b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -822,12 +822,12 @@ wtiff_write_header( Wtiff *wtiff, Layer *layer )
else
TIFFSetField( tif, TIFFTAG_ROWSPERSTRIP, wtiff->tileh );
if( layer->above )
/* Pyramid layer.
*/
TIFFSetField( tif, TIFFTAG_SUBFILETYPE, FILETYPE_REDUCEDIMAGE );
if( wtiff->toilet_roll ) {
else if( wtiff->toilet_roll ) {
/* One page of many.
*/
TIFFSetField( tif, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE );
@ -836,6 +836,7 @@ wtiff_write_header( Wtiff *wtiff, Layer *layer )
wtiff->page_number, wtiff->n_pages );
}
/* Sample format.
*
* Don't set for logluv: libtiff does this for us.