PHP 클래스 PartKeepr\ImageBundle\Controller\ImageController

상속: extends PartKeepr\UploadedFileBundle\Controller\FileController
파일 보기 프로젝트 열기: partkeepr/PartKeepr

공개 메소드들

메소드 설명
ensureCacheDirExists ( ) Ensures that the image cache directory exists.
fitWithin ( UploadedFile $image, integer $width, integer $height, boolean $padding = false ) : string Scales the image to fit within the given size.
getImageAction ( Request $request, $id ) : ImageResponse | Response
getImageCacheDirectory ( ) : string Returns the path to the image cache directory.
getImageCacheFilename ( UploadedFile $image, integer $width, integer $height, string $mode ) : string Returns the path to an image which has been cached in a particular width, height and mode.

보호된 메소드들

메소드 설명
hasCacheFile ( UploadedFile $image, $width, $height, $mode ) : boolean Checks if the database contains the cache file.

메소드 상세

ensureCacheDirExists() 공개 메소드

Ensures that the image cache directory exists.

fitWithin() 공개 메소드

Scales the image to fit within the given size.
public fitWithin ( UploadedFile $image, integer $width, integer $height, boolean $padding = false ) : string
$image PartKeepr\UploadedFileBundle\Entity\UploadedFile The image to scale
$width integer The width
$height integer The height
$padding boolean If true, pad the output image to the given size (transparent background).
리턴 string The path to the scaled file

getImageAction() 공개 메소드

public getImageAction ( Request $request, $id ) : ImageResponse | Response
$request Symfony\Component\HttpFoundation\Request
$id
리턴 PartKeepr\ImageBundle\Response\ImageResponse | Symfony\Component\HttpFoundation\Response

getImageCacheDirectory() 공개 메소드

Returns the path to the image cache directory.
public getImageCacheDirectory ( ) : string
리턴 string

getImageCacheFilename() 공개 메소드

Returns the path to an image which has been cached in a particular width, height and mode.
public getImageCacheFilename ( UploadedFile $image, integer $width, integer $height, string $mode ) : string
$image PartKeepr\UploadedFileBundle\Entity\UploadedFile The image
$width integer The width
$height integer The height
$mode string The mode
리턴 string

hasCacheFile() 보호된 메소드

Checks if the database contains the cache file.
protected hasCacheFile ( UploadedFile $image, $width, $height, $mode ) : boolean
$image PartKeepr\UploadedFileBundle\Entity\UploadedFile
$width
$height
$mode
리턴 boolean