2021.04.16 17:46 "[Tiff] tiffcp: LERC codec options refer to zstd even if zstd support is not present", by Miguel Medalha

2021.04.16 17:46 "[Tiff] tiffcp: LERC codec options refer to zstd even if zstd support is not present", by Miguel Medalha

In tiffcp, the lerc help text proposes zstd compression options even if zstd support is not present. In order to keep consistency with the other codecs, this would need something like the following modification to 'tiffcp.c':

#ifdef LERC_SUPPORT
" -c lerc[:opts]  compress output with LERC encoding\n"
/* "    LERC options:", */
"    #            set max_z_error value\n"
"    p#           set compression level (preset)\n"
  #ifdef ZSTD_SUPPORT
    "    s#           set subcodec: 0=none, 1=deflate, 2=zstd (default 0)\n"
    "    For example, -c lerc:0.5:s2:p22 for max_z_error 0.5,\n"
    "    zstd additional compression with maximum compression level.\n"
  else
    "    s#           set subcodec: 0=none, 1=deflate (default 0)\n"
  #endif
#endif

(there was also a typo in "copression")

On the other hand, if zstd support was to be considered indispensable by the lerc proponents, the main 'CMakeLists.txt' file should be modified as follows:

if(ZSTD_SUPPORT)
  message(STATUS "  LERC support:                       Requested:${lerc} Availability:${LERC_FOUND} Support:${LERC_SUPPORT}")
else
  message(STATUS "  LERC support:                       Requested:${lerc} Availability:${LERC_FOUND} Support:${LERC_SUPPORT} (Depends on ZSTD Support)")
endif()

What say you? Which one would be more appropriate? On a first look, I suppose the first one, because zstd support is probably not mandatory for lerc.