## /image.php

Description

This script implements utility functions for working with images.

- license: Phorum
- copyright: 2007, Phorum Development Team

Functions
phorum_api_image_thumbnail (line 78)

Create an image thumbnail.

This function can be used to create a scaled down thumbnail version of an image. You can specifiy a width and/or a height to which to scale down the image. The aspect ratio will always be kept. If both a width and height are provided, then the one which requires the largest scale down will be leading.

- return:

  NULL is returned in case creating the thumbnail failed. The function phorum_api_strerror() can be used to retrieve information about the error which occurred.

  An array is returned in case creating the thumbnail did work. This array contains the following fields:

  - image: The scaled down image. NULL if no scaling was needed.
  - method: The method that was used to create the thumbnail.
  - cur_w: The width of the original $image.
  - cur_h: The height of the original $image.
  - cur_mime: The MIME type of the original $image.
  - new_w: The width of the scaled down image.
  - new_h: The height of the scaled down image.
  - new_mime: The MIME type of the scaled down image,

mixed phorum_api_image_thumbnail (mixed $image, [mixed $max_w = NULL], [mixed $max_h = NULL], [mixed $method = NULL], string $image , integer $max_w , integer $max_h , string $method )

- string $image : The raw binary image data.
- integer $max_w : The maximum allowed width for the image in pixels. Use NULL or 0 (zero) to indicate that any width will do.
- integer $max_h : The maximum allowed height for the image in pixels. Use NULL or 0 (zero) to indicate that any height will do.
- string $method : The method to use for scaling the image. By default, this function will try to autodetect a working method. Providing a $method parameter is mostly useful for debugging purposes. Available methods (in the order in which they are probed in the code) are:
  - gd: using the GD library (requires extension "gd")
  - imagick: using the ImageMagick library (requires extension "imagick")
  - convert: using the ImageMagick "convert" tool (requires the ImageMagick package to be installed on the server, does not work in combination with some PHP safety restrictions).

Documentation generated on Mon, 07 Jan 2008 01:45:43 -0600 by phpDocumentor 1.3.0RC5