GD 함수중 이미지 크기 알아내는 함수 2가지
페이지 정보
작성자
본문
1. 외부 이미지파일을 내부 작업용 이미지 파일로 변환했을때
$logo_image = ImageCreateFromPNG("./img/test.png");
imagecopymerge($target_image, $logo_image, 0, 0, 0, 0, 200, 200, 30);
$temp_x = imageSX($temp_image);
$temp_y = imageSY($temp_image);
2. 외부 이미지 파일의 크기를 알고 싶을때
$image_path = "./img/logo.png";
list($width, $height, $type, $attr)= getimagesize($image_path);
echo $height;
echo $width;
$logo_image = ImageCreateFromPNG("./img/test.png");
imagecopymerge($target_image, $logo_image, 0, 0, 0, 0, 200, 200, 30);
$temp_x = imageSX($temp_image);
$temp_y = imageSY($temp_image);
2. 외부 이미지 파일의 크기를 알고 싶을때
$image_path = "./img/logo.png";
list($width, $height, $type, $attr)= getimagesize($image_path);
echo $height;
echo $width;
댓글목록
등록된 댓글이 없습니다.