From c734db91064944637e361f90ed90b30d48a7d910 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Tue, 24 Jun 2025 22:35:29 +0500 Subject: feat: flash (.swf) support --- lib/thumbnails.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/thumbnails.php') diff --git a/lib/thumbnails.php b/lib/thumbnails.php index 5afc775..5e99087 100644 --- a/lib/thumbnails.php +++ b/lib/thumbnails.php @@ -10,7 +10,15 @@ function generate_image_thumbnail(string $src_path, string $dst_path, int $width $result_code = null; - exec(command: "magick $input_path -resize {$width}x{$height} -loop 0 $output_path", result_code: $result_code); + if (str_ends_with($src_path, ".swf")) { + exec(command: "swfrender $input_path -o $output_path", result_code: $result_code); + if ($result_code != 0) { + return $result_code; + } + exec(command: "magick $output_path -resize {$width}x{$height} -loop 0 $output_path", result_code: $result_code); + } else { + exec(command: "magick $input_path -resize {$width}x{$height} -loop 0 $output_path", result_code: $result_code); + } return $result_code; } -- cgit v1.2.3