Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-16022

eZImageShellHandler : shell string parameters order

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.2.1, 4.3.0alpha1
    • Labels:
      None
    • Environment:

      Operating System: Ubuntu
      PHP Version: 5.5.2
      Database and version: MySQL 5.0.60
      Browser (and version): N/A

      Description

      It seems that the shell string parameters order in the command line built by lib/ezimage/classes/ezimageshellhandler.php is wrong with ImageMagick ( 6.4.4 installed on our server ).

      Example of a shell string generated by eZImageShellHandler :

      /usr/bin/convert [options] 'source.jpg' 'JPEG:destination.jpg'

      When using the filter shown in the "Steps to reproduce", this command line doesn't work.

      It must be :

      /usr/bin/convert 'source.jpg' [options] 'JPEG:destination.jpg'

      So, you have to :

      move this line ( 111 )

      $argumentList[] = eZSys::escapeShellArgument( $sourceMimeData['url'] );

      after this line ( 78 )

      $argumentList[] = $executable;

      in lib/ezimage/classes/ezimageshellhandler.php.

      With this change, the command line works.

      I don't know if this is a bug or an ImageMagick specific case...

      Steps to reproduce

      1. Create a new filter and a new alias in image.ini.append.php :

      [ImageMagick]
      Filters[]=geometry/scaleexactwithbackgroundcolor=-resize %1x%2> -size %1x%2 xc:#%3 +swap -gravity center -composite

      [AliasSettings]
      AliasList[]=my_image

      [my_image]
      Reference=reference
      Filters[]=geometry/scaleexactwithbackgroundcolor=400;100;00FF00

      2. Create a class with an image attribute

      3. Create a new object

      4. In a template, display this image using the my_image alias. This doesn't work : the command line built by the convert function of eZImageShellHandler class is wrong : the source file is at the end of the command line ( before the destination file ) instead of being at the beginning

        Attachments

          Activity

            People

            • Assignee:
              patrick.allaert Patrick Allaert
              Reporter:
              gmasquelier Guillaume Masquelier
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: