Skip to content

Commit

Permalink
Prevent call of deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
lochmueller committed May 18, 2015
1 parent 3d28c7d commit 9bd2a5d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Classes/Xclass/ContentObjectRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace FRUIT\FlRealurlImage\Xclass;

use FRUIT\FlRealurlImage\RealUrlImage;
use TYPO3\CMS\Core\Imaging\GraphicalFunctions;
use TYPO3\CMS\Core\Utility\GeneralUtility;

/**
Expand Down Expand Up @@ -56,7 +57,15 @@ function cImage($file, $conf) {

if (is_array($info)) {
if (is_file(PATH_site . $info['3'])) {
$source = GeneralUtility::rawUrlEncodeFP(GeneralUtility::png_to_gif_by_imagemagick($info[3]));
$graphicalFunctionsClass = 'TYPO3\\CMS\\Core\\Imaging\\GraphicalFunctions';
if (class_exists($graphicalFunctionsClass) && method_exists($graphicalFunctionsClass, 'pngToGifByImagemagick')) {
// modern
$return = GraphicalFunctions::pngToGifByImagemagick($info[3]);
} else {
// deprecated
$return = GeneralUtility::png_to_gif_by_imagemagick($info[3]);
}
$source = GeneralUtility::rawUrlEncodeFP($return);
$source = $GLOBALS['TSFE']->absRefPrefix . $source;
} else {
$source = $info[3];
Expand Down

0 comments on commit 9bd2a5d

Please sign in to comment.