Gregwar / Image

A PHP library to handle images
MIT License
1k stars 190 forks source link

multiple resizes after each other without downloading the image again #93

Open athingortwo opened 8 years ago

athingortwo commented 8 years ago

I'm resizing images from an xml feed in multiple formats (like 100px, 300px, 1200px). The original image is not first saved to the local harddisk. The resized images are also not stored on a local harddisk.

$newimage = Image::open($source_url) ->resize(100, 100) ->get($type = 'jpg', $quality = 100); [code to save $newimage]

$newimage = Image::open($source_url) ->resize(300, 300) ->get($type = 'jpg', $quality = 100); [code to save $newimage]

$newimage = Image::open($source_url) ->resize(1200, 1200) ->get($type = 'jpg', $quality = 100); [code to save $newimage]

It will now (as far as i understand) download the $source_url 3 times instead of 1. Not that efficient.

Is this possible to add?