Child pages
  • cPanel API 1 Functions - ImageManager::scale

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function scales a specified image.

Include Page
LIB:_cPanelAPI1NoEquivalent
LIB:_cPanelAPI1NoEquivalent

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledWebServerRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$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.

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
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.

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 


Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelTagsWarning
LIB:_cPanelTagsWarning

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



Expand
titleCommand Line


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

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote


Expand
titleOutput (plaintext)


Code Block
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.