最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

images - Can a thumbnail of an animated gif be animated?

programmeradmin3浏览0评论

I have an animated gif I want to show in two places, having two different sizes.

I am creating two sizes in my functions.php, using

add_image_size( 'small-feature', 500, 300 );
add_image_size( 'gallery-thumb', 120, 9999 );

If the uploaded file is 500 x 300 px, it will keep the animation, as it no resizing happens. If the image is to be resized, the animation is lost.

Is there a way I can resize these images and still keep the animation in the original .gif file?

I have an animated gif I want to show in two places, having two different sizes.

I am creating two sizes in my functions.php, using

add_image_size( 'small-feature', 500, 300 );
add_image_size( 'gallery-thumb', 120, 9999 );

If the uploaded file is 500 x 300 px, it will keep the animation, as it no resizing happens. If the image is to be resized, the animation is lost.

Is there a way I can resize these images and still keep the animation in the original .gif file?

Share Improve this question asked Jun 19, 2012 at 22:33 Fred RochaFred Rocha 2273 silver badges9 bronze badges 2
  • Please take a look at the resulting file format for the thumbnail. – kaiser Commented Sep 19, 2012 at 17:14
  • Yes! There's a plugin called EWWW Image Optimizer. When compressing animated GIFs and creating the thumbnails will retain the animation. Proof: Original Image. The animated 150x150 thumbnail. – Michael Rogers Commented Nov 15, 2020 at 12:06
Add a comment  | 

1 Answer 1

Reset to default 2

According to this stackoverflow question, there is a program called imagemagick that might do this for you server side but it would probably be outside of WordPress. Otherwise, it looks like you have to shrink every frame and then put it all back together.

发布评论

评论列表(0)

  1. 暂无评论