Skip to content

Commit

Permalink
heif: only use compression formats that are available in libheif release
Browse files Browse the repository at this point in the history
  • Loading branch information
bradh committed Dec 4, 2023
1 parent 18312a6 commit ad07518
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frmts/heif/heifdatasetcreatecopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,30 @@ static heif_compression_format getCompressionType(char **papszOptions)
{
return heif_compression_HEVC;
}
#if LIBHEIF_HAVE_VERSION(1, 7, 0)
if (strcmp(pszValue, "AV1") == 0)
{
return heif_compression_AV1;
}
#endif
#if LIBHEIF_HAVE_VERSION(1, 17, 0)
if (strcmp(pszValue, "JPEG") == 0)
{
return heif_compression_JPEG;
}
#endif
#if LIBHEIF_HAVE_VERSION(1, 17, 0)
if (strcmp(pszValue, "JPEG2000") == 0)
{
return heif_compression_JPEG2000;
}
#endif
#if LIBHEIF_HAVE_VERSION(1, 16, 0)
if (strcmp(pszValue, "UNCOMPRESSED") == 0)
{
return heif_compression_uncompressed;
}
#endif
CPLError(CE_Warning, CPLE_IllegalArg,
"CODEC=%s value not recognised, ignoring.", pszValue);
return heif_compression_HEVC;
Expand Down

0 comments on commit ad07518

Please sign in to comment.