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 cmsyou share under Phpcms V9 thumbnail Clipping There is a workaround for black edges.
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.
Original: https://weibo.com/p/1001603934001709588271
Phpcms V9 thumbnail clipping solution with black edge