VPS参考测评推荐
专注分享VPS主机优惠信息
衡天云优惠活动
华纳云优惠活动

PHPCMS如何解决缩略图不清晰(缩略图不可见)的问题

主机参考:VPS测评参考推荐/专注分享VPS服务器优惠信息!若您是商家可以在本站进行投稿,查看详情!此外我们还提供软文收录、PayPal代付、广告赞助等服务,查看详情!
我们发布的部分优惠活动文章可能存在时效性,购买时建议在本站搜索商家名称可查看相关文章充分了解该商家!若非中文页面可使用Edge浏览器同步翻译!PayPal代付/收录合作

PHPCMS如何解决缩略图不清晰(缩略图不可见)的问题

PHPCMS如何解决缩略图不清晰的问题?

首先,在phpcms下的libs中找到classes目录并打开它;然后找到image.class.php文件并打开它;最后,搜索到调用“$imagefun()”函数的地方,并将第三个参数作为90传递。

搜索到下一个功能

函数thumb($ image,$ filename = & amp#39;& amp#39;,$maxwidth = 200,$maxheight = 200,$ suffix = & amp#39;& amp#39;,$autocut = 0,$ FTP = 0){ if(!$ this-& gt;thumb_enable ||!$ this-& gt;check($ image))返回false$ info = image::info($ image);if($ info = = = false)返回false;$ src width = $ info【& amp;#39;宽度和长度。#39;];$ srcheight = $ info【& amp;#39;身高和体重。#39;];$ pathinfo = pathinfo($ image);$ type = $ pathinfo【& amp;#39;扩展和扩展。#39;];如果(!$ type)$ type = $ info【& amp;#39;类型&amp。#39;];$ type = strtolower($ type);unset($ info);$ creat _ arr = $ this-& gt;get percent($ src width,$srcheight,$maxwidth,$ max height);$ create width = $ width = $ creat _ arr【& amp;#39;w & amp#39;];$ create height = $ height = $ creat _ arr【& amp;#39;h & amp#39;];$ psrc _ x = $ psrc _ y = 0;if($ autocut & amp;& amp$ maxwidth & gt0 & amp& amp$ maxheight & gt0){ if($ maxwidth/$ max height & lt;$ src width/$ src height & amp;& amp$ maxheight & gt= $ height){ $ width = $ max height/$ height * $ width;$ height = $ maxheight} else if($ maxwidth/$ max height & gt;$ src width/$ src height & amp;& amp$ maxwidth & gt= $ width){ $ height = $ maxwidth/$ width * $ height;$ width = $ maxwidth} $ createwidth = $ maxwidth$ createheight = $ maxheight} $ createfun = & amp#39;imagecreatefrom & amp#39;。($ type = = & amp#39;jpg & amp#39;?& amp#39;jpeg & amp#39;:$ type);$ Sr cimg = $ create fun($ image);if($ type!= & amp#39;gif & amp#39;& amp& ampfunction _ exists(& amp;#39;imagecreatetruecolor & amp#39;))$ thumb img = imagecreatetruecolor($ createwidth,$ createheight);else $ thumb img = image create($ width,$ height);if(function _ exists(& amp;#39;imagecopyresampled & amp#39;))imagecopyressampled($ thumb img,$srcimg,0,0,$psrc_x,$psrc_y,$width,$height,$srcwidth,$ src height);else imagecopyretzed($ thumb img,$srcimg,0,0,$psrc_x,$psrc_y,$width,$height,$srcwidth,$ src height);if($ type = = & amp;#39;gif & amp#39;| | $ type = = & amp#39;巴布亚新几内亚& amp#39;){ $ background _ color = imagecolorolallocate($ thumb img,0,255,0);//分配一个绿色的imagecoloranspare($ thumb img,$ background _ color);//设置为透明色,如果该行被注释掉,则绿色图形} if($ type = = &;#39;jpg & amp#39;| | $ type = = & amp#39;jpeg & amp#39;)image interlace($ thumbimg,$ this-& gt;交错);$ imagefun = & amp#39;形象与设计。#39;。($ type = = & amp#39;jpg & amp#39;?& amp#39;jpeg & amp#39;:$ type);if(empty($ filename))$ filename = substr($ image,0,strrpos($ image,& amp#39;。& amp#39;)).$后缀。& amp#39;。& amp#39;。$ type$ image fun($ thumb img,$ filename);image destroy($ thumb img);image destroy($ src img);if($ FTP){ @ unlink($ image);} return $ filename}然后找到

if($ type = = & amp;#39;jpg & amp#39;| | $ type = = & amp#39;jpeg & amp#39;)image interlace($ thumbimg,$ this-& gt;交错);$ imagefun = & amp#39;形象与设计。#39;。($ type = = & amp#39;jpg & amp#39;?& amp#39;jpeg & amp#39;:$ type);if(empty($ filename))$ filename = substr($ image,0,strrpos($ image,& amp#39;。& amp#39;)).$后缀。& amp#39;。& amp#39;。$ type$ image fun($ thumb img,$ filename);image destroy($ thumb img);image destroy($ src img);代替

if($ type = = & amp;#39;jpg & amp#39;| | $ type = = & amp#39;jpeg & amp#39;)image interlace($ thumbimg,$ this-& gt;交错);$ imagefun = & amp#39;形象与设计。#39;。($ type = = & amp#39;jpg & amp#39;?& amp#39;jpeg & amp#39;:$ type);if(empty($ filename))$ filename = substr($ image,0,strrpos($ image,& amp#39;。& amp#39;)).$后缀。& amp#39;。& amp#39;。$ type$ image fun($ thumb img,$filename,90);image destroy($ thumb img);image destroy($ src img);你能解决这个问题

推荐教程:PHP教程

这几篇文章你可能也喜欢:

本文由主机参考刊发,转载请注明:PHPCMS如何解决缩略图不清晰(缩略图不可见)的问题 https://zhujicankao.com/109116.html

【腾讯云】领8888元采购礼包,抢爆款云服务器 每月 9元起,个人开发者加享折上折!
打赏
转载请注明原文链接:主机参考 » PHPCMS如何解决缩略图不清晰(缩略图不可见)的问题
主机参考仅做资料收集,不对商家任何信息及交易做信用担保,购买前请注意风险,有交易纠纷请自行解决!请查阅:特别声明

评论 抢沙发

评论前必须登录!