개발! 딱 깔끔하고 센스있게!

이미지 높이 및 너비 PHP 얻기 본문

개발 스크랩 메모/PHP

이미지 높이 및 너비 PHP 얻기

렉사이 2020. 12. 19. 02:36

안녕하세요, 영상 올리는 비행 높이와 너비가 필요합니다.

이것은 내가 사용하고 있는 php 함수지만, 그것은 어떤 너비와 높이를 되돌리지 않는다.

저를 좀 도와주시겠습니까?

list($width, $height, $type, $attr) = getimagesize($_FILES["Artwork"]); $min_width = "1000"; $min_height = "1000"; if ((($_FILES["Artwork"]["type"] == "image/gif") || ($_FILES["Artwork"]["type"] == "image/jpeg") || ($_FILES["Artwork"]["type"] == "image/jpg") || ($_FILES["Artwork"]["type"] == "image/pjpeg")) && ($_FILES["Artwork"]["size"] < 20000000) && ($width > $min_width) && ($height > $min_height) && ($width == $height)) { if ($_FILES["Artwork"]["error"] > 0) { //echo "Return Code: " . $_FILES["Artwork"]["error"] . "
"; }else{ move_uploaded_file($_FILES["Artwork"]["tmp_name"], $path_image . $imageName); header("Location: http://pitchmystuff.co.uk/m/digidist/tracks/".$idAlbum.""); } }else{ //echo "invalid file"; echo ''; }

대답

아마

list($width, $height, $type, $attr) = getimagesize($_FILES["Artwork"]['tmp_name']); 

http:www.php.net /manual /en /features.file -upload.post -method.php

Comments