Changeset 16242


Ignore:
Timestamp:
Jul 1, 2012, 6:18:34 AM (12 years ago)
Author:
rvelices
Message:

bug 2672: invalid option sampling-factor for old versions of ImageMagick (use it for new versions) merge from trunk to branch 2.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4/admin/include/image.class.php

    r16210 r16242  
    5959  var $library = '';
    6060  var $source_filepath = '';
     61  static $ext_imagick_version = '';
    6162
    6263  function __construct($source_filepath, $library=null)
     
    340341    if (is_array($returnarray) and !empty($returnarray[0]) and preg_match('/ImageMagick/i', $returnarray[0]))
    341342    {
     343      if (preg_match('/Version: ImageMagick (\d+\.\d+\.\d+-?\d*)/', $returnarray[0], $match))
     344      {
     345        self::$ext_imagick_version = $match[1];
     346      }
    342347      return true;
    343348    }
     
    447452  {
    448453    $this->image->setInterlaceScheme(Imagick::INTERLACE_LINE);
    449    
     454
    450455    // TODO need to explain this condition
    451456    if ($this->get_width()%2 == 0
     
    614619    // option
    615620    //
    616     // $this->add_command('sampling-factor', '4:2:2' );
     621    if (version_compare(pwg_image::$ext_imagick_version, '6.6') > 0)
     622    {
     623      $this->add_command('sampling-factor', '4:2:2' );
     624    }
    617625
    618626    $exec = $this->imagickdir.'convert';
Note: See TracChangeset for help on using the changeset viewer.