commit aa65808961caa4410f8658c60d4f5d46ce1e9291 parent 24b0c6c07cb23eb97f4acfa82403a627ca68bc2e Author: Felicitus <felicitus@felicitus.org> Date: Sat, 31 Oct 2015 16:27:42 +0100 Download the file to the cache dir first before attempting to do image manipulations Diffstat:
M | src/PartKeepr/ImageBundle/Controller/ImageController.php | | | 8 | +++++++- |
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/PartKeepr/ImageBundle/Controller/ImageController.php b/src/PartKeepr/ImageBundle/Controller/ImageController.php @@ -120,7 +120,13 @@ abstract class ImageController extends FileController } $imagine = new Imagine(); - $imagine->open($this->getFilename($image)) + + $localCacheFile = $this->getImageCacheDirectory() . $image->getFullFilename(); + $storage = $this->get("partkeepr_uploadedfile_service")->getStorage($image); + + file_put_contents($localCacheFile, $storage->read($image->getFullFilename())); + + $imagine->open($localCacheFile) ->thumbnail(new Box($width, $height)) ->save($outputFile);