Write AVIF image generation script

This commit is contained in:
Christoph Hagen
2025-01-06 10:08:50 +01:00
parent 301dbad0a5
commit 6c1b473ab8
5 changed files with 27 additions and 8 deletions

View File

@ -38,8 +38,20 @@ final class ImageGenerator {
private var avifCommands: Set<String> = []
func printAvifCommands() {
avifCommands.sorted().forEach { print($0) }
/**
Write a file to the output folder containing a script to generate all missing AVIF images.
- Note: AVIF images could be generated internally, but the process is very slow.
*/
func writeAvifCommandScript() {
guard !avifCommands.isEmpty else {
if storage.hasFileInOutputFolder("generate-images.sh") {
storage.deleteInOutputFolder("generate-images.sh")
}
return
}
let content = avifCommands.sorted().joined(separator: "\n")
storage.write(content, to: "generate-images.sh")
}
/**