Page MenuHomePhorge
Diviner Tech Docs PhabricatorImageTransformer

final class PhabricatorImageTransformer
Phorge Technical Documentation (Files)

This class is not documented.

Tasks

Detecting Enormous Images

No methods for this task.

Saving Image Data

  • public static function saveImageDataInAnyFormat($data, $preferred_mime) — Save an image resource to a string representation suitable for storage or transmission as an image file.
  • private static function saveImageDataAsPNG($image) — Save an image in PNG format, returning the file data as a string.
  • private static function saveImageDataAsGIF($image) — Save an image in GIF format, returning the file data as a string.
  • private static function saveImageDataAsJPG($image) — Save an image in JPG format, returning the file data as a string.

Other Methods

Methods

public function __get($name)
Inherited

This method is not documented.
Parameters
$name
Return
wild

public function __set($name, $value)
Inherited

This method is not documented.
Parameters
$name
$value
Return
wild

public function current()
Inherited

This method is not documented.
Return
wild

public function key()
Inherited

This method is not documented.
Return
wild

public function next()
Inherited

This method is not documented.
Return
wild

public function rewind()
Inherited

This method is not documented.
Return
wild

public function valid()
Inherited

This method is not documented.
Return
wild

private function throwOnAttemptedIteration()
Inherited

This method is not documented.
Return
wild

public function getPhobjectClassConstant($key, $byte_limit)
Inherited

Phobject

Read the value of a class constant.

This is the same as just typing self::CONSTANTNAME, but throws a more useful message if the constant is not defined and allows the constant to be limited to a maximum length.

Parameters
string$keyName of the constant.
int|null$byte_limitMaximum number of bytes permitted in the value.
Return
stringValue of the constant.

public static function saveImageDataInAnyFormat($data, $preferred_mime)

Save an image resource to a string representation suitable for storage or transmission as an image file.

Optionally, you can specify a preferred MIME type like "image/png". Generally, you should specify the MIME type of the original file if you're applying file transformations. The MIME type may not be honored if Phabricator can not encode images in the given format (based on available extensions), but can save images in another format.

Parameters
resource$dataGD image resource.
string?$preferred_mimeOptionally, preferred mime type.
Return
stringBytes of an image file.

private static function saveImageDataAsPNG($image)

Save an image in PNG format, returning the file data as a string.

Parameters
resource$imageGD image resource.
Return
string|nullPNG file as a string, or null on failure.

private static function saveImageDataAsGIF($image)

Save an image in GIF format, returning the file data as a string.

Parameters
resource$imageGD image resource.
Return
string|nullGIF file as a string, or null on failure.

private static function saveImageDataAsJPG($image)

Save an image in JPG format, returning the file data as a string.

Parameters
resource$imageGD image resource.
Return
string|nullJPG file as a string, or null on failure.