Commit a11b85be for libheif
commit a11b85bed799356bf9f276a09fd093029930253a
Author: Dirk Farin <dirk.farin@gmail.com>
Date: Mon Jan 12 21:04:45 2026 +0100
heif-enc: when no '-o' option is given, use last filename as output (#1663)
diff --git a/examples/heif_enc.cc b/examples/heif_enc.cc
index a1599e3a..6e8cdcda 100644
--- a/examples/heif_enc.cc
+++ b/examples/heif_enc.cc
@@ -1733,6 +1733,15 @@ int main(int argc, char** argv)
}
+ // If we get a list of image filenames, but no '-o' option, assume that the last option
+ // denotes the output filename.
+
+ if (output_filename.empty() && args.size() > 1) {
+ output_filename = args.back();
+ args.pop_back();
+ }
+
+
if (!lossless) {
heif_encoder_set_lossy_quality(encoder, quality);
}