我正在将图像上传到 s3 服务器并通过 php 我在服务器上制作该图像的副本,如果我上传 2.3 mb 的图像而不是图像的宽度,但如果我上传的图像比它显示的 26kb 更小图像的宽度,以便能够创建副本。
这是我的 php 代码:
$s3 = new S3(awsAccessKey, awsSecretKey);
$thumbId = uniqid();
$thumbId .= ".jpg";
$img = '';
if($imgType == "image/jpeg"){
$img = imagecreatefromjpeg($sourceUrl);
}else if($imgType == "image/png"){
$img = imagecreatefrompng($sourceUrl);
}else if($imgType == "image/gif"){
$img = imagecreatefromgif($sourceUrl);
}else{
$img = imagejpeg($sourceUrl);
}
echo $width = imagesx( $img );
echo $height = imagesy( $img );
请告诉我图像大小有什么问题..
问候
拉胡尔