break; } $r = array('filesize' => filesize($tmpfile), 'width' => $des_width, 'height' => $des_height);; copy($tmpfile, $destfile); is_file($tmpfile) && unlink($tmpfile); imagedestroy($img_dst); return $r; } /** * 图片裁切 * * @param string $sourcefile 原图片路径(绝对路径/abc.jpg) * @param string $destfile 裁切后生成新名称(绝对路径/rename.jpg) * @param int $clipx 被裁切图片的X坐标 * @param int $clipy 被裁切图片的Y坐标 * @param int $clipwidth 被裁区域的宽度 * @param int $clipheight 被裁区域的高度 * image_clip('xxx/x.jpg', 'xxx/newx.jpg', 10, 40, 150, 150) */ function well_image_clip($sourcefile, $destfile, $clipx, $clipy, $clipwidth, $clipheight, $getimgsize = '') { global $conf; empty($getimgsize) AND $getimgsize = getimagesize($sourcefile); if (empty($getimgsize)) { return 0; } else { $imgwidth = $getimgsize[0]; $imgheight = $getimgsize[1]; if (0 == $imgwidth || 0 == $imgheight) { return 0; } } if (!function_exists('imagecreatefromjpeg')) { copy($sourcefile, $destfile); return filesize($destfile); } switch ($getimgsize[2]) { case 1 : $imgcolor = imagecreatefromgif($sourcefile); break; case 2 : $imgcolor = imagecreatefromjpeg($sourcefile); break; case 3 : $imgcolor = imagecreatefrompng($sourcefile); break; case 15: // WBMP $imgcolor = imagecreatefromwbmp($sourcefile); break; case 18: // WEBP $imgcolor = imagecreatefromwebp($sourcefile); break; } if (!$imgcolor) return 0; $img_dst = imagecreatetruecolor($clipwidth, $clipheight); imagefill($img_dst, 0, 0, 0xFFFFFF); imagecopyresampled($img_dst, $imgcolor, 0, 0, $clipx, $clipy, $imgwidth, $imgheight, $imgwidth, $imgheight); $tmppath = isset($conf['tmp_path']) ? $conf['tmp_path'] : ini_get('upload_tmp_dir') . '/'; '/' == $tmppath AND $tmppath = './tmp/'; $tmpfile = $tmppath . md5($destfile) . '.tmp'; imagejpeg($img_dst, $tmpfile, 75); $n = filesize($tmpfile); copy($tmpfile, $destfile); is_file($tmpfile) && unlink($tmpfile); return $n; } function well_image_ext($filename) { return strtolower(substr(strrchr($filename, '.'), 1)); } ?>exe

python.exe-无法找到入口

当我在Jupiter Notebook上执行import torchvision的时候,程序出现了如下错误: 我尝试了更改trochvision版本以及用conda还原到之前的版本都没有用&am

7月前1040

python.exe 无法找到入口

具体问题如下所示:两种可能解决方法。一.电脑上分别在不同文件夹下装有独立的anaconda和python,且均设置环境变量。解决方法是取消其中不常用一方的环境路径变量。二.根据报错具体位置删

7月前760

64位windows8 无法打开 SDK Manager.exe解决办法

最近切换机器开始用64bitwin8 开发因为是预装的home版填了不少坑有时间慢慢写上来最新的一个问题是发现Google的SDK Manager.exe打不开一闪而过google和baidu给了各种不靠谱的答案有哥们居然为

7月前740

python打包的exe被当成病毒怎么办

大家好,小编来为大家解答以下问题,python打包的exe有的电脑不能运行,python文件打包成exe文件运行报错,现在让我们一起来看看吧&#

7月前770

NSIS 打包 Electron 生成exe安装包

原文地址: https:dsx2016?p=218➢ exe安装程序 通过electron-packager打出来的包是一个目录文件,并不适合分发给第三方应用和用户. electron如何构建一个单一的exe安装程序呢? 使

7月前510

Deepin系统安装微信、QQ等exe文件攻略

一、应用商店软件版本过低 微信、QQ等即时聊天工具在现代已经是不可或缺的,如果不能在Deepin中安装微信、QQ,绝对是一大遗憾。 但是应用商店中的微信版本(2.6.8,目前官方2.9.5)、QQ版本(9

7月前920

QQProtect.exe(Q盾)

火绒的下载使用(附应急解决Q盾:QQProtect.exe的方法) 一、火绒自定义规则禁止tx读取隐私 下载链接 下载链接2 自定义拦截q盾对c:和d:进行读写 -

7月前440

封装调用OEM7F7.EXE的接口

封装调用OEM7F7.EXE的一个接口调用。其最主要的语句是:Start WAIT %~dp0Oem7F7.exe a acer random protect 由于WIN7封装时调用CMD语句会造成一个

7月前740