Bug #95379

Updated by Simon Schaufelberger over 2 years ago

I created a symfony command controller where I create images with the GIFBUILDER but this fails as on cli mode the file paths can't be resolved properly. 

 What I do basically is to copy the code from the ImageViewHelper and use it in my command: 

 I inject the ImageService and then do the processing like this: 

 <pre><code class="php"> 
 $image = $this->imageService->getImage($src, null, true); 
 $processingInstructions = [ 
     'width' => 400, 
     'height' => 300, 
 $processedImage = $this->imageService->applyProcessingInstructions($image, $processingInstructions); 

 In order to get a correct $processedImage file path, the core needs to work with absolute file paths. paths always.