Skip to content

Commit b979bac

Browse files
authored
exr: OpenEXR 3.4 supports two compression types for HTJ2K (#4871)
`htj2k32` or `htj2k256` compression options. Signed-off-by: Todica Ionut <[email protected]>
1 parent 1c50410 commit b979bac

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

src/doc/builtinplugins.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,8 +1540,8 @@ The official OpenEXR site is http://www.openexr.com/.
15401540
* - ``compression``
15411541
- string
15421542
- one of: ``"none"``, ``"rle"``, ``"zip"``, ``"zips"``, ``"piz"``,
1543-
``"pxr24"``, ``"b44"``, ``"b44a"``, ``"dwaa"``, ``"dwab"`` or ``"htj2k"``.
1544-
(``"htj2k"`` is only supported with OpenEXR 3.4 or later.)
1543+
``"pxr24"``, ``"b44"``, ``"b44a"``, ``"dwaa"``, ``"dwab"``, ``"htj2k256"`` or ``"htj2k32"``.
1544+
(``"htj2k256"`` and ``"htj2k32"`` are only supported with OpenEXR 3.4 or later.)
15451545
If the writer receives a request for a compression type it does not
15461546
recognize or is not supported by the version of OpenEXR on the
15471547
system, it will use ``"zip"`` by default. For ``"dwaa"`` and

src/openexr.imageio/exrinput.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,11 @@ OpenEXRInput::PartInfo::parse_header(OpenEXRInput* in,
431431
case Imf::B44A_COMPRESSION: comp = "b44a"; break;
432432
case Imf::DWAA_COMPRESSION: comp = "dwaa"; break;
433433
case Imf::DWAB_COMPRESSION: comp = "dwab"; break;
434-
#ifdef IMF_HTJ2K_COMPRESSION
435-
case Imf::HTJ2K_COMPRESSION: comp = "htj2k"; break;
434+
#ifdef IMF_HTJ2K256_COMPRESSION
435+
case EXR_COMPRESSION_HTJ2K256: comp = "htj2k256"; break;
436+
#endif
437+
#ifdef IMF_HTJ2K32_COMPRESSION
438+
case EXR_COMPRESSION_HTJ2K32: comp = "htj2k32"; break;
436439
#endif
437440
default: break;
438441
}

src/openexr.imageio/exrinput_c.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,11 @@ OpenEXRCoreInput::PartInfo::parse_header(OpenEXRCoreInput* in,
568568
case EXR_COMPRESSION_B44A: comp = "b44a"; break;
569569
case EXR_COMPRESSION_DWAA: comp = "dwaa"; break;
570570
case EXR_COMPRESSION_DWAB: comp = "dwab"; break;
571-
#ifdef IMF_HTJ2K_COMPRESSION
572-
case EXR_COMPRESSION_HTJ2K: comp = "htj2k"; break;
571+
#ifdef IMF_HTJ2K256_COMPRESSION
572+
case EXR_COMPRESSION_HTJ2K256: comp = "htj2k256"; break;
573+
#endif
574+
#ifdef IMF_HTJ2K32_COMPRESSION
575+
case EXR_COMPRESSION_HTJ2K32: comp = "htj2k32"; break;
573576
#endif
574577
default: break;
575578
}

src/openexr.imageio/exroutput.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -961,9 +961,13 @@ OpenEXROutput::put_parameter(const std::string& name, TypeDesc type,
961961
header.compression() = Imf::DWAA_COMPRESSION;
962962
else if (Strutil::iequals(str, "dwab"))
963963
header.compression() = Imf::DWAB_COMPRESSION;
964-
#ifdef IMF_HTJ2K_COMPRESSION
965-
else if (Strutil::iequals(str, "htj2k"))
966-
header.compression() = Imf::HTJ2K_COMPRESSION;
964+
#ifdef IMF_HTJ2K256_COMPRESSION
965+
else if (Strutil::iequals(str, "htj2k256"))
966+
header.compression() = Imf::HTJ2K256_COMPRESSION;
967+
#endif
968+
#ifdef IMF_HTJ2K32_COMPRESSION
969+
else if (Strutil::iequals(str, "htj2k32"))
970+
header.compression() = Imf::HTJ2K32_COMPRESSION;
967971
#endif
968972
}
969973
return true;

0 commit comments

Comments
 (0)