LibMagickMediaHandler.php: don't link or copy thumbnails if they're animated and the frames must be reduced.

This commit is contained in:
Zankaria 2025-03-28 14:59:53 +01:00
parent f3db700201
commit 316ea636b0

View file

@ -380,7 +380,10 @@ class LibMagickMediaHandler implements MediaHandler {
$this->move_or_link_or_copy($media_file_kind, $media_file_path, $media_out_path); $this->move_or_link_or_copy($media_file_kind, $media_file_path, $media_out_path);
if ($width <= $thumb_max_width && $height >= $thumb_max_height) { if (
$width <= $thumb_max_width && $height <= $thumb_max_height
&& !(self::mimeSupportAnimation($media_file_mime) && $this->frames_for_animated_thumbs !== self::THUMB_KEEP_FRAMES_ALL)
) {
$thumb_out_path = $thumb_preferred_out_file_basepath . '.' . Metadata\mime_to_ext($media_file_mime); $thumb_out_path = $thumb_preferred_out_file_basepath . '.' . Metadata\mime_to_ext($media_file_mime);
if (!Fs\link_or_copy($media_out_path, $thumb_out_path)) { if (!Fs\link_or_copy($media_out_path, $thumb_out_path)) {
throw new MediaException("Could not link or copy '$media_out_path' to '$thumb_out_path'", MediaException::ERR_IO_ERR); throw new MediaException("Could not link or copy '$media_out_path' to '$thumb_out_path'", MediaException::ERR_IO_ERR);