1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Animated Image scaling bug

Discussion in 'XenForo Questions and Support' started by Visteras, Jul 24, 2013.

  1. Visteras

    Visteras Member

  2. Jeremy

    Jeremy Well-Known Member

    This is a bug in the ImageMagick or GD (I'm not sure which one you are using) and not XenForo. What image processor are you using?
  3. Visteras

    Visteras Member

    I use the GD. ImageMagick not installed.
    If you are sure that the case in the library then I apologize. Not even think to check it.
    Be sure to check ImageMagick, thank you for your help.
  4. Visteras

    Visteras Member

    ImageMagick library must use an extra key when working with GIF images.
    See below:
    function imageapi_imagemagick_image_resize(&$image$width$height) {

    $extra '';
    $image->info['mime_type'] == 'image/gif') {
    $extra '-coalesce ';
    $image->ops[] = $extra '-resize '. (int) $width .'x'. (int) $height .'!';
    $image->info['width'] = $width;
    $image->info['height'] = $height;
    Note: This code is used in the system Drupal
    I did not find this in the code XenForo.
    Also, when operating with the library is converting animated GIF to IMG, which as I understand it should not be.

    P.S. Sorry for my bad english :)
  5. Mike

    Mike XenForo Developer Staff Member

    That code isn't relevant. We don't use ImageMagick via the command line.
  6. Visteras

    Visteras Member

    How's that option?
    $image = new Imagick('myfile.gif');
    $image $image->coalesceimages();

    $final = new \Imagick();
    foreach (
    $image as $frame){
    $geometry $image->getImageGeometry();
    $x = ( $width $geometry['width'] ) / 2;
    $y = ( $height $geometry['height'] ) / 2;
    $canvas = new \Imagick();
    $canvas->compositeImage$image, \Imagick::COMPOSITE_OVER$x$y );
    $final $final->optimizedImageLayers();

Share This Page