LiipImagineBundle icon indicating copy to clipboard operation
LiipImagineBundle copied to clipboard

Support never reading in the file

Open simon-tma opened this issue 6 years ago • 0 comments

Is your feature request related to a problem? Please describe. When processing large images, they can cause PHP to run out of memory as the image file is read in as a binary string.

Describe the solution you'd like When using entirely external commands (e.g. imagick, pngquant, etc), never read the file into memory but work exclusively with temp files.

Basically, I'd like

    $binary = new FileBinary($file->getRealPath(), $type, $ext);
    $newBin = $this->filterManager->applyFilter($binary, 'prepare');

to have $newBin be another FileBinary. This could also be extended to the media/cache endpoint, allowing for its FlySystem integration to use ->writeStream when uploading.

simon-tma avatar May 28 '19 00:05 simon-tma