WebChemistry / images

Image storage for Nette Framework
36 stars 20 forks source link

How to save stream #38

Closed vylink closed 5 years ago

vylink commented 5 years ago

Hi,

in some previous version was possible to use following code to store image from external source.

How can I achieve it with the current version, please?

$this->imageStorage->saveContent(file_get_contents('http://img.youtube.com/vi/' . $id . '/0.jpg'), $id.'.jpg', 'video');
MartkCz commented 5 years ago

in new commit

$resource = $imageStorage->save(new WebChemistry\Images\Resources\Transfer\StringContent(file_get_contents(...)));