Page MenuHomePhabricator
Diviner Phabricator Tech Docs PhabricatorImageTransformer

final class PhabricatorImageTransformer
Phabricator 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 executeMemeTransform($file, $upper_text, $lower_text)

This method is not documented.
Parameters
PhabricatorFile$file
$upper_text
$lower_text
Return
wild

public function executeConpherenceTransform($file, $top, $left, $width, $height)

This method is not documented.
Parameters
PhabricatorFile$file
$top
$left
$width
$height
Return
wild

private function crasslyCropTo($file, $top, $left, $w, $h)

This method is not documented.
Parameters
PhabricatorFile$file
$top
$left
$w
$h
Return
wild

private function getBlankDestinationFile($dx, $dy)

This method is not documented.
Parameters
$dx
$dy
Return
wild

public static function getScaleForCrop($file, $des_width, $des_height)

This method is not documented.
Parameters
PhabricatorFile$file
$des_width
$des_height
Return
wild

private function applyMemeToFile($file, $upper_text, $lower_text)

This method is not documented.
Parameters
PhabricatorFile$file
$upper_text
$lower_text
Return
wild

private function applyMemeTo($data, $upper_text, $lower_text, $mime_type)

This method is not documented.
Parameters
$data
$upper_text
$lower_text
$mime_type
Return
wild

private function makeImageWithTextBorder($img, $font_size, $x, $y, $color, $stroke_color, $bw, $font, $text)

This method is not documented.
Parameters
$img
$font_size
$x
$y
$color
$stroke_color
$bw
$font
$text
Return
wild

private function doesTextBoundingBoxFitInImage($img, $text, $font_size, $font_path)

This method is not documented.
Parameters
$img
$text
$font_size
$font_path
Return
wild

private function applyMemeWithImagemagick($input, $above, $below, $count, $img_type)

This method is not documented.
Parameters
$input
$above
$below
$count
$img_type
Return
wild

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.