The absolute
argument for the f:uri.image
view helper was added only recently in TYPO3 7.6.0. See the changelog:
Feature: #64286 - Added absolute url option to uri.image and image viewHelper
The ImageViewhelper and Uri/ImageViewHelper got a new option absolute. With this option you are able to force the ViewHelpers to output an absolute url.
I'd suggest upgrading to TYPO3 7.6.
If that's not possible for you for any reason, you can extend the f:uri.image
view helper. The code below is untested, but should work for 6.2 LTS (I've borrowed parts of the code from TYPO3\CMS\Extbase\Service\ImageService
in 7.6):
namespace Vendor\ExtensionKey\ViewHelpers\Uri;
use TYPO3\CMS\Fluid\ViewHelpers\Uri\ImageViewHelper;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class ImageViewHelper extends ImageViewHelper
{
public function render(
$src = null,
$image = null,
$width = null,
$height = null,
$minWidth = null,
$minHeight = null,
$maxWidth = null,
$maxHeight = null,
$treatIdAsReference = false,
$absolute = false
) {
$uri = parent::render($src, $image, $width, $height, $minWidth, $minHeight, $maxWidth, $maxHeight, $treatIdAsReference);
if ($absolute) {
$uriPrefix = $GLOBALS['TSFE']->absRefPrefix;
$uri = GeneralUtility::locationHeaderUrl($uriPrefix . $uri);
}
return $uri;
}
}