Skip to content

Commit

Permalink
if heif-enc is given list of filenames and last one is a HEIF filenam…
Browse files Browse the repository at this point in the history
…e, use that as output filename
  • Loading branch information
farindk committed Oct 14, 2023
1 parent 6a8b586 commit 3130d8c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/heif_enc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,16 @@ int main(int argc, char** argv)
}


// If we were given a list of filenames and no '-o' option, check whether the last filename is the desired output filename.

if (output_filename.empty() && argc>1) {
if (guess_compression_format_from_filename(argv[argc-1]) != heif_compression_undefined) {
output_filename = argv[argc-1];
argc--;
}
}


// --- determine output compression format (from output filename or command line parameter)

heif_compression_format compressionFormat;
Expand Down

0 comments on commit 3130d8c

Please sign in to comment.