In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you about the distortion and blurring of dream thumbnails. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.
What if the dream thumbnail is distorted and blurred?
Dream weaving DEDECMS thumbnail distortion blur ultimate perfect solution
Because dede generates only one size thumbnail by default, and often the thumbnails required in different pages of a station are inconsistent in size and scale, which results in unclear and distorted thumbnails, the following methods provide a perfect solution to this problem.
How to use it:
First, in order to get a clear thumbnail, you must have a large enough picture and cut it accurately, and the following method is to cut it according to the thumbnail (because part of the original website has a watermark), so it is necessary to ensure that the original thumbnail is large enough.
So to make the following settings: system-attachment setting, set the default width and default height of thumbnails to be greater than or equal to the maximum size of all calls to thumbnails in your site, and cut them large enough by hand (no need to cut by hand)
Open include/extend.func.php (Note: this file is prepared for secondary development and is used for functional method extension)
Add the following code before the last? >
Function thumb ($imgurl, $width, $height, $bg = true) {global $cfg_mainsite,$cfg_multi_site; $thumb = eregi ("", $imgurl)? str_replace ($cfg_mainsite,'',$imgurl): $imgurl; list ($thumbname,$extname) = explode ('.', $thumb); $newthumb = $thumbname.'_'.$width.'_'.$height.'.'.$extname; if (! $thumbname | |! $extname | |! file_exists (DEDEROOT.$thumb)) return $imgurl If (! file_exists (DEDEROOT.$newthumb)) {include_once DEDEINC.'/image.func.php'; if ($bg==true) {ImageResizeNew (DEDEROOT.$thumb, $width, $height, DEDEROOT.$newthumb);} else {ImageResize (DEDEROOT.$thumb, $width, $height, DEDEROOT.$newthumb);} return $cfg_multi_site=='Y'?$cfg_mainsite.$newthumb:$newthumb;}
Call method:
Label:
[field:picname function='thumb (@ me,$width,$height,$bg)'/]
Parameter description:
$width: thumbnail width (integer)
$height: thumbnail height (integer)
$bg: whether to fill in blanks by default. The background fill color is in the system-attachment settings (true/false).
For example:
Call a thumbnail with a width of 100 pixels: [field:picname function='thumb (@ me,100100)'/]
Keep the original proportion and do not fill it automatically (not recommended): [field:picname function='thumb (@ me,100,100,false)'/]
Thank you for reading! On the weaving dream thumbnail distortion and blur to share here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.