Dotclear 2.26
Loading...
Searching...
No Matches
imageMeta Class Reference

Image metadata. More...

Public Member Functions

 getMeta ()
 
 loadFile ($filename)
 

Static Public Member Functions

static readMeta ($filename)
 

Protected Member Functions

 readXMP ($filename)
 
 readIPTC ($filename)
 
 readEXIF ($filename)
 

Protected Attributes

 $xmp = []
 
 $iptc = []
 
 $exif = []
 
 $properties
 
 $xmp_reg
 
 $iptc_ref
 
 $iptc_to_property
 
 $exif_to_property
 

Detailed Description

Image metadata.

This class reads EXIF, IPTC and XMP metadata from a JPEG file.

  • Contributor: Mathieu Lecarme.

Member Function Documentation

◆ readMeta()

static readMeta (   $filename)
static

Read metadata

Returns all image metadata in an array as defined in $properties.

Parameters
string$filenameImage file path
Returns
array

Referenced by dcMedia\imageMetaCreate().

◆ getMeta()

getMeta ( )

Get metadata

Returns all image metadata in an array as defined in $properties. Should call loadFile() before.

Returns
array

References $properties.

◆ loadFile()

loadFile (   $filename)

Load file

Loads a file and read its metadata.

Parameters
string$filenameImage file path

References readIPTC(), and readXMP().

◆ readXMP()

readXMP (   $filename)
protected

Read XMP

Reads XML metadata and assigns values to $xmp.

Parameters
string$filenameImage file path

References $code, and $xmp.

Referenced by loadFile().

◆ readIPTC()

readIPTC (   $filename)
protected

Read IPTC

Reads IPTC metadata and assigns values to $iptc.

Parameters
string$filenameImage file path

References $iptc.

Referenced by loadFile().

◆ readEXIF()

readEXIF (   $filename)
protected

Read EXIF

Reads EXIF metadata and assigns values to $exif.

Parameters
string$filenameImage file path

Field Documentation

◆ $xmp

$xmp = []
protected

Referenced by readXMP().

◆ $iptc

$iptc = []
protected

Referenced by readIPTC().

◆ $exif

$exif = []
protected

◆ $properties

$properties
protected
Initial value:
= [
'Title' => null,
'Description' => null,
'Creator' => null,
'Rights' => null,
'Make' => null,
'Model' => null,
'Exposure' => null,
'FNumber' => null,
'MaxApertureValue' => null,
'ExposureProgram' => null,
'ISOSpeedRatings' => null,
'DateTimeOriginal' => null,
'ExposureBiasValue' => null,
'MeteringMode' => null,
'FocalLength' => null,
'Lens' => null,
'CountryCode' => null,
'Country' => null,
'State' => null,
'City' => null,
'Keywords' => null,
]

array $properties Final properties array

Referenced by getMeta().

◆ $xmp_reg

$xmp_reg
protected

◆ $iptc_ref

$iptc_ref
protected
Initial value:
= [
'1#090' => 'Iptc.Envelope.CharacterSet',
'2#005' => 'Iptc.ObjectName',
'2#015' => 'Iptc.Category',
'2#020' => 'Iptc.Supplementals',
'2#025' => 'Iptc.Keywords',
'2#040' => 'Iptc.SpecialsInstructions',
'2#055' => 'Iptc.DateCreated',
'2#060' => 'Iptc.TimeCreated',
'2#062' => 'Iptc.DigitalCreationDate',
'2#063' => 'Iptc.DigitalCreationTime',
'2#080' => 'Iptc.ByLine',
'2#085' => 'Iptc.ByLineTitle',
'2#090' => 'Iptc.City',
'2#092' => 'Iptc.Sublocation',
'2#095' => 'Iptc.ProvinceState',
'2#100' => 'Iptc.CountryCode',
'2#101' => 'Iptc.CountryName',
'2#105' => 'Iptc.Headline',
'2#110' => 'Iptc.Credits',
'2#115' => 'Iptc.Source',
'2#116' => 'Iptc.Copyright',
'2#118' => 'Iptc.Contact',
'2#120' => 'Iptc.Caption',
'2#122' => 'Iptc.CaptionWriter',
]

◆ $iptc_to_property

$iptc_to_property
protected
Initial value:
= [
'Iptc.ObjectName' => 'Title',
'Iptc.Caption' => 'Description',
'Iptc.ByLine' => 'Creator',
'Iptc.Copyright' => 'Rights',
'Iptc.CountryCode' => 'CountryCode',
'Iptc.CountryName' => 'Country',
'Iptc.ProvinceState' => 'State',
'Iptc.City' => 'City',
'Iptc.Keywords' => 'Keywords',
]

◆ $exif_to_property

$exif_to_property
protected
Initial value:
= [
'ImageDescription' => 'Description',
'Artist' => 'Creator',
'Copyright' => 'Rights',
'Make' => 'Make',
'Model' => 'Model',
'ExposureTime' => 'Exposure',
'FNumber' => 'FNumber',
'MaxApertureValue' => 'MaxApertureValue',
'ExposureProgram' => 'ExposureProgram',
'ISOSpeedRatings' => 'ISOSpeedRatings',
'DateTimeOriginal' => 'DateTimeOriginal',
'ExposureBiasValue' => 'ExposureBiasValue',
'MeteringMode' => 'MeteringMode',
'FocalLength' => 'FocalLength',
]

The documentation for this class was generated from the following file: