[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/files/ -> PhabricatorImageTransformer.php (summary)

(no description)

File Size: 661 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 25 functions

  executeMemeTransform()
  executeThumbTransform()
  executeProfileTransform()
  executePreviewTransform()
  executeConpherenceTransform()
  crudelyCropTo()
  crasslyCropTo()
  crudelyScaleTo()
  getBlankDestinationFile()
  applyScaleTo()
  getPreviewDimensions()
  getScaleForCrop()
  generatePreview()
  applyMemeToFile()
  applyMemeTo()
  makeImageWithTextBorder()
  doesTextBoundingBoxFitInImage()
  applyScaleWithImagemagick()
  applyMemeWithImagemagick()
  isEnormousImage()
  isEnormousGIF()
  saveImageDataInAnyFormat()
  saveImageDataAsPNG()
  saveImageDataAsGIF()
  saveImageDataAsJPG()

Functions
Functions that are not part of a class:

executeMemeTransform(PhabricatorFile $file,$upper_text,$lower_text)   X-Ref


executeThumbTransform(PhabricatorFile $file,$x,$y)   X-Ref
No description

executeProfileTransform(PhabricatorFile $file,$x,$min_y,$max_y)   X-Ref
No description

executePreviewTransform(PhabricatorFile $file,$size)   X-Ref
No description

executeConpherenceTransform(PhabricatorFile $file,$top,$left,$width,$height)   X-Ref
No description

crudelyCropTo(PhabricatorFile $file, $x, $min_y, $max_y)   X-Ref
No description

crasslyCropTo(PhabricatorFile $file, $top, $left, $w, $h)   X-Ref
No description

crudelyScaleTo(PhabricatorFile $file, $dx, $dy)   X-Ref
Very crudely scale an image up or down to an exact size.


getBlankDestinationFile($dx, $dy)   X-Ref
No description

applyScaleTo(PhabricatorFile $file, $dx, $dy)   X-Ref
No description

getPreviewDimensions(PhabricatorFile $file, $size)   X-Ref
No description

getScaleForCrop(PhabricatorFile $file,$des_width,$des_height)   X-Ref
No description

generatePreview(PhabricatorFile $file, $size)   X-Ref
No description

applyMemeToFile(PhabricatorFile $file,$upper_text,$lower_text)   X-Ref
No description

applyMemeTo($data,$upper_text,$lower_text,$mime_type)   X-Ref
No description

makeImageWithTextBorder($img, $font_size, $x, $y,$color, $stroke_color, $bw, $font, $text)   X-Ref
No description

doesTextBoundingBoxFitInImage($img,$text, $font_size, $font_path)   X-Ref
No description

applyScaleWithImagemagick(PhabricatorFile $file, $dx, $dy)   X-Ref
No description

applyMemeWithImagemagick($input,$above,$below,$count,$img_type)   X-Ref
No description

isEnormousImage($x, $y)   X-Ref
Determine if an image is enormous (too large to transform).

Attackers can perform a denial of service attack by uploading highly
compressible images with enormous dimensions but a very small filesize.
Transforming them (e.g., into thumbnails) may consume huge quantities of
memory and CPU relative to the resources required to transmit the file.

In general, we respond to these images by declining to transform them, and
using a default thumbnail instead.

param: int Width of the image, in pixels.
param: int Height of the image, in pixels.
return: bool True if this image is enormous (too large to transform).

isEnormousGIF($x, $y)   X-Ref
Determine if a GIF is enormous (too large to transform).

For discussion, see @{method:isEnormousImage}. We need to be more
careful about GIFs, because they can also have a large number of frames
despite having a very small filesize. We're more conservative about
calling GIFs enormous than about calling images in general enormous.

param: int Width of the GIF, in pixels.
param: int Height of the GIF, in pixels.
return: bool True if this image is enormous (too large to transform).

saveImageDataInAnyFormat($data, $preferred_mime = '')   X-Ref
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.

param: resource  GD image resource.
param: string?   Optionally, preferred mime type.
return: string    Bytes of an image file.

saveImageDataAsPNG($image)   X-Ref
Save an image in PNG format, returning the file data as a string.

param: resource      GD image resource.
return: string|null  PNG file as a string, or null on failure.

saveImageDataAsGIF($image)   X-Ref
Save an image in GIF format, returning the file data as a string.

param: resource      GD image resource.
return: string|null  GIF file as a string, or null on failure.

saveImageDataAsJPG($image)   X-Ref
Save an image in JPG format, returning the file data as a string.

param: resource      GD image resource.
return: string|null  JPG file as a string, or null on failure.



Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1