除非我弄错了,否则以明显的方式执行此操作会将文件下载两次.
$image = file_get_contents($location);
$checkImage = getimagesize($location);
Run Code Online (Sandbox Code Playgroud)
我想知道如何在不下载两次的情况下做到这一点.配售$image
里面get_image_size()
没有工作,所以我不知道该怎么做.我找到了我的tmp文件夹,但当我运行页面进行测试时,我没有看到任何显示在那里,所以我不知道该去哪里.如果我需要指定实际位置$image
(我认为这是我需要做的)我不知道如何找到它.
$binary_data = file_get_contents($location);
$im = imagecreatefromstring($binary_data);
$width = imagesx($im);
$height = imagesy($im);
Run Code Online (Sandbox Code Playgroud)
$image = file_get_contents($location);
$checkImage = getimagesizefromstring($image);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2970 次 |
最近记录: |