functions-image.php
Table of Contents
Functions
- imageError() : mixed
- imageDebug() : mixed
- Prints debug information from the arguments to i.php.
- propSizes() : array<string|int, mixed>
- Calculates proprotional width and height Used internally by cacheImage
- iptc_make_tag() : mixed
- iptc_make_tag() function by Thies C. Arntzen
- cacheImage() : mixed
- Creates the cache folder version of the image, including watermarking
- getImageRotation() : array<string|int, mixed>|false
- Determines the rotation of the image by looking at EXIF information.
- addWatermark() : resource|object
- Adds a watermark to a resized image. If no watermark is set it just returns the image
- isGDImage() : bool
- Checks if an processed image is a GD library image
Functions
imageError()
imageError(string $status_text, string $errormessage[, string $errorimg = 'err-imagegeneral.png' ][, string $image = '' ][, string $album = '' ][, string $newfilename = '' ]) : mixed
Parameters
- $status_text : string
- $errormessage : string
-
the error message to print if $_GET['debug'] is set.
- $errorimg : string = 'err-imagegeneral.png'
-
the filename of the error image to display for production. Defaults to 'err-imagegeneral.png'. Images should be located in /zp-core/images_errors .
- $image : string = ''
- $album : string = ''
- $newfilename : string = ''
Tags
imageDebug()
Prints debug information from the arguments to i.php.
imageDebug(string $album, string $image, array<string|int, mixed> $args, string $imgfile) : mixed
Parameters
- $album : string
-
alubm name
- $image : string
-
image name
- $args : array<string|int, mixed>
-
size/crop arguments
- $imgfile : string
-
the filename of the image
propSizes()
Calculates proprotional width and height Used internally by cacheImage
propSizes(int $size, int $width, int $height, int $w, int $h, int $thumb, int $image_use_side, int $dim) : array<string|int, mixed>
Returns array containing the new width and height
Parameters
- $size : int
- $width : int
- $height : int
- $w : int
- $h : int
- $thumb : int
- $image_use_side : int
- $dim : int
Return values
array<string|int, mixed>iptc_make_tag()
iptc_make_tag() function by Thies C. Arntzen
iptc_make_tag( $rec, $data, $value) : mixed
Parameters
cacheImage()
Creates the cache folder version of the image, including watermarking
cacheImage(string $newfilename, string $imgfile, array<string|int, mixed> $args[, bool $allow_watermark = false ][, string $theme = null ][, string $album = null ]) : mixed
Parameters
- $newfilename : string
-
the name of the file when it is in the cache
- $imgfile : string
-
the image name
- $args : array<string|int, mixed>
-
the cropping arguments
- $allow_watermark : bool = false
-
set to true if image may be watermarked
- $theme : string = null
-
the current theme
- $album : string = null
-
the album containing the image
getImageRotation()
Determines the rotation of the image by looking at EXIF information.
getImageRotation(string $imgfile) : array<string|int, mixed>|false
Returns an array with two indexes "rotate" (= degree to rotate) and "flip" ("horizontal" or "vertical") or false if nothing applies
Parameters
- $imgfile : string
-
the image name
Tags
Return values
array<string|int, mixed>|falseaddWatermark()
Adds a watermark to a resized image. If no watermark is set it just returns the image
addWatermark(resource|object $newim, string $watermark_image[, string $imgfile = null ]) : resource|object
Parameters
- $newim : resource|object
-
GD image resource or Imagick object
- $watermark_image : string
-
The path to the watermark to use
- $imgfile : string = null
-
Path to the image being processed (optionally for debugging only)
Tags
Return values
resource|objectisGDImage()
Checks if an processed image is a GD library image
isGDImage(mixed $image) : bool
Parameters
- $image : mixed
-
And Image resource (PHP < 8) or GDImage object (PHP 8+)