[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/ -> JpegMeta.php (summary)

JPEG metadata reader/writer

Author: Sebastian Delmont
Author: Andreas Gohr
Author: Hakan Sandell
License: BSD
Link: http://github.com/sd/jpeg-php
File Size: 3188 lines (113 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

JpegMeta:: (57 methods):
  __construct()
  getField()
  setField()
  deleteField()
  getDateField()
  getFileField()
  getCamera()
  getShutterSpeed()
  getExifField()
  getXmpField()
  getAdobeField()
  getIPTCField()
  setExifField()
  setAdobeField()
  getResizeRatio()
  setIPTCField()
  deleteExifField()
  deleteAdobeField()
  deleteIPTCField()
  getTitle()
  getDates()
  getWidth()
  getHeight()
  getDimStr()
  hasThumbnail()
  sendThumbnail()
  save()
  _dispose()
  _readJPEG()
  _parseAll()
  _writeJPEG()
  _writeJPEGMarker()
  _parseFileInfo()
  _parseMarkerJFIF()
  _parseMarkerSOF()
  _parseMarkerXmp()
  _parseXmpNode()
  _parseMarkerExif()
  _readIFD()
  _writeIFD()
  _parseMarkerAdobe()
  _readIPTC()
  _write8BIM()
  _writeIPTCEntry()
  _exifTagNames()
  _exifTagTypes()
  _exifNameTags()
  _iptcTagNames()
  _names2Tags()
  _getByte()
  _putByte()
  _getShort()
  _putShort()
  _getLong()
  _putLong()
  _putString()
  _hexDump()


Class: JpegMeta  - X-Ref

__construct($fileName)   X-Ref
Constructor

author: Sebastian Delmont <sdelmont@zonageek.com>
param: $fileName

getField($fields)   X-Ref
No description

setField($field, $value)   X-Ref
Convinience function to set nearly all available Data
through one function

author: Andreas Gohr <andi@splitbrain.org>
param: string $field field name
param: string $value
return: bool success or fail

deleteField($field)   X-Ref
Convinience function to delete nearly all available Data
through one function

author: Andreas Gohr <andi@splitbrain.org>
param: string $field field name
return: bool

getDateField($field)   X-Ref
Return a date field

author: Andreas Gohr <andi@splitbrain.org>
param: string $field
return: false|string

getFileField($field)   X-Ref
Return a file info field

author: Andreas Gohr <andi@splitbrain.org>
param: string $field field name
return: false|string

getCamera()   X-Ref
Return the camera info (Maker and Model)

author: Andreas Gohr <andi@splitbrain.org>
return: false|string

getShutterSpeed()   X-Ref
Return shutter speed as a ratio

author: Joe Lapp <joe.lapp@pobox.com>
return: string

getExifField($field)   X-Ref
Return an EXIF field

author: Sebastian Delmont <sdelmont@zonageek.com>
param: string $field field name
return: false|string

getXmpField($field)   X-Ref
Return an XMP field

author: Hakan Sandell <hakan.sandell@mydata.se>
param: string $field field name
return: false|string

getAdobeField($field)   X-Ref
Return an Adobe Field

author: Sebastian Delmont <sdelmont@zonageek.com>
param: string $field field name
return: false|string

getIPTCField($field)   X-Ref
Return an IPTC field

author: Sebastian Delmont <sdelmont@zonageek.com>
param: string $field field name
return: false|string

setExifField($field, $value)   X-Ref
Set an EXIF field

author: Sebastian Delmont <sdelmont@zonageek.com>
author: Joe Lapp <joe.lapp@pobox.com>
param: string $field field name
param: string $value
return: bool

setAdobeField($field, $value)   X-Ref
Set an Adobe Field

author: Sebastian Delmont <sdelmont@zonageek.com>
param: string $field field name
param: string $value
return: bool

getResizeRatio($maxwidth,$maxheight=0)   X-Ref
Calculates the multiplier needed to resize the image to the given
dimensions

author: Andreas Gohr <andi@splitbrain.org>
param: int $maxwidth
param: int $maxheight
return: float|int

setIPTCField($field, $value)   X-Ref
Set an IPTC field

author: Sebastian Delmont <sdelmont@zonageek.com>
param: string $field field name
param: string $value
return: bool

deleteExifField($field)   X-Ref
Delete an EXIF field

author: Sebastian Delmont <sdelmont@zonageek.com>
param: string $field field name
return: bool

deleteAdobeField($field)   X-Ref
Delete an Adobe field

author: Sebastian Delmont <sdelmont@zonageek.com>
param: string $field field name
return: bool

deleteIPTCField($field)   X-Ref
Delete an IPTC field

author: Sebastian Delmont <sdelmont@zonageek.com>
param: string $field field name
return: bool

getTitle($max=80)   X-Ref
Get the image's title, tries various fields

author: Andreas Gohr <andi@splitbrain.org>
param: int $max maximum number chars (keeps words)
return: false|string

getDates()   X-Ref
Gather various date fields

author: Sebastian Delmont <sdelmont@zonageek.com>
return: array|bool

getWidth()   X-Ref
Get the image width, tries various fields

author: Sebastian Delmont <sdelmont@zonageek.com>
return: false|string

getHeight()   X-Ref
Get the image height, tries various fields

author: Sebastian Delmont <sdelmont@zonageek.com>
return: false|string

getDimStr()   X-Ref
Get an dimension string for use in img tag

author: Sebastian Delmont <sdelmont@zonageek.com>
return: false|string

hasThumbnail($which = 'any')   X-Ref
Checks for an embedded thumbnail

author: Sebastian Delmont <sdelmont@zonageek.com>
param: string $which possible values: 'any', 'exif' or 'adobe'
return: false|string

sendThumbnail($which = 'any')   X-Ref
Send embedded thumbnail to browser

author: Sebastian Delmont <sdelmont@zonageek.com>
param: string $which possible values: 'any', 'exif' or 'adobe'
return: bool

save($fileName = "")   X-Ref
Save changed Metadata

author: Sebastian Delmont <sdelmont@zonageek.com>
author: Andreas Gohr <andi@splitbrain.org>
param: string $fileName file name or empty string for a random name
return: bool

_dispose($fileName = "")   X-Ref
No description

_readJPEG()   X-Ref
No description

_parseAll()   X-Ref
No description

_writeJPEG($outputName)   X-Ref

param: string $outputName
return: bool

_writeJPEGMarker($marker, $length, &$data, $origLength)   X-Ref

param: integer $marker
param: integer $length
param: string $data
param: integer $origLength
return: bool

_parseFileInfo()   X-Ref
Gets basic info from the file - should work with non-JPEGs

author: Sebastian Delmont <sdelmont@zonageek.com>
author: Andreas Gohr <andi@splitbrain.org>

_parseMarkerJFIF()   X-Ref
No description

_parseMarkerSOF()   X-Ref
No description

_parseMarkerXmp()   X-Ref
Parses the XMP data

author: Hakan Sandell <hakan.sandell@mydata.se>

_parseXmpNode($values, &$i, &$meta, $count)   X-Ref
Parses XMP nodes by recursion

author: Hakan Sandell <hakan.sandell@mydata.se>
param: array $values
param: int $i
param: mixed $meta
param: integer $count

_parseMarkerExif()   X-Ref
No description

_readIFD($data, $base, $offset, $isBigEndian, $mode)   X-Ref

param: mixed $data
param: integer $base
param: integer $offset
param: boolean $isBigEndian
param: string $mode
return: int

_writeIFD(&$data, $pos, $offsetBase, &$entries, $isBigEndian, $hasNext)   X-Ref
No description

_parseMarkerAdobe()   X-Ref

param: boolean $isBigEndian
param: string $mode
return: array

_readIPTC(&$data, $pos = 0)   X-Ref
No description

_write8BIM(&$data, $pos, $type, $header, &$value)   X-Ref
No description

_writeIPTCEntry(&$data, $pos, $type, &$value)   X-Ref
No description

_exifTagNames($mode)   X-Ref
No description

_exifTagTypes($mode)   X-Ref
No description

_exifNameTags($mode)   X-Ref
No description

_iptcTagNames()   X-Ref
No description

_names2Tags($tags2Names)   X-Ref
No description

_getByte(&$data, $pos)   X-Ref

param: $data
param: integer $pos
return: int

_putByte(&$data, $pos, $val)   X-Ref

param: mixed $data
param: integer $pos
param: mixed $val
return: int

_getShort(&$data, $pos, $bigEndian = true)   X-Ref
No description

_putShort(&$data, $pos = 0, $val = 0, $bigEndian = true)   X-Ref
No description

_getLong(&$data, $pos, $bigEndian = true)   X-Ref

param: mixed $data
param: integer $pos
param: bool $bigEndian
return: int

_putLong(&$data, $pos, $val, $bigEndian = true)   X-Ref

param: mixed $data
param: integer $pos
param: mixed $val
param: bool $bigEndian
return: int

_putString(&$data, $pos, &$str)   X-Ref
No description

_hexDump(&$data, $start = 0, $length = -1)   X-Ref
No description