Description

This function scales a specified image.


Examples 




$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$image_scale = $cpanel->api1('ImageManager','scale',array('images','image.jpg','none','200','300','0')); // Call the function.



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $image_scale = $cpliveapi->api1('ImageManager','scale',['images','image.jpg','none','200','300','0'] ] ); # Call the function.



<cpanel Module="ImageManager::scale($FORM('dir','file','oldimage','width','height','keepold'))">




cpapi1 --user=username ImageManager scale images image.jpg none 200 300 0



Converting /home/user/test1.jpg to /home/user/test1. gif...........Done




Parameters

ParameterTypeDescriptionPossible ValuesExample
dirstring

Required

The directory that contains the file to scale.

A valid path to a directory , relative to the account's home directory .
images
filestring

Required

The name of the file to scale.

A valid filename.image.jpg
oldimagestringThe name of the old file.A valid filename.none
widthinteger

Required

The format to which to convert the images.

The width of the file, in pixels.200
heightinteger

Required

The format to which to convert the images,

The height of the file, in pixels.300
keepoldBooleanWhether to copy the original image file to the name in the oldimage parameter's value.
  • 1 — Copy the original image.
  • 0 — Delete the old file.
0

Returns

This function returns a confirmation message.