PHP 5.6.0 released

imagescale

(PHP 5 >= 5.5.0)

imagescaleScale an image using the given new width and height

Description

resource imagescale ( resource $image , int $new_width [, int $new_height = -1 [, int $mode = IMG_BILINEAR_FIXED ]] )

Warning

This function is currently not documented; only its argument list is available.

Parameters

image

An image resource, returned by one of the image creation functions, such as imagecreatetruecolor().

new_width

new_height

mode

One of IMG_NEAREST_NEIGHBOUR, IMG_BILINEAR_FIXED, IMG_BICUBIC, IMG_BICUBIC_FIXED or anything else (will use two pass).

Return Values

Return scaled image resource on success or FALSE on failure.

add a note add a note

User Contributed Notes 1 note

up
-14
abc at ed48.com
10 months ago
<img src="image.jpg" alt="image" /><br><br>
<?php
$org_info
= getimagesize("image.jpg");
echo
$org_info[3] . '<br><br>';
$rsr_org = imagecreatefromjpeg("image.jpg");
$rsr_scl = imagescale($rsr_org, 860, 860IMG_BICUBIC_FIXED);
imagejpeg($rsr_scl, "imagebfb.jpg");
imagedestroy($rsr_org);
imagedestroy($rsr_scl);
?>
<img src="imagebfb.jpg" alt="imagebfb" /><br><br>
<?php
$scl_info
= getimagesize("imagebfb.jpg");
echo
$scl_info[3];
?>
To Top