Home > Article > CMS Tutorial > Why does the DedeCMS slideshow call image appear blurry?
Why does the DedeCMS slideshow call image appear blurry?
Many people who use Dreamweaver to build a website encounter a problem that the slideshow on the homepage of the dedecms website calls article thumbnails. If the aspect ratio of our actual picture and the ratio of the slide are too different If so, the slideshow image displayed on the homepage will automatically stretch and become blurred. This does seem to be a problem that affects the user experience. Let’s analyze two methods to solve this problem.
The first solution: Manually crop thumbnails
Although the method of manual cropping thumbnails is a bit more cumbersome, it is very practical and can display the slideshow images accurately. The specific method is to use Some image processing tools such as Photoshop or Meitu Xiuxiu can make the image into the same size and proportion as the slide, and then upload it manually. This is fine. The advantage is that the slide image is of appropriate size, very clear and of very good quality. , the disadvantage is that it is very troublesome to use tools to manually crop thumbnails every time you publish an article.
The second solution is to modify the DreamWeaver code to automatically call images in equal proportions
Automatically call images in equal proportions. This method is also more practical and can automatically transfer any images we upload. The size of the picture is automatically adjusted to a fixed size ratio. The advantage of this method is that it is automatically generated, simple and fast, but the disadvantage is that there is no way to distinguish the horizontal and vertical ratio pictures. If the horizontal ratio pictures are compressed according to the numerical ratio pictures, the pictures will be distorted. The specific modification method is as follows:
Open the index.htm file of the home page template of the Dreamweaver website or the web page template that requires a slideshow, and find the following code to read the thumbnail:
for(i=1;i<picarr.length;i++){ if(files=="") files = picarr[i]; elsefiles += "|"+picarr[i]; }
us Modify this dreamweaver code to the following code:
for(i=1;i<picarr.length;i++){ if(files=="") files = picarr[i].replace("-lp",""); elsefiles += "|"+picarr[i].replace("-lp",""); }
After the modification is completed, clear the cache and regenerate the homepage.
The above is the detailed content of Why does the DedeCMS slideshow call image appear blurry?. For more information, please follow other related articles on the PHP Chinese website!