PHP 클래스 lsolesen\pel\PelTiff

Exif data is actually an extension of the TIFF file format. TIFF images consist of a number of {@link PelIfd Image File Directories} (IFDs), each containing a number of {@link PelEntry entries}. The IFDs are linked to each other --- one can get hold of the first one with the {@link getIfd()} method. To parse a TIFF image for Exif data one would do: $tiff = new PelTiff($data); $ifd0 = $tiff->getIfd(); $exif = $ifd0->getSubIfd(PelIfd::EXIF); $ifd1 = $ifd0->getNextIfd(); Should one have some image data of an unknown type, then the {@link PelTiff::isValid()} function is handy: it will quickly test if the data could be valid TIFF data. The {@link PelJpeg::isValid()} function does the same for JPEG images.
저자: Martin Geisler ([email protected])
파일 보기 프로젝트 열기: lsolesen/pel 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( $data = false ) Construct a new object for holding TIFF data.
__toString ( ) : string Return a string representation of this object.
getBytes ( PelByteOrder $order = PelConvert::LITTLE_ENDIAN ) : string Turn this object into bytes.
getIfd ( ) : PelIfd Return the first IFD.
isValid ( lsolesen\pel\PelDataWindow $d ) : boolean Check if data is valid TIFF data.
load ( lsolesen\pel\PelDataWindow $d ) Load TIFF data.
loadFile ( string $filename ) Load data from a file into a TIFF object.
setIfd ( PelIfd $ifd ) Set the first IFD.

메소드 상세

__construct() 공개 메소드

The new object will be empty (with no {@link PelIfd}) unless an argument is given from which it can initialize itself. This can either be the filename of a TIFF image or a {@link PelDataWindow} object. Use {@link setIfd()} to explicitly set the IFD.
public __construct ( $data = false )

__toString() 공개 메소드

Return a string representation of this object.
public __toString ( ) : string
리턴 string a string describing this object. This is mostly useful for debugging.

getBytes() 공개 메소드

TIFF images can have {@link PelConvert::LITTLE_ENDIAN little-endian} or {@link PelConvert::BIG_ENDIAN big-endian} byte order, and so this method takes an argument specifying that.
public getBytes ( PelByteOrder $order = PelConvert::LITTLE_ENDIAN ) : string
$order PelByteOrder the desired byte order of the TIFF data. This should be one of {@link PelConvert::LITTLE_ENDIAN} or {@link PelConvert::BIG_ENDIAN}.
리턴 string the bytes representing this object.

getIfd() 공개 메소드

Return the first IFD.
public getIfd ( ) : PelIfd
리턴 PelIfd the first IFD contained in the TIFF data, if any. If there is no IFD null will be returned.

isValid() 공개 정적인 메소드

This will read just enough data from the data window to determine if the data could be a valid TIFF data. This means that the check is more like a heuristic than a rigorous check.
또한 보기: PelJpeg::isValid()
public static isValid ( lsolesen\pel\PelDataWindow $d ) : boolean
$d lsolesen\pel\PelDataWindow the bytes that will be examined.
리턴 boolean true if the data looks like valid TIFF data, false otherwise.

load() 공개 메소드

The data given will be parsed and an internal tree representation will be built. If the data cannot be parsed correctly, a {@link PelInvalidDataException} is thrown, explaining the problem.
public load ( lsolesen\pel\PelDataWindow $d )
$d lsolesen\pel\PelDataWindow

loadFile() 공개 메소드

Load data from a file into a TIFF object.
public loadFile ( string $filename )
$filename string the filename. This must be a readable file.

setIfd() 공개 메소드

Set the first IFD.
public setIfd ( PelIfd $ifd )
$ifd PelIfd the new first IFD, which must be of type {@link PelIfd::IFD0}.