摘要:
只针对限定1M $data = file_get_contents("输入路径"); $maxSize = 1 * 1024 * 1024; //图片进行压缩 $data = compressImage($data, $maxSize); file_put_contents("输出路径", $dat 阅读全文
摘要:
将图片压缩成jpg或png $type = explode('/', $file->type); $mainType = $type[0]; $subType = $type[1]; $isImage = $mainType == 'image'; $isGif = $subType == 'gif 阅读全文