[BUGFIX] Use last result line of identify command 76/28076/2
authorAlexander Stehlik <alexander.stehlik@googlemail.com>
Wed, 5 Mar 2014 13:48:07 +0000 (14:48 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Tue, 1 Apr 2014 20:14:45 +0000 (22:14 +0200)
In GraphicalFunctions::imageMagickIdentify() the last line returned by
the executed command will be used as result.

This prevents the system from using possible error messages printed
before the actual result for further processing.

Resolves: #56574
Releases: 6.2
Change-Id: Ic179e0b68c7fa9a4f0f4b2342cb381c54fb740b9
Reviewed-on: https://review.typo3.org/28076
Reviewed-by: Xavier Perseguers
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php

index 0963f31..586fe89 100644 (file)
@@ -2571,8 +2571,8 @@ class GraphicalFunctions {
                        $cmd = GeneralUtility::imageMagickCommand('identify', $this->wrapFileName($imagefile) . $frame);
                        $returnVal = array();
                        \TYPO3\CMS\Core\Utility\CommandUtility::exec($cmd, $returnVal);
-                       $splitstring = $returnVal[0];
-                       $this->IM_commands[] = array('identify', $cmd, $returnVal[0]);
+                       $splitstring = array_pop($returnVal);
+                       $this->IM_commands[] = array('identify', $cmd, $splitstring);
                        if ($splitstring) {
                                preg_match('/([^\\.]*)$/', $imagefile, $reg);
                                $splitinfo = explode(' ', $splitstring);