Hi,
This might be simple, but it’s not very clear to me yet:
I’m resizing an image only by a given width value (set in the config options) to keep its aspect ratio.
I also want to insert the dimensions of the resized image to the data-attribute of the img tag.
Currently I’m doing it like this:
$img_resize = $image->resize(option('imgs.medium'));
<img src="<?= $img_resize->url() ?>" data-dimension="<?= $img_resize->width() . 'x' . $img_resize->height() ?>">
Is this the most performant way to get the dimensions of the new image or does this code resize the image 3 times?