Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- CLASS ILLI_Container_Api_Image_Iptc
- {
- // http://www.iptc.org/site/Photo_Metadata/Overview/
- // http://www.iptc.org/std/Iptc4xmpCore/1.0/specification/Iptc4xmpCore_1.0-spec-XMPSchema_8.pdf
- // http://www.iptc.org/std/IIM/4.1/specification/IIMV4.1.pdf
- const IPTC_RECORD_VERSION = 0;
- const IPTC_OBJECT_TYPE_REFERENCE = 3;
- const IPTC_OBJECT_ATTRIBUTE_REFERENCE = 4;
- const IPTC_OBJECT_NAME = 5;
- const IPTC_EDIT_STATUS = 7;
- const IPTC_EDITORIAL_UPDATE = 8;
- const IPTC_URGENCY = 10;
- const IPTC_SUBJECT_REFERENCE = 12;
- const IPTC_CATEGORY = 15;
- const IPTC_SUPPLEMENTAL_CATEGORY = 20;
- const IPTC_FIXTURE_IDENTIFIER = 22;
- const IPTC_KEYWORDS = 25;
- const IPTC_CONTENT_LOCATION_CODE = 26;
- const IPTC_CONTENT_LOCATION_NAME = 27;
- const IPTC_RELEASE_DATE = 30;
- const IPTC_RELEASE_TIME = 35;
- const IPTC_EXPIRATION_DATE = 37;
- const IPTC_EXPIRATION_TIME = 38;
- const IPTC_SPECIAL_INSTRUCTIONS = 40;
- const IPTC_ACTION_ADVISED = 42;
- const IPTC_REFERENCE_SERVICE = 45;
- const IPTC_REFERENCE_DATE = 47;
- const IPTC_REFERENCE_NUMBER = 50;
- const IPTC_CREATED_DATE = 55;
- const IPTC_CREATED_TIME = 60;
- const IPTC_DIGITAL_CREATED_DATE = 62;
- const IPTC_DIGITAL_CREATED_TIME = 63;
- const IPTC_ORIGINATING_PROGRAM = 65;
- const IPTC_PROGRAM_VERSION = 70;
- const IPTC_OBJECT_CYCLE = 75;
- const IPTC_BYLINE = 80;
- const IPTC_BYLINE_TITLE = 85;
- const IPTC_CITY = 90;
- const IPTC_SUBLOCATION = 92;
- const IPTC_PROVINCE_STATE = 95;
- const IPTC_COUNTRY_CODE = 100;
- const IPTC_COUNTRY_NAME = 101;
- const IPTC_ORIGINAL_TRANSMISSION_REFERENCE = 103;
- const IPTC_HEADLINE = 105;
- const IPTC_CREDIT = 110;
- const IPTC_SOURCE = 115;
- const IPTC_COPYRIGHT_NOTICE = 116;
- const IPTC_CONTACT = 118;
- const IPTC_CAPTION = 120;
- const IPTC_WRITER_EDITOR = 122;
- const IPTC_RASTERIZED_CAPTION = 125;
- const IPTC_IMAGE_TYPE = 130;
- const IPTC_IMAGE_ORIENTATION = 131;
- const IPTC_LANGUAGE_IDENT = 135;
- const IPTC_AUDIO_TYPE = 150;
- const IPTC_AUDIO_SAMPLING_RATE = 151;
- const IPTC_AUDIO_SAMPLING_RESOLUTION = 152;
- const IPTC_AUDIO_SAMPLING_DURATION = 153;
- const IPTC_AUDIO_SAMPLING_OUTCUE = 154;
- const IPTC_OBJECTDATA_PREVIEW_FILE_FORMAT = 200;
- const IPTC_OBJECTDATA_PREVIEW_FILE_FORMAT_VERSION = 201;
- const IPTC_OBJECTDATA_PREVIEW_FILE_FORMAT_DATA = 202;
- const RECORD = 2;
- private $metatable = array
- (
- 'version' => self::IPTC_RECORD_VERSION,
- 'objecttypereference' => self::IPTC_OBJECT_TYPE_REFERENCE,
- 'objectattributereference' => self::IPTC_OBJECT_ATTRIBUTE_REFERENCE,
- 'objectname' => self::IPTC_OBJECT_NAME,
- 'editstatus' => self::IPTC_EDIT_STATUS,
- 'editorialupdate' => self::IPTC_EDITORIAL_UPDATE,
- 'urgency' => self::IPTC_URGENCY,
- 'subjectreference' => self::IPTC_SUBJECT_REFERENCE,
- 'category' => self::IPTC_CATEGORY,
- 'supplementalcategory' => self::IPTC_SUPPLEMENTAL_CATEGORY,
- 'fixtureident' => self::IPTC_FIXTURE_IDENTIFIER,
- 'keywords' => self::IPTC_KEYWORDS,
- 'contentlocationcode' => self::IPTC_CONTENT_LOCATION_CODE,
- 'contentlocationname' => self::IPTC_CONTENT_LOCATION_NAME,
- 'releasedate' => self::IPTC_RELEASE_DATE,
- 'releasetime' => self::IPTC_RELEASE_TIME,
- 'expirationdate' => self::IPTC_EXPIRATION_DATE,
- 'expirationtime' => self::IPTC_EXPIRATION_TIME,
- 'specialinstructions' => self::IPTC_SPECIAL_INSTRUCTIONS,
- 'actionadvised' => self::IPTC_ACTION_ADVISED,
- 'referenceservice' => self::IPTC_REFERENCE_SERVICE,
- 'referencedate' => self::IPTC_REFERENCE_DATE,
- 'referencenumber' => self::IPTC_REFERENCE_NUMBER,
- 'createddate' => self::IPTC_CREATED_DATE,
- 'createdtime' => self::IPTC_CREATED_TIME,
- 'digitalcreateddate' => self::IPTC_DIGITAL_CREATED_DATE,
- 'digitalcreatedtime' => self::IPTC_DIGITAL_CREATED_TIME,
- 'originatingprogram' => self::IPTC_ORIGINATING_PROGRAM,
- 'programversion' => self::IPTC_PROGRAM_VERSION,
- 'objectcycle' => self::IPTC_OBJECT_CYCLE,
- 'byline' => self::IPTC_BYLINE,
- 'bylinetitle' => self::IPTC_BYLINE_TITLE,
- 'city' => self::IPTC_CITY,
- 'sublocation' => self::IPTC_SUBLOCATION,
- 'provincestate' => self::IPTC_PROVINCE_STATE,
- 'countrycode' => self::IPTC_COUNTRY_CODE,
- 'countryname' => self::IPTC_COUNTRY_NAME,
- 'originaltransmissionreference' => self::IPTC_ORIGINAL_TRANSMISSION_REFERENCE,
- 'headline' => self::IPTC_HEADLINE,
- 'credit' => self::IPTC_CREDIT,
- 'source' => self::IPTC_SOURCE,
- 'copyrightnotice' => self::IPTC_COPYRIGHT_NOTICE,
- 'contact' => self::IPTC_CONTACT,
- 'caption' => self::IPTC_CAPTION,
- 'writereditor' => self::IPTC_WRITER_EDITOR,
- 'rasterizedcaption' => self::IPTC_RASTERIZED_CAPTION,
- 'imagetype' => self::IPTC_IMAGE_TYPE,
- 'imageorientation' => self::IPTC_IMAGE_ORIENTATION,
- 'languageident' => self::IPTC_LANGUAGE_IDENT,
- 'audiotype' => self::IPTC_AUDIO_TYPE,
- 'audiosamplingrate' => self::IPTC_AUDIO_SAMPLING_RATE,
- 'audiosamplingresolution' => self::IPTC_AUDIO_SAMPLING_RESOLUTION,
- 'audiosamplingduration' => self::IPTC_AUDIO_SAMPLING_DURATION,
- 'audiosamplingoutcue' => self::IPTC_AUDIO_SAMPLING_OUTCUE,
- 'objectdatapreviewfileformat' => self::IPTC_OBJECTDATA_PREVIEW_FILE_FORMAT,
- 'objectdatapreviewfileversion' => self::IPTC_OBJECTDATA_PREVIEW_FILE_FORMAT_VERSION,
- 'objectdatapreviewfiledata' => self::IPTC_OBJECTDATA_PREVIEW_FILE_FORMAT_DATA,
- );
- private $path = NULL;
- private $origmeta = array();
- private $meta = array();
- private $iptcmeta = '';
- public function __call($name, $value)
- {
- if(substr($name, 0,4) !== 'set_')
- return $this;
- $_name = strtolower(str_replace(substr($name, 0, 4), NULL, $name));
- if(!array_key_exists($_name, $this->metatable))
- return $this;
- if(!isset($value[1]))
- $value[1] = self::RECORD;
- if(($value[1] = intval($value[1])) === 0)
- $value[1] = self::RECORD;
- $this->meta[$value[1].'#'.$this->metatable[$_name]] = $value[0];
- return $this;
- }
- public function save($path)
- {
- if(FALSE === (bool) $this->meta)
- return $this;
- if(!function_exists('iptcembed'))
- return $this;
- if(!file_exists($path))
- return $this;
- $this->path = $path;
- //foreach($this->metatable as $tag => $tagtag)
- // $this->{'set_'.$tag}(12);
- //var_dump($this->meta);
- $this->iptcmeta = '';
- foreach($this->meta as $tag => $string)
- //$this->iptcmeta .= $this->make_tag(str_pad(substr($tag, 2), 3, '0', STR_PAD_LEFT), $string, substr($tag, 0, 1));
- $this->iptcmeta .= $this->make_tag(substr($tag, 2), $string, substr($tag, 0, 1));
- $content = iptcembed($this->iptcmeta, $this->path);
- file_put_contents($this->path, $content);
- //var_dump($this->read($this->path));
- //die();
- return $this;
- }
- private function make_tag($data, $value, $record = self::RECORD)
- {
- $length = strlen($value);
- $retval = chr(0x1C) . chr($record) . chr($data);
- if($length < 0x8000)
- {
- $retval .= chr($length >> 8) . chr($length & 0xFF);
- }
- else
- {
- $retval .= chr(0x80) .
- chr(0x04) .
- chr(($length >> 24) & 0xFF) .
- chr(($length >> 16) & 0xFF) .
- chr(($length >> 8) & 0xFF) .
- chr($length & 0xFF);
- }
- return $retval . $value;
- }
- private function read($path)
- {
- if(!function_exists('iptcparse'))
- return $this;
- if(!file_exists($path))
- return $this;
- $size = getimagesize($path, $info);
- if(!is_array($info))
- return $this;
- if(!array_key_exists('APP13', $info))
- return $this;
- $iptc = iptcparse($info['APP13']);
- $_iptc = array();
- foreach($iptc as $data => $value)
- $_iptc[$data] = (is_array($value) ? implode('; ', $value) : $value);
- $this->origmeta = $_iptc;
- return $_iptc;
- }
- public function import($path)
- {
- $orig = new self;
- $this->meta = $orig->read($path);
- return $this;
- }
- public function test()
- {
- /*
- http://www.iptc.org/std/IIM/4.1/specification/IIMV4.1.pdf
- */
- /*
- 2:00 Record Version
- Mandatory, not repeatable, two octets.
- A binary number identifying the version of the Information
- Interchange Model, Part II (Record 2:xx), utilised by the provider.
- Version numbers are assigned by IPTC and NAA.
- The version number of this record is four (4).
- */
- $this->set_version('4');
- /*
- 2:03 Object Type Reference
- Not repeatable, 3-67 octets, consisting of 2 numeric characters
- followed by a colon and an optional text part of up to 64 octets.
- The Object Type is used to distinguish between different types
- of objects within the IIM.
- The first part is a number representing a language independent
- international reference to an Object Type followed by a colon
- separator.
- The second part, if used, is a text representation of the Object
- Type Number (maximum 64 octets) consisting of graphic
- characters plus spaces either in English, as defined in Appendix
- G, or in the language of the service as indicated in DataSet 2:135
- A list of Object Type Numbers and Names and their
- corresponding definitions will be maintained by the IPTC. See
- Appendix G.
- */
- $this->set_objecttypereference('objecttypereference');
- /*
- 2:04 Object Attribute Reference
- Repeatable, 4-68 octets, consisting of 3 numeric characters
- followed by a colon and an optional text part of up to 64 octets.
- The Object Attribute defines the nature of the object
- independent of the Subject.
- The first part is a number representing a language independent
- international reference to an Object Attribute followed by a colon
- separator.
- The second part, if used, is a text representation of the Object
- Attribute Number ( maximum 64 octets) consisting of graphic
- characters plus spaces either in English, as defined in Appendix
- G, or in the language of the service as indicated in DataSet 2:135
- A registry of Object Attribute Numbers and Names and their
- corresponding definitions (if available) will be maintained by the
- IPTC in different languages, with translations as supplied by
- members. See Appendix G.
- */
- $this->set_objectattributereference('objectattributereference');
- /*
- 2:05 Object Name
- Not repeatable, maximum 64 octets, consisting of graphic characters
- plus spaces.
- Used as a shorthand reference for the object. Changes to existing
- data, such as updated stories or new crops on photos,
- should be identified in Edit Status.
- Examples:
- "Wall St."
- "Ferry Sinks"
- */
- $this->set_objectname('objectname');
- /*
- 2:07 Edit Status
- Not repeatable. Maximum 64 octets, consisting of graphic
- characters plus spaces.
- Status of the objectdata, according to the practice of the
- provider.
- Examples:
- "Lead"
- "CORRECTION"
- */
- $this->set_editstatus('editstatus');
- /*
- 2:08 Editorial Update
- Not repeatable, 2 octets, consisting of numeric characters.
- Indicates the type of update that this object provides to a
- previous object. The link to the previous object is made using
- the ARM (DataSets 1:120 and 1:122), according to the practices
- of the provider.
- Possible values:
- 01 Additional language. Signifies that the accompanying
- Record 2 DataSets repeat information from another object
- in a different natural language (as indicated by DataSet
- 2:135).
- */
- $this->set_editorialupdate('editorialupdate');
- /*
- 2:10 Urgency
- Not repeatable, one octet, consisting of a numeric character.
- Specifies the editorial urgency of content and not necessarily the
- envelope handling priority (see 1:60, Envelope Priority).
- The '1' is most urgent, '5' normal and '8' denotes the
- least-urgent copy.
- The numerals '9' and '0' are reserved for future use.
- */
- $this->set_urgency('5');
- /*
- 2:12 Subject Reference
- Repeatable. Minimum of 13 and maximum of 236 octets
- consisting of graphic characters. Colon ‘:’ is only allowed as
- specified, the asterisk ‘*’ and question mark ‘?’ are not allowed,
- nor are the octet values 42 and 63.
- The character encoding used for this dataset must encode the
- colon ':' using octet value 58, and must not use this octet value
- for any other purpose.
- The Subject Reference is a structured definition of the subject
- matter. It must contain an IPR (default value is "IPTC"), an 8
- digit Subject Reference Number and an optional Subject Name,
- Subject Matter Name and Subject Detail Name. Each part of the
- Subject reference is separated by a colon (:). The Subject
- Reference Number contains three parts, a 2 digit Subject
- Number, a 3 digit Subject Matter Number and a 3 digit Subject
- Detail Number thus providing unique identification of the
- object's subject.
- If the Subject Matter or Subject Detail is not defined then a value
- of 000 is used for the Subject Matter Number and/or Subject
- Detail Number as appropriate. (See Appendices H and I).
- The DataSet may be repeated when the objectdata content is
- relevant to several subjects of news interest. It can be
- independent of provider and for any media form. The provider
- must either use the IPTC scheme or one that has been defined
- and published by the provider.
- The construction of the Subject Reference is as follows:
- • Information Provider Reference (IPR)
- A name, registered with the IPTC/NAA, identifying the
- provider that provides an indicator of the SDR content.
- The default value for the IPR is "IPTC" and is mandatory if
- the Subject Reference exists in the IPTC coding
- scheme as displayed in Appendices H - J.
- Individual registered Information Providers may at their
- discretion extend the Subject Reference lists. However, they
- may only add to the subject matter and/or subject detail included
- in the IPTC lists, and must identify this by using their registered
- IPR.The IPTC Subject list may not be extended.
- • Subject Reference Number
- Provides a numeric code to indicate the Subject Name plus
- optional Subject Matter and Subject Detail Names in the
- language of the service. Subject Reference Numbers consist
- of 8 octets in the range 01000000 to 17999999 and
- represent a language independent international reference to
- a Subject. A Subject is identified by its Reference Number
- and corresponding Names taken from a standard lists given
- in Appendix H,I &J.These lists are the English language
- reference versions.
- • Subject Name
- The third part, if used, is a text representation of the Subject
- Number (maximum 64 octets) consisting of graphic
- characters plus spaces either in English, as defined in
- Appendix H, or in the language of the service as indicated in
- DataSet 2:135
- The Subject identifies the general content of the objectdata
- as determined by the provider.
- • Subject Matter Name
- The fourth part, if used, is a text representation of the
- Subject Matter Number (maximum 64 octets) consisting of
- graphic characters plus spaces either in English, as defined
- in Appendix I, or in the language of the service as indicated
- in DataSet 2:135
- A Subject Matter further refines the Subject of a News
- Object.
- • Subject Detail Name
- The fifth part, if used, is a text representation of the Subject
- Detail Number (maximum 64 octets) consisting of graphic
- characters plus spaces either in English, as defined in
- Appendix J, or in the language of the service as indicated in
- DataSet 2:135
- A Subject Detail further refines the Subject Matter of a News
- Object. A registry of Subject Reference Numbers, Subject
- Matter Names and Subject Detail Names, descriptions (if
- available) and their corresponding parent Subjects will be held
- by the IPTC in different languages, with translations as supplied
- by members. See Appendices I and J.
- */
- $this->set_subjectreference('subjectreference');
- /*
- 2:15 Category
- Not repeatable, maximum three octets, consisting of alphabetic
- characters.
- Identifies the subject of the objectdata in the opinion of the
- provider.
- A list of categories will be maintained by a regional registry,
- where available, otherwise by the provider.
- Note: Use of this DataSet is Deprecated. It is likely that this
- DataSet will not be included in further versions of the IIM.
- */
- $this->set_category('category');
- /*
- 2:20 Supplemental Category
- Repeatable, maximum 32 octets, consisting of graphic characters
- plus spaces.
- Supplemental categories further refine the subject of an
- objectdata. Only a single supplemental category may be
- contained in each DataSet. A supplemental category may include
- any of the recognised categories as used in 2:15. Otherwise,
- selection of supplemental categories are left to the
- provider.
- Examples:
- "NHL" (National Hockey League)
- "Fußball"
- Note: Use of this DataSet is Deprecated. It is likely that this
- DataSet will not be included in further versions of the IIM.
- */
- $this->set_supplementalcategory('category1 category2'); // ??
- /*
- 2:22 Fixture Identifier
- Not repeatable, maximum 32 octets, consisting of graphic characters.
- Identifies objectdata that recurs often and predictably. Enables
- users to immediately find or recall such an object.
- Example:
- "EUROWEATHER"
- */
- $this->set_fixtureident('fixtureident');
- /*
- 2:25 Keywords
- Repeatable, maximum 64 octets, consisting of graphic characters
- plus spaces.
- Used to indicate specific information retrieval words.
- Each keyword uses a single Keywords DataSet. Multiple keywords
- use multiple Keywords DataSets.
- It is expected that a provider of various types of data that are related
- in subject matter uses the same keyword, enabling the receiving
- system or subsystems to search across all types of data
- for related material.
- Examples:
- "GRAND PRIX"
- "AUTO"
- */
- $this->set_keywords('keyword1; keyword2'); // ??
- /*
- 2:26 Content Location Code
- Repeatable, 3 octets consisting of alphabetic characters.
- Indicates the code of a country/geographical location referenced
- by the content of the object.
- Where ISO has established an appropriate country code under
- ISO 3166, that code will be used. When ISO3166 does not
- adequately provide for identification of a location or a country,
- e.g. ships at sea, space, IPTC will assign an appropriate threecharacter
- code under the provisions of ISO3166 to avoid
- conflicts. (see Appendix D) .
- If used in the same object with DataSet 2:27, must immediately
- precede and correspond to it.
- */
- $this->set_contentlocationcode('contentlocationcode');
- /*
- 2:27 Content Location Name
- Repeatable, maximum 64 octets, consisting of graphic characters
- plus spaces.
- Provides a full, publishable name of a country/geographical
- location referenced by the content of the object, according to
- guidelines of the provider.
- If used in the same object with DataSet 2:26, must immediately
- follow and correspond to it.
- */
- $this->set_contentlocationname('contentlocationname');
- /*
- 2:30 Release Date
- Not repeatable, eight octets, consisting of numeric characters.
- Designates in the form CCYYMMDD the earliest date the
- provider intends the object to be used. Follows ISO 8601 standard.
- Example:
- "19890317" indicates data for release on 17 March 1989.
- */
- $this->set_releasedate('20110101');
- /*
- 2:35 Release Time
- Not repeatable, 11 octets, consisting of graphic characters.
- Designates in the form HHMMSS±HHMM the earliest time the
- provider intends the object to be used. Follows ISO 8601 standard.
- Example:
- "090000-0500" indicates object for use after
- 0900 in New York (five hours behind UTC)
- */
- $this->set_releasetime('060402+0100');
- /*
- 2:37 Expiration Date
- Not repeatable, eight octets, consisting of numeric characters.
- Designates in the form CCYYMMDD the latest date the provider
- or owner intends the objectdata to be used. Follows ISO 8601
- standard.
- Example:
- “19940317” indicates an objectdata that should not be
- used after 17 March 1994.
- */
- $this->set_expirationdate('20111231');
- /*
- 2:38 Expiration Time
- Not repeatable, 11 octets, consisting of graphic characters.
- Designates in the form HHMMSS±HHMM the latest time the
- provider or owner intends the objectdata to be used. Follows
- ISO 8601 standard.
- Example:
- "090000-0500" indicates an objectdata that should not
- be used after 0900 in New York (five hours behind
- UTC).
- Expiration date and time have uses beyond audio data. Weather
- forecasts, for example, typically carry expiration dates and times.
- */
- $this->set_expirationtime('010203+0100');
- /*
- 2:40 Special Instructions
- Not repeatable, maximum 256 octets, consisting of graphic characters
- plus spaces.
- Other editorial instructions concerning the use of the objectdata,
- such as embargoes and warnings.
- Examples:
- "SECOND OF FOUR STORIES"
- "3 Pictures follow"
- "Argentina OUT"
- */
- $this->set_specialinstructions('specialinstructions');
- /*
- 2:42 Action Advised
- Not repeatable, 2 octets, consisting of numeric characters.
- Indicates the type of action that this object provides to a
- previous object. The link to the previous object is made using
- the ARM (DataSets 1:120 and 1:122), according to the practices
- of the provider.
- Possible values:
- 01 Object Kill.
- Signifies that the provider wishes the holder of
- a copy of the referenced object make no further use of
- that information and take steps to prevent further
- distribution thereof. Implies that any use of the object
- might result in embarrassment or other exposure of the
- provider and/or recipient.
- 02 Object Replace.
- Signifies that the provider wants to
- replace the referenced object with the object provided
- under the current envelope.
- 03 Object Append.
- Signifies that the provider wants to
- append to the referenced object information provided in
- the objectdata of the current envelope.
- 04 Object Reference.
- Signifies that the provider wants to
- make reference to objectdata in a different envelope.
- */
- $this->set_actionadvised('02');
- /*
- Note:
- The following DataSets 2:45, 2:47 and 2:50, when repeated, will be repeated
- together, i.e. in sequential triplets.
- */
- /*
- 2:45 Reference Service
- Optional, repeatable, format identical with 1:30.
- Identifies the Service Identifier of a prior envelope to which the
- current object refers.
- Must be followed by 2:47 and 2:50 with repetition occurring in
- sequential triplets. Used together, 2:45, 2:47 and 2:50 indicate
- that the current object refers to the content of a prior envelope.
- */
- $this->set_referenceservice('referenceservice');
- /*
- 2:47 Reference Date
- Mandatory if 2:45 exists and otherwise not allowed. Repeatable,
- format identical with 1:70
- Identifies the date of a prior envelope to which the current
- object refers.
- */
- $this->set_referencedate('20100101');
- /*
- 2:50 Reference Number
- Mandatory if 2:45 exists and otherwise not allowed. Repeatable,
- format identical with 1:40.
- Identifies the Envelope Number of a prior envelope to which the
- current object refers.
- */
- $this->set_referencenumber('referencenumber');
- /*
- 2:55 Date Created
- Not repeatable, eight octets, consisting of numeric characters.
- Represented in the form CCYYMMDD to designate the date the
- intellectual content of the objectdata was created rather than the
- date of the creation of the physical representation. Follows ISO
- 8601 standard. Where the month or day cannot be determined,
- the information will be represented by “00”. Where the year
- cannot be determined, the information for century and year will
- be represented by “00”.
- Thus a photo taken during the American Civil War would carry a
- creation date during that epoch (1861-1865) rather than the date
- the photo was digitised for archiving.
- Example:
- "19900127" indicates the intellectual content created on
- 27th January 1990.
- */
- $this->set_createddate('20100202');
- /*
- 2:60 Time Created
- Not repeatable, 11 octets, consisting of graphic characters.
- Represented in the form HHMMSS±HHMM to designate the
- time the intellectual content of the objectdata current source
- material was created rather than the creation of the physical
- representation. Follows ISO 8601 standard.
- Where the time cannot be precisely determined, the closest
- approximation should be used.
- Example:
- "133015+0100" indicates that the object intellectual
- content was created at 1:30 p.m. and 15 seconds Frankfurt
- time, one hour ahead of UTC.
- */
- $this->set_createdtime('060402+0100');
- /*
- 2:62 Digital Creation Date
- Not repeatable, eight octets, consisting of numeric characters.
- Represented in the form CCYYMMDD to designate the date the
- digital representation of the objectdata was created. Follows ISO
- 8601 standard. Thus a photo taken during the American Civil
- War would carry a Digital Creation Date within the past several
- years rather than the date where the image was captured on
- film, glass plate or other substrate during that epoch (1861-
- 1865).
- Example:
- "19900127" indicates digital form of the objectdata was
- created on 27th January 1990.
- */
- $this->set_digitalcreateddate('20090202');
- /*
- 2:63 Digital Creation Time
- Not repeatable, 11 octets, consisting of graphic characters.
- Represented in the form HHMMSS±HHMM to designate the
- time the digital representation of the objectdata was created.
- Follows ISO 8601 standard.
- Example:
- "133015+0100" indicates that the digital form of the
- objectdata was created at 1:30 p.m. and 15 seconds
- Frankfurt time, one hour ahead of UTC.
- */
- $this->set_digitalcreatedtime('060402+0100');
- /*
- 2:65 Originating Program
- Not repeatable, maximum of 32 octets, consisting of graphic
- characters plus spaces.
- Identifies the type of program used to originate the objectdata.
- Examples:
- "Word Perfect"
- "SCITEX"
- "MacDraw"
- */
- $this->set_originatingprogram('ILLI');
- /*
- 2:70 Program Version
- Not repeatable, maximum of 10 octets, consisting of graphic
- characters plus spaces.
- Used to identify the version of the program mentioned in 2:65.
- DataSet 2:70 is invalid if 2:65 is not present.
- */
- $this->set_programversion('5.2');
- /*
- 2:75 Object Cycle
- Not repeatable, one octet, consisting of an alphabetic character.
- Where:
- 'a' = morning
- 'p' = evening
- 'b' = both
- Virtually only used in North America.
- */
- $this->set_objectcycle('b');
- /*
- 2:80 By-line
- Repeatable, maximum 32 octets, consisting of graphic characters
- plus spaces.
- Contains name of the creator of the objectdata, e.g. writer, photographer
- or graphic artist.
- Examples:
- "Robert Capa"
- "Ernest Hemingway"
- "Pablo Picasso"
- */
- $this->set_byline('byline');
- /*
- 2:85 By-line Title
- Repeatable, maximum 32 octets, consisting of graphic characters
- plus spaces.
- A by-line title is the title of the creator or creators of an
- objectdata. Where used, a by-line title should follow the by-line it
- modifies.
- Examples:
- "Staff Photographer"
- "Corresponsal"
- "Envoyé Spécial"
- */
- $this->set_bylinetitle('bylinetitle');
- /*
- 2:90 City
- Not repeatable, maximum 32 octets, consisting of graphic characters
- plus spaces.
- Identifies city of objectdata origin according to guidelines established
- by the provider.
- Examples:
- "Zürich"
- "Milano"
- "New York"
- */
- $this->set_city('city');
- /*
- 2:92 Sublocation
- Not repeatable, maximum 32 octets, consisting of graphic
- characters plus spaces.
- Identifies the location within a city from which the objectdata
- originates, according to guidelines established by the provider.
- Examples:
- "Capitol Hill"
- "Maple Leaf Gardens"
- "Strandgateparken"
- */
- $this->set_sublocation('sublocation');
- /*
- 2:95 Province/State
- Not repeatable, maximum 32 octets, consisting of graphic characters
- plus spaces.
- Identifies Province/State of origin according to guidelines
- established by the provider.
- Examples:
- "WA"
- "Sussex"
- "Baden-Württenberg"
- */
- $this->set_provincestate('provincestate');
- /*
- 2:100 Country/Primary Location Code
- Not repeatable, three octets consisting of alphabetic characters.
- Indicates the code of the country/primary location where the
- intellectual property of the objectdata was created, e.g. a photo
- was taken, an event occurred.
- Where ISO has established an appropriate country code under
- ISO 3166, that code will be used. When ISO3166 does not
- adequately provide for identification of a location or a new
- country, e.g. ships at sea, space, IPTC will assign an
- appropriate three-character code under the provisions of
- ISO3166 to avoid conflicts. (see Appendix D)
- Examples:
- "USA" (United States)
- "FRA" (France)
- “XUN” (United Nations)
- */
- $this->set_countrycode('BEL');
- /*
- 2:101 Country/ Primary Location Name
- Not repeatable, maximum 64 octets, consisting of graphic
- characters plus spaces.
- Provides full, publishable, name of the country/primary location
- where the intellectual property of the objectdata was created,
- according to guidelines of the provider.
- */
- $this->set_countryname('countryname');
- /*
- 2:103 Original Transmission Reference
- Not repeatable. Maximum 32 octets, consisting of graphic characters
- plus spaces.
- A code representing the location of original transmission according
- to practices of the provider.
- Examples:
- BER-5
- PAR-12-11-01
- */
- $this->set_originaltransmissionreference('originaltransmissionreference');
- /*
- 2:105 Headline
- Not repeatable, maximum of 256 octets, consisting of graphic
- characters plus spaces.
- A publishable entry providing a synopsis of the contents of the
- objectdata.
- Example:
- "Lindbergh Lands In Paris"
- */
- $this->set_headline('headline');
- /*
- 2:110 Credit
- Not repeatable, maximum of 32 octets, consisting of graphic
- characters plus spaces.
- Identifies the provider of the objectdata, not necessarily the
- owner/creator.
- */
- $this->set_credit('All rights reserved.');
- /*
- 2:115 Source
- Not repeatable, maximum of 32 octets, consisting of graphic
- characters plus spaces.
- Identifies the original owner of the intellectual content of the
- objectdata. This could be an agency, a member of an agency or
- an individual.
- */
- $this->set_source('source');
- /*
- 2:116 Copyright Notice
- Not repeatable, maximum of 128 octets, consisting of graphic
- characters plus spaces.
- Contains any necessary copyright notice.
- */
- $this->set_copyrightnotice('copyrightnotice');
- /*
- 2:118 Contact
- Repeatable, maximum of 128 octets, consisting of graphic
- characters plus spaces.
- Identifies the person or organisation which can provide further
- background information on the objectdata.
- */
- $this->set_contact('contact');
- /*
- 2:120 Caption/Abstract
- Not repeatable, maximum of 2000 octets, consisting of graphic
- characters plus carriage-returns, linefeeds and spaces.
- A textual description of the objectdata, particularly used where
- the object is not text.
- */
- $this->set_caption('caption');
- /*
- 2:122 Writer/Editor
- Repeatable, maximum 32 octets, consisting of graphic characters
- plus spaces.
- Identification of the name of the person involved in the writing,
- editing or correcting the objectdata or caption/abstract.
- */
- $this->set_writereditor('~lvm');
- /*
- 2:131 Image Orientation
- Not repeatable, one octet, consisting of an alphabetic
- character. Allowed values are P (for Portrait), L (for Landscape)
- and S (for Square).
- Indicates the layout of the image area.
- */
- $this->set_imageorientation('L');
- /*
- 2:135 Language Identifier
- Not repeatable, two or three octets, consisting of alphabetic
- characters.
- */
- $this->set_languageident('nl');
- return $this;
- /*
- 'audiotype' => self::IPTC_AUDIO_TYPE,
- 'audiosamplingrate' => self::IPTC_AUDIO_SAMPLING_RATE,
- 'audiosamplingresolution' => self::IPTC_AUDIO_SAMPLING_RESOLUTION,
- 'audiosamplingduration' => self::IPTC_AUDIO_SAMPLING_DURATION,
- 'audiosamplingoutcue' => self::IPTC_AUDIO_SAMPLING_OUTCUE,
- 'objectdatapreviewfileformat' => self::IPTC_OBJECTDATA_PREVIEW_FILE_FORMAT,
- 'objectdatapreviewfileversion' => self::IPTC_OBJECTDATA_PREVIEW_FILE_FORMAT_VERSION,
- 'objectdatapreviewfiledata' => self::IPTC_OBJECTDATA_PREVIEW_FILE_FORMAT_DATA,
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement