Recently with Phpcms V9 again encountered an old problem: in the content page thumbnail clipping when the black edge, this situation has not met, is estimated to be long or wide different or will be in the Home page, list page, content pages in different places accidentally appear, here to share the phpcms V9 thumbnail clipping there is a black edge solution.
In the phpcms V9 thumbnail clipping function before the thumb, there will be a getpercent function to determine the length and height of the image, correcting this error, can be done by modifying the getpercent function judgment, specific files: phpcms/libs/classes/ image.class.php.
Find lines 65th and 66:
$h = $DSTW; $w = $dsth;
Modified to:
$w = $DSTW; $h = $dsth;
Capture Diagram Demo:
After the modification, through the FTP to find the corresponding directory of the thumbnail, delete the "thumb_" the beginning of the thumbnail, and then HTML generation, the display is OK.
The function that generated the thumbnail turned the width and height back to Orz
Phpcms V9 thumbnail clipping solution with black edge