Skip to content

Resizing some gifs results in missing frames #1380

@GuySartorelli

Description

@GuySartorelli

Describe the bug

https://i.pinimg.com/originals/60/5f/6a/605f6ab7beccce2cb2083f97d013445a.gif

Resizing the above linked gif results in an image that is missing several frames, as seen in the "Images" section below.

Code Example

<?php

$autoload = 'vendor/autoload.php';
if (!file_exists($autoload)) {
    echo 'autoload file is missing - make sure you ran `composer install`.' . PHP_EOL;
    exit(1);
}
include_once $autoload;

use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Imagick\Driver;

// create new manager instance with desired driver
$manager = new ImageManager(new Driver());

// read image from filesystem
$image = $manager->read('605f6ab7beccce2cb2083f97d013445a.gif');

// scale and save result
$image->scale(300)->save('resizedimage.gif');

Expected behavior

The result of the resize should be a gif of the correct size with no missing frames.

Images

resizedimage

Environment (please complete the following information):

  • PHP Version: Only tested with 8.2
  • OS: Ubuntu 22.04
  • Intervention Image Version: Only tested with 3.7.2
  • GD or Imagick: Only tested with Imagick

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions