I have some images stored in AWS S3, and I'm using the Storage facade in Laravel to display them on a web page.
In a few cases, I want to get the dimensions of some images and store those dimensions in a DB.
I was thinking of using the getimagesize function in PHP, but the images are not publicly available, and they can only be accessed via the Storage facade.
How can I get the dimensions of these images? Thank you.
Edit: I should mention that this image processing is all being done for a DB migration, so using a web front-end solution like JS to get the image dimensions is not practical.
I came up with a solution that seems to work. Basically, I get the binary of the file with the Storage facade, then use the
imagecreatefromstring,imagesxandimagesyfunctions to get the width and height of the image.Here's an example: