Function resizeImage
Resizes src_img proportionally to fit within max_width and max_height limits if it is too large. If GD2 is present, it'll use it to achieve better quality. It saves the new image to destination_filename, as preferred_format if possible, default is jpeg.
Package: SMF
Copyright: 2020 Simple Machines and individual contributors
License: BSD
Author: Simple Machines https://www.simplemachines.org
Uses: Imagemagick (IMagick or MagickWand extension) or GD
Located at Sources/Subs-Graphics.php
Copyright: 2020 Simple Machines and individual contributors
License: BSD
Author: Simple Machines https://www.simplemachines.org
Uses: Imagemagick (IMagick or MagickWand extension) or GD
Located at Sources/Subs-Graphics.php
resource |
$src_img |
The source image |
string |
$destName |
The path to the destination image |
integer |
$src_width |
The width of the source image |
integer |
$src_height |
The height of the source image |
integer |
$max_width |
The maximum allowed width |
integer |
$max_height |
The maximum allowed height |
boolean |
$force_resize = false |
= false Whether to forcibly resize it |
integer |
$preferred_format = 0 |
<ul> <li>1 for gif, 2 for jpeg, 3 for png, 6 for bmp or 15 for wbmp</li> </ul> |
boolean
|
Whether the resize was successful |