Issue Bug Closed

#80690Install-Tool testsetup uses deprecated function tempPath() for combine image and gdlib

Hannes Strangmeier 04/05/17, 14:20 updated 10/02/18, 11:00

Description

Hi,

it seems as if the combine-image and gdlib tests in the installtool use the deprecated function tempPath.
This happens in typo3/sysext/install/Classes/Controller/Action/Tool/TestSetup.php

In the initializeImageProcessor() absPrefix was introduced (line 659) and thereby replaced tempPath:

$imageProcessor->absPrefix = PATH_site;

instead of

$imageProcessor->tempPath = PATH_site . 'typo3temp/';

But in getImagesPath() (line 704) tempPath is still used. This leads to an incomplete Path for example for combineImages() where $resultfile() is still based on getImagesPath (thereby using tempPath):

$resultFile = $this->getImagesPath($imageProcessor) . $imageProcessor->filenamePrefix
. StringUtility::getUniqueId($imageProcessor->alternativeOutputKey . 'combine1') . '.jpg';

The executed gm/convert-Commands now try to create files outsite of PATH_site, because it is no longer part of the created Path.

To make it a bit more understandable (since i am not a developer):

The test for Combine Images in the Install-Tool now creates such a command:

'/usr/local/bin/gm' 'convert' +profile '*' -colorspace GRAY +matte '/my/path/site/typo3/sysext/install/Resources/Public/Images/TestInput/MaskBlackWhite.gif[0]' 'typo3temp/var/transient/23faa83fe8fd5311e55d581a578e503a.png'

Before it would create a correct destination path like this:

‘/usr/local/bin/gm’ ‘convert’ +profile ‘*’ -colorspace GRAY +matte ‘/my/path/site/typo3/sysext/install/Resources/Public/Images/TestInput/MaskBlackWhite.gif0‘ ‘/my/path/site/typo3temp/var/transient/23faa83fe8fd5311e55d581a578e503a.png’

I would assume that the intended behaviour is to use absPrefix in $resultFile to determine the correct path for the destination file (combined with typo3temp and the filenamePrefix etc.)

gdlib() uses the same thing for $outputFile which leads to a similar behaviour.

imageMagickConvert() seems not be affected, thereby scaling etc. works.

Cheers,
Hannes

Reviews 2