Fileupload image dimension

Hi,

Can you help me please, how could I get fileupload’s image dimension.
I would like to make a grid-gallyery like: https://codepen.io/bootsified/pen/aqERqO

And I would like to setup to render portrait images in portrait mode, and landscape images in landscape mode.
But for that I need to know image’s dimensions.

How could I get those?

Thank you,
Zs

Hi @ngyzsolt,

one of gallery plugins that I’m using is requiring the image dimensions as well.
In my case, I am counting it dynamically in page cycle with PHP getimagesize() function and adding it to fileupload object:

function onEnd() {
    foreach($this->gallery as $i => $image) {
        $path = storage_path('app/uploads/'.$image->getDiskPath());
        list($width, $height) = getimagesize($path);
        $image->width = $width;
        $image->height = $height;
    }
}
1 Like