src/Helper/ToolboxFile.php
private function resizeImage($fileName)
    {
        list($width, $height, $mode) = $this->getResizeImages();
        if ($this->getShowImages() && ($width || $height || $mode)) {
            if ($this->imageFactory) {
                $image = $this->imageFactory->create(
                    $this->rootDir . '/' . $fileName,
                    [$width, $height, $mode]
                );

                return $image->getUrl($this->rootDir);
            }

            $event = new ResizeImageEvent($fileName, $width, $height, $mode);
            $this->dispatcher->dispatch(ContaoEvents::IMAGE_RESIZE, $event);
            return $event->getResultImage();
        }

        return $fileName;
    }
private function resizeImage($fileName)
    {
        list($width, $height, $mode) = $this->getResizeImages();
        if ($this->getShowImages() && ($width || $height || $mode)) {
            if ($this->imageFactory) {
                $image = $this->imageFactory->create(
                    $this->rootDir . '/' . $fileName,
                    [$width, $height, $mode]
                );

                return $image->getUrl($this->rootDir);
            }

            $event = new ResizeImageEvent($fileName, $width, $height, $mode);
            $this->dispatcher->dispatch(ContaoEvents::IMAGE_RESIZE, $event);
            return $event->getResultImage();
        }

        return $fileName;
    }
Resize the image if needed.

@param string $fileName The file to resize.

@return null|string