[ 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>
return: bool success or fail
param: string $field field name
param: string $value

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

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

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

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

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

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

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>
return: false|string
param: string $field field name

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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>
return: false|string
param: string $which possible values: 'any', 'exif' or 'adobe'

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

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

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

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

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

_readJPEG()   X-Ref
No description

_parseAll()   X-Ref
No description

_writeJPEG($outputName)   X-Ref

return: bool
param: string $outputName

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

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

_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

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

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

_parseMarkerAdobe()   X-Ref

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

_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

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

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

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

_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

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

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

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

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

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