fix(back-end): img convert
All checks were successful
Build and Deploy / test-backend (push) Successful in 26s
Build and Deploy / test-frontend (push) Successful in 1m1s
Build and Deploy / build-and-push (push) Successful in 39s
Build and Deploy / deploy (push) Successful in 8s

This commit is contained in:
2026-03-09 20:04:21 +01:00
parent cd2666d8e2
commit 77d7bdb265
4 changed files with 103 additions and 3 deletions

View File

@@ -350,7 +350,27 @@ public class AdminMediaControllerService {
}
String extension = GENERATED_FORMAT_EXTENSIONS.get(format);
Path outputFile = generatedDirectory.resolve(preset.name() + "." + extension);
mediaFfmpegService.generateVariant(sourceFile, outputFile, dimensions.widthPx(), dimensions.heightPx(), format);
try {
mediaFfmpegService.generateVariant(
sourceFile,
outputFile,
dimensions.widthPx(),
dimensions.heightPx(),
format
);
} catch (IOException e) {
if (FORMAT_AVIF.equals(format)) {
skippedFormats.add(format);
logger.warn(
"Skipping AVIF variant generation for asset {} preset '{}' because FFmpeg AVIF generation failed: {}",
asset.getId(),
preset.name(),
e.getMessage()
);
continue;
}
throw e;
}
MediaVariant variant = new MediaVariant();
variant.setMediaAsset(asset);

View File

@@ -82,8 +82,6 @@ public class MediaFfmpegService {
case "AVIF" -> {
command.add("-c:v");
command.add(encoder);
command.add("-still-picture");
command.add("1");
command.add("-crf");
command.add("30");
command.add("-b:v");