Skip to content

Commit fa155f0

Browse files
Expand use of subfile type tags
See pages 36 and 40-41 of https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf
1 parent edf7245 commit fa155f0

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/main/java/com/glencoesoftware/pyramid/PyramidFromDirectoryWriter.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,13 +1734,18 @@ else if (FormatTools.isSigned(s.pixelType)) {
17341734
}
17351735
else {
17361736
ifd.put(IFD.SOFTWARE, FormatTools.CREATOR);
1737+
}
17371738

1738-
if (resolution == 0) {
1739+
if (resolution == 0) {
1740+
if (!legacy) {
17391741
ifd.put(IFD.SUB_IFD, (long) 0);
17401742
}
1741-
else {
1742-
ifd.put(IFD.NEW_SUBFILE_TYPE, 1);
1743-
}
1743+
ifd.put(IFD.NEW_SUBFILE_TYPE, s.planeCount > 1 ? 2 : 0);
1744+
ifd.put(IFD.SUBFILE_TYPE, 1);
1745+
}
1746+
else {
1747+
ifd.put(IFD.NEW_SUBFILE_TYPE, s.planeCount > 1 ? 3 : 1);
1748+
ifd.put(IFD.SUBFILE_TYPE, 2);
17441749
}
17451750

17461751
// only write the OME-XML to the first full-resolution IFD

0 commit comments

Comments
 (0)