Home > Article > Backend Development > PHP thumbnail image function code according to maximum width and height
A very simple code to shrink images according to the maximum width and height, which is convenient for novices and people who are too lazy to write it themselves OnFunction Thumb ($ ImageFile, $ maxwidth, $ maxheight) { $ DIM = GetimageSize ($ ImageFile); $ width = $ dim [0]; = $ dim [1 ; // Original image aspect ratio aspect ratio, aspect ratio $thumbHeight = $maxheight;
$thumbHeight = $maxheight; = $maxheight*$crown;
|