Home > Backend Development > PHP Tutorial > How to keep the gif dynamic when cropping a gif image using ci.

How to keep the gif dynamic when cropping a gif image using ci.

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-09-25 09:37:02
Original
1630 people have browsed it

<code>    $config['image_library'] = 'gd2';
    $config['source_image'] = 'upload/ali.gif';
    $config['create_thumb'] = TRUE;
    $config['maintain_ratio'] = TRUE;
    $config['width'] = 75;
    $config['height'] = 50;

    $this->load->library('image_lib', $config);

    $this->image_lib->resize();
    
    </code>
Copy after login
Copy after login

The original image is a dynamic gif image. After processing by the above program, the generated image is static. How can I stay dynamic, thank you.

Reply content:

<code>    $config['image_library'] = 'gd2';
    $config['source_image'] = 'upload/ali.gif';
    $config['create_thumb'] = TRUE;
    $config['maintain_ratio'] = TRUE;
    $config['width'] = 75;
    $config['height'] = 50;

    $this->load->library('image_lib', $config);

    $this->image_lib->resize();
    
    </code>
Copy after login
Copy after login

The original image is a dynamic gif image. After processing by the above program, the generated image is static. How can I stay dynamic, thank you.

Currently, the two major libraries for php processing images gd2 and imagick do not support cutting gif images (they will not be moved after processing), so the questioner should not forget to deal with this aspect,

Intervention/image

I specially tried this library

require './vendor/autoload.php';

use Intervention\Image\ImageManager;

$image = new ImageManager(array('driver' => 'imagick'));


$image = $image->make('/home/godruoyi/图片/5gyt521cv3v.gif');
$image->resize(500,300);

$image->save('/home/godruoyi/图片/5gyt521cv3v2222.gif');
Copy after login

Doesn’t support processing gifs while maintaining dynamic effects

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template