forked from leftypol/leftypol
LibMagickMediaHandler.php: don't link or copy thumbnails if they're animated and the frames must be reduced.
This commit is contained in:
parent
f3db700201
commit
316ea636b0
1 changed files with 4 additions and 1 deletions
|
@ -380,7 +380,10 @@ class LibMagickMediaHandler implements MediaHandler {
|
|||
|
||||
$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);
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue