void getProperty(
$mimeType,
$propertyName,
$sourceFilename
)
|
|
Parameters:
|
|
$mimeType: |
|
|
|
$propertyName: |
|
|
|
$sourceFilename: |
|
API Tags:
| See: | GalleryToolkit::getProperty |
Redefinition of:
- GalleryToolkit::getProperty()
- Get a certain property of a file
void performOperation(
$mimeType,
$operationName,
$sourceFilename,
$destFilename,
$parameters, [
$context = array()]
)
|
|
Parameters:
|
|
$mimeType: |
|
|
|
$operationName: |
|
|
|
$sourceFilename: |
|
|
|
$destFilename: |
|
|
|
$parameters: |
|
|
|
$context: |
|
API Tags:
| See: | GalleryToolkit::performOperation |
Redefinition of:
- GalleryToolkit::performOperation()
- Perform a certain operation
nothing setGdFunctionality(
&$obj
)
|
|
Set a different GdFunctionality object to be used by this Toolkit.
This is useful on our phpunit tests, which will make this Toolkit use a pseudo-gd-implementation that simulates different PHP versions.
Parameters:
bool _canHaveAlphaChannel(
string
$mimeType
)
|
|
Checks whether files of the given mime-type can have a whole alpha channel.
Parameters:
bool _canHaveTransparency(
string
$mimeType, [resource
$res = null]
)
|
|
Checks whether files of the given mime-type can have transparencies.
Parameters:
|
string |
$mimeType: |
|
|
resource |
$res: |
(optional) If specified, additional checks are executed |
GalleryStatus _flattenAlphaChannel(
resource
$res, string
$outputMimeType
)
|
|
Handle the resouce according to the capabilities of the output format.
- For formats that support an alpha channel, don't do anything.
- For formats that support a single transparent color, interpret everything that is more
than 50% opaque as transparent.
- For formats that don't support any form of transparency, fill the transparent area
with a predefined background color.
The code is based on phpthumb by James Heinrich <info@silisoftware.com>.
Parameters:
|
resource |
$res: |
|
|
string |
$outputMimeType: |
|
Parameters:
API Tags:
| See: | GdFunctionality::imagedestroy |
object implementation &_getGdFunctionality(
)
|
|
Return the current set gdFunctionality.
Default is GdFunctionality.class if no other is set.
API Tags:
| Return: | of GdFunctionality |
| Access: | private |
void _getImageDimensions(
$mimeType,
$filename
)
|
|
Parameters:
API Tags:
| Access: | private |
| See: | GalleryGraphics::getImageDimensions |
array _getImageDimensionsForResource(
$res
)
|
|
Get the image dimentions for an already opened GD resource.
Parameters:
API Tags:
| Return: | GalleryStatus int width int height |
| Access: | private |
array _getImageResource(
string
$mimeType, string
$filename
)
|
|
Return a GD image resource for the given filename so we can perform other operations on it.
Parameters:
|
string |
$mimeType: |
the mime-type of the image |
|
string |
$filename: |
the path to the file to read |
API Tags:
| Return: | GalleryStatus a status code resource the GD resource |
| Access: | private |
array _getTrueColorImageRes(
int
$width, int
$height, [bool
$prepareAlpha = false]
)
|
|
Create a truecolor GD resource with the specified sizes.
On GD >= 2.0.1 there is a function to do this directly. On earlier versions, we need to create a temporary JPEG image and create the image from that.
Parameters:
|
int |
$width: |
|
|
int |
$height: |
|
|
bool |
$prepareAlpha: |
(optional) whether the resource should be prepared to host any transparencies |
API Tags:
| Return: | GalleryStatus resource the GD resource |
| Access: | private |
array _hasImageCreateTrueColor(
)
|
|
Do we have a working version of imageCreateTrueColor()?
API Tags:
| Return: | GalleryStatus boolean true if this function should work |
| Access: | private |
GalleryStatus _imageCopyResampled(
$dstRes,
$srcRes,
$dstX,
$dstY,
$srcX,
$srcY,
$dstW,
$dstH,
$srcW,
$srcH
)
|
|
Copy and resize part of an image with resampling or resizing.
We will use GD's "resample" functionality and fallback to "resize" if "resample" is not available.
Parameters:
|
|
$dstRes: |
|
|
|
$srcRes: |
|
|
|
$dstX: |
|
|
|
$dstY: |
|
|
|
$srcX: |
|
|
|
$srcY: |
|
|
|
$dstW: |
|
|
|
$dstH: |
|
|
|
$srcW: |
|
|
|
$srcH: |
|
API Tags:
GalleryStatus _prepareResourceForAlphaChannel(
&$res, resource
$res, int
$width, int
$height
)
|
|
Prepares a resource to handle alpha inherited from a source resource.
Images that have transparency must have the background filled with the indexed color for transparency, otherwise the transparent color will appear as black.
The code is based on phpthumb by James Heinrich <info@silisoftware.com>. This version only works for PHP >= 4.3.2
Parameters:
|
resource |
$res: |
|
|
int |
$width: |
|
|
int |
$height: |
|
|
|
&$res: |
|
array _resizeImageResource(
resource
$sourceRes, int
$destWidth, int
$destHeight, [bool
$hasAlpha = false]
)
|
|
Resizes an open GD-resource to the specified size.
Parameters:
|
resource |
$sourceRes: |
the source GD-resource |
|
int |
$destWidth: |
the destination width |
|
int |
$destHeight: |
the destination height |
|
bool |
$hasAlpha: |
(optional) whether the source image has any transparency |
API Tags:
| Return: | GalleryStatus resource the destination GD-resource |
| Access: | private |
GalleryStatus _saveImageResourceToFile(
resource
$res, string
$filename, string
$mimeType, [bool
$hasTransparency = true], [string
$jpegQuality = null]
)
|
|
Save a GD resource to a file with a certain mime-type
Parameters:
|
resource |
$res: |
|
|
string |
$filename: |
the path to the file to read |
|
string |
$mimeType: |
the mime-type of the image |
|
bool |
$hasTransparency: |
(optional) set to false to prevent dithering |
|
string |
$jpegQuality: |
(optional) |
API Tags:
| Return: | a status code |
| Access: | private |