tja
July 12, 2021, 3:49pm
1
Is there a way to resize an image with an external url? When I try to do the following:
<?php $image = "https://images.unsplash.com/photo-1506744038136-46273834b3fb?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=3150&q=80" ?>
<img src="<?= $image->resize(200)?>"/>
I of course get Call to a member function resize() on string
Probably need to get hold of it with F::read and store it locally, then youll be able to pick it up and turn into a file object
Or you would have to go the virtual files route: Virtual files | Kirby CMS
tja
July 12, 2021, 4:47pm
4
Thank you both for your suggestions. In your option, what would be easier in this case? I only want to resize the image, not much else.
tja
July 12, 2021, 5:04pm
6
Well on second thought it might be more complicated. I would like to resize images from an RSS-Feed. I have a model that creates virtual pages and the RSS-Feed contains images that are very large.