Dedecms can only create thumbnails for gif|jpg|bmp|png four picture formats, and for now, there are quite a few picture formats, such as Pjpege format pictures,
Default is not created, you can open the dede/inc|inc_archives_functions.php file, find the function getddimgfrombody (& $body)
The following first
The code is as follows |
Copy Code |
Preg_match_all ("/src) =[" | | {0,} ([^>]*. (gif|jpg|bmp|png)) Amended to Preg_match_all ("/src) =[" | | {0,} ([^>]*. (Gif|jpg|bmp|png|pjpeg)) |
This is OK, but also what other formats of the picture, add it
In this way it may come out with the generated thumbnail deformation also introduce the method below
Find include/image.func.php,
Modify:
The code is as follows |
Copy Code |
if ($toWH <= $srcWH) { $ftoW = $toW; $ftoH = $ftoW * ($srcH/$srcW); } Else { $ftoH = $toH; $ftoW = $ftoH * ($srcW/$srcH); } For $ftoH = $toH; $ftoW = $toW; if ($toWH <= $srcWH) { $src _y = 0; $src _x = ($srcW-$srcH * $toWH)/2; $srcW = $srcH * $toWH; } else { $src _x = 0; $src _y = ($srcH-$srcW/$toWH)/2; $srcH = $srcW/$toWH; } More |
Change
The code is as follows |
Copy Code |
($ni, $im, 0,0,0,0, $ftoW, $ftoH, $srcW, $srcH) For ($ni, $im, 0,0, $src _x, $src _y, $ftoW, $ftoH, $srcW, $srcH) |
After the modification there is a feature: Publish the article, the editor upload pictures
1, if not selected to generate thumbnails
The original picture path is similar to Uploads/090620/1_124844_1.jpg