
Warning: imagedestroy() expects parameter 1 to be resource
看错误提示应可能是 $rs_al["zp"] 空值或输出的路径不正确
if(empty ($rs_al["zp"])){
echo '空值!';
}elseif(!file_exists($rs_al["zp"])){
echo '文件不存在或路径不正确';
}else{
$thumb -> Createthumb($rs_al["zp"]);
}
出现这个提示情况是:Windows Xp 系统; 软件包括:window live writer 2009, windows messenger 2009, firefox 35 等非常新的版本。这个提示出现后,点击确定,并不影响程序的使用。这个问题出现的原因,其实微软自己的问题。可谓是微软的Vista 后遗症吧。在 Vista 系统里,有个挺酷的功能,就是“程序缩略图”,有点3D效果,这个功能,调用了 dwmapidll 这个库,而 dwmapidll 又引用了 msvcrtdll 中的 _except_handler4_common 功能。然而,在XP系统中,系统自带的 msvcrtdll 和 Vista 中的 msvcrtdll 版本不同, 并没有这个 _except_handler4_common ,结果就出现了启动程序时,遇到的 “无法定位程序输入点_except_handler4_common于动态链接库msvcrtdll上”的错误提示。解决方法: 将 c:\windows\system32 下的 dwmapidll 改名,例如:改为 dwmapidllbak。更改后,可以直接打开ps,省去运行时间!更改后dwmapidll数据库文件属性会改变,图标会变成未知应用程序文件,不必惊慌,根本就不用管它。收集自网络:无法定位程序输入点_except_handler4_common于动态链接库msvcrtdll上解决方式如下:这是由于sp3加载的驱动造成的;只需要将C:\WINDOWS\system32\dwmapidll重新命名一下即可以解决。
<php
/构造函数-生成缩略图+水印,参数说明:
$srcFile-文件名,
$dstFile-另存文件名,
$markwords-水印文字,
$markimage-水印,
$dstW-保存宽度,
$dstH-保存高度,
$rate-保存品质/
makethumb("ajpg","bjpg","50","50");
function makethumb($srcFile,$dstFile,$dstW,$dstH,$rate=100,$markwords=null,$markimage=null)
{
$data = GetImageSize($srcFile);
switch($data[2])
{
case 1:
$im=@ImageCreateFromGIF($srcFile);
break;
case 2:
$im=@ImageCreateFromJPEG($srcFile);
break;
case 3:
$im=@ImageCreateFromPNG($srcFile);
break;
}
if(!$im) return False;
$srcW=ImageSX($im);
$srcH=ImageSY($im);
$dstX=0;
$dstY=0;
if ($srcW$dstH>$srcH$dstW)
{
$fdstH = round($srcH$dstW/$srcW);
$dstY = floor(($dstH-$fdstH)/2);
$fdstW = $dstW;
}
else
{
$fdstW = round($srcW$dstH/$srcH);
$dstX = floor(($dstW-$fdstW)/2);
$fdstH = $dstH;
}
$ni=ImageCreateTrueColor($dstW,$dstH);
$dstX=($dstX<0)0:$dstX;
$dstY=($dstX<0)0:$dstY;
$dstX=($dstX>($dstW/2))floor($dstW/2):$dstX;
$dstY=($dstY>($dstH/2))floor($dstH/s):$dstY;
$white = ImageColorAllocate($ni,255,255,255);
$black = ImageColorAllocate($ni,0,0,0);
imagefilledrectangle($ni,0,0,$dstW,$dstH,$white);// 填充背景色
ImageCopyResized($ni,$im,$dstX,$dstY,0,0,$fdstW,$fdstH,$srcW,$srcH);
if($markwords!=null)
{
$markwords=iconv("gb2312","UTF-8",$markwords);
//转换文字编码
ImageTTFText($ni,20,30,450,560,$black,"simheittf",$markwords); //写入文字水印
//参数依次为,文字大小|偏转度|横坐标|纵坐标|文字颜色|文字类型|文字内容
}
elseif($markimage!=null)
{
$wimage_data = GetImageSize($markimage);
switch($wimage_data[2])
{
case 1:
$wimage=@ImageCreateFromGIF($markimage);
break;
case 2:
$wimage=@ImageCreateFromJPEG($markimage);
break;
case 3:
$wimage=@ImageCreateFromPNG($markimage);
break;
}
imagecopy($ni,$wimage,500,560,0,0,88,31); //写入水印,水印大小默认为8831
imagedestroy($wimage);
}
ImageJpeg($ni,$dstFile,$rate);
ImageJpeg($ni,$srcFile,$rate);
imagedestroy($im);
imagedestroy($ni);
}
>
是图标没有办法正常显示,对吧?你的疑难题目真的不太清楚,你先别急着删它们的快捷体式格局,要是已经删了就找到它们的源步伐并始于桌面快捷体式格局,移到桌面上,或者将它们从头安装。
对于没有办法显示的疑难题目用以下处理完成方法:
新建txt文档,将以下代码复制粘附进去,生存,然后以bat作为后缀名从头定名,如:“图标修复bat”。代码如次:
rem 封闭explorerexe
taskkill /f /im explorerexe
attrib -h -i %userprofile%\AppData\Local\IconCachedb
del %userprofile%\AppData\Local\IconCachedb /a
rem 打开explorer
start explorer
以上就是关于关于PHP缩略图程序全部的内容,包括:关于PHP缩略图程序、求助,无法定位软件包 的错误、求php生成缩略图程序等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)