I was working on issue #957 to allow Piwigo to use External ImageMagick even if GD is not installed.
I modified admin/include/image.class.php by removing condition $extension != 'gif'.
Then I added at line 522:
if ('gif' == strtolower(get_extension($source_filepath)))
{
$command .= '[0]';
}
This instruction is to select the first frame of the gif to get the right dimension.
Then at the file admin/include/photos_add_direct_prepare.inc.php, I put in comments : $setup_errors[] = l10n('GD library is missing');
This is working perfectly. But a another problem comes when the bootstrap theme tries to crop and resize the gif.
I found some commands to crop and resize correctly:
Some gifs can be heavy so we should try to reduce there weight (Gifsicle is better for reducing weight).
I was working on issue #957 to allow Piwigo to use External ImageMagick even if GD is not installed.
I modified `admin/include/image.class.php` by removing condition `$extension != 'gif'`.
Then I added at line 522:
```
if ('gif' == strtolower(get_extension($source_filepath)))
{
$command .= '[0]';
}
```
This instruction is to select the first frame of the gif to get the right dimension.
Then at the file `admin/include/photos_add_direct_prepare.inc.php`, I put in comments : `$setup_errors[] = l10n('GD library is missing');`
This is working perfectly. But a another problem comes when the bootstrap theme tries to crop and resize the gif.
I found some commands to crop and resize correctly:
`convert example.gif -coalesce -repage 0x0 -crop widthxheight +x+y +repage -resize 260x179! example.gif`
We can also use gifsicle to do the job :
`gifsicle --crop x,y+widthxheight --resize-fit 260x179 example.gif > example_cropped.gif
`
Some gifs can be heavy so we should try to reduce there weight (Gifsicle is better for reducing weight).
<!-- github-sync-id:408112018 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I was working on issue #957 to allow Piwigo to use External ImageMagick even if GD is not installed.
I modified
admin/include/image.class.phpby removing condition$extension != 'gif'.Then I added at line 522:
This instruction is to select the first frame of the gif to get the right dimension.
Then at the file
admin/include/photos_add_direct_prepare.inc.php, I put in comments :$setup_errors[] = l10n('GD library is missing');This is working perfectly. But a another problem comes when the bootstrap theme tries to crop and resize the gif.
I found some commands to crop and resize correctly:
convert example.gif -coalesce -repage 0x0 -crop widthxheight +x+y +repage -resize 260x179! example.gifWe can also use gifsicle to do the job :
gifsicle --crop x,y+widthxheight --resize-fit 260x179 example.gif > example_cropped.gifSome gifs can be heavy so we should try to reduce there weight (Gifsicle is better for reducing weight).