Helper to manipulate and upload image
Definition at line 10 of file image.class.php.
◆ __destruct()
◆ addFilesRootIfNeeded()
addFilesRootIfNeeded |
( |
|
$file | ) |
|
|
protected |
Add FILESROOT to a filename if not present in it
- Parameters
-
- Returns
- string Filename
Definition at line 125 of file image.class.php.
◆ afterInit()
Call just after the configuration initialisation
Definition at line 40 of file object.class.php.
◆ beforeInit()
Call just before the configuration initialisation
Definition at line 35 of file object.class.php.
◆ build()
Make an image with the configuration parameter
- Returns
- bool|string True if success or HTML string if requested
Definition at line 158 of file image.class.php.
◆ createImage()
Create an image ressource and get the dimension of the
- Parameters
-
string | $file | The image path |
- Returns
- false|array False if not a valid image or an array with Image ressource, width and height
Definition at line 355 of file image.class.php.
◆ crop()
Crop the image
- Parameters
-
array | $prm | The parameter for the cropping:
- int x: The X position where crop (default: -1 -> automaticly center)
- int y: The Y position where crop (default: -1 -> automaticly center)
- int w: The width result (default: 0 -> the source image width)
- int h: The height result (default: 0 -> the source image height)
|
- Returns
- bool True if success
Definition at line 618 of file image.class.php.
◆ delete()
delete |
( |
|
$file, |
|
|
array |
$prm = null |
|
) |
| |
Delete the eventual thumbnail created for an image Used in form_fileUploaded
- Parameters
-
string | $file | The image uploaded |
array | $prm | The parameter for the image |
Definition at line 92 of file image.class.php.
◆ getAttr()
Get an attribute
- Parameters
-
string | $name | Attribute name |
- Returns
- mixed|null The attribute or null if not set
Definition at line 48 of file object.class.php.
◆ getCfg()
Get the configuration object
- Returns
- config
Definition at line 67 of file object.class.php.
◆ hexa2dec()
Convert an hexadecimal color to an rgb.
- Parameters
-
string | $col | The hexadecimal color |
- Returns
- array Numeric index (0: R, 1: V and 2: B)
Definition at line 660 of file image.class.php.
◆ html()
html |
( |
array |
$options = array() | ) |
|
|
protected |
Make an image with the configuration parameter
- Returns
- string|null The HTML string or null if the image doesn't exists
Definition at line 284 of file image.class.php.
◆ make()
make |
( |
array |
$prm = array() | ) |
|
Make an image
- Parameters
-
array | $prm | The parameter for the image |
- Returns
- bool|string True if success or HTML string if requested
- See also
- bluid
Definition at line 138 of file image.class.php.
◆ makePath()
makePath |
( |
|
$file, |
|
|
|
$more = null |
|
) |
| |
Make the path for a thumbnail
- Parameters
-
string | $file | File name source |
string | $more | To create other |
- Returns
- string Thumbnail path
Definition at line 104 of file image.class.php.
◆ mask()
Add a mask to the actual image
- Parameters
-
string | $file | The mask image path |
Definition at line 504 of file image.class.php.
◆ resize()
resize |
( |
array |
$prm = array() | ) |
|
|
protected |
Resize the image
- Parameters
-
array | $prm | The parameter for the resizing:
- string imgName: The image ressource to use (default: Act);
- int w: The width (default: 0 -> proportionnal resize with the height)
- int h: The height (default: 0 -> proportionnal resize width the width)
- bool fit: Indicates if the image will be fit to the size (default: true)
- bool useMaxResize: Indicates if the image will be resized to only one dimension (default: false)
- hexa bgColor: The background color (default: ffffff)
|
- Returns
- bool True if success
Definition at line 394 of file image.class.php.
◆ save()
Save the image
- Parameters
-
string | $file | The image path |
Definition at line 330 of file image.class.php.
◆ setAttr()
setAttr |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
|
inherited |
Set an attribute
- Parameters
-
string | $name | Attribute name |
mixed | $value | Attribute value |
Definition at line 58 of file object.class.php.
◆ setImg()
Set an image and creating a ressource with it
- Parameters
-
string | $file | The image path |
- Returns
- bool Indicate if everything went well or not
Definition at line 312 of file image.class.php.
◆ upload()
upload |
( |
|
$file, |
|
|
array |
$prm = array() |
|
) |
| |
Upload an image form a uploaded file Used in form_fileUploaded
- Parameters
-
string | $file | The image uploaded |
array | $prm | The parameter for the image |
- See also
- bluid
Definition at line 51 of file image.class.php.
◆ valid()
valid |
( |
array |
$file, |
|
|
array |
$prm = array() |
|
) |
| |
◆ view()
view |
( |
|
$file, |
|
|
array |
$prm = array() |
|
) |
| |
Get the HTML source to show an image
- Parameters
-
string | $file | Filename |
array | $prm | |
- See also
- helper_mage config
- Returns
- string The HTML image tag
Definition at line 67 of file image.class.php.
◆ watermark()
Add a watermark to the actual image
- Parameters
-
array | $prm | The watermark configuration with:
- string file: The image file path (required)
- boolean fit: Indicates if the watermark should fit the image size (default: false)
- boolean center: Indicates if the watermark is center (if not fitted) (default: true)
- int margin: Margin to place the watermark (default: 0)
|
Definition at line 551 of file image.class.php.
◆ $cfg
◆ $imgAct
◆ $imgTmp
◆ $info
The documentation for this class was generated from the following file: