如何在Laravel Framework中获取图像的宽度和高度? [英] How i get width and height of a image in Laravel Framework?

查看:978
本文介绍了如何在Laravel Framework中获取图像的宽度和高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这张图片中,

我可以在目录中获取图像的widthheight.

I can get the width and height of the image in the directory.

但是我想在上传图片之前获取图片的宽度和高度.

But i want to get the width and height of a picture before i upload the image.

我该如何实现?

推荐答案

 $data = getimagesize($filename);
 $width = $data[0];
 $height = $data[1];

这篇关于如何在Laravel Framework中获取图像的宽度和高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆