Skip to content

Commit 6cf01c9

Browse files
committed
Merge pull request #2 from ericduran/master
Adding other IPTC Data
2 parents 746525a + 6d73654 commit 6cf01c9

File tree

2 files changed

+76
-2
lines changed

2 files changed

+76
-2
lines changed

lib/PHPExif/Exif.php

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,76 @@ public function getAperture()
8585
return $this->data[self::SECTION_COMPUTED]['ApertureFNumber'];
8686
}
8787

88+
/**
89+
* Returns the Author
90+
*
91+
* @return string|boolean
92+
*/
93+
public function getAuthor()
94+
{
95+
if (!isset($this->data['Artist'])) {
96+
return false;
97+
}
98+
99+
return $this->data['Artist'];
100+
}
101+
102+
/**
103+
* Returns the Headline
104+
*
105+
* @return string|boolean
106+
*/
107+
public function getHeadline()
108+
{
109+
if (!isset($this->data[self::SECTION_IPTC]['headline'])) {
110+
return false;
111+
}
112+
113+
return $this->data[self::SECTION_IPTC]['headline'];
114+
}
115+
116+
/**
117+
* Returns the Credit
118+
*
119+
* @return string|boolean
120+
*/
121+
public function getCredit()
122+
{
123+
if (!isset($this->data[self::SECTION_IPTC]['credit'])) {
124+
return false;
125+
}
126+
127+
return $this->data[self::SECTION_IPTC]['credit'];
128+
}
129+
130+
/**
131+
* Returns the source
132+
*
133+
* @return string|boolean
134+
*/
135+
public function getSource()
136+
{
137+
if (!isset($this->data[self::SECTION_IPTC]['source'])) {
138+
return false;
139+
}
140+
141+
return $this->data[self::SECTION_IPTC]['source'];
142+
}
143+
144+
/**
145+
* Returns the Jobtitle
146+
*
147+
* @return string|boolean
148+
*/
149+
public function getJobtitle()
150+
{
151+
if (!isset($this->data[self::SECTION_IPTC]['jobtitle'])) {
152+
return false;
153+
}
154+
155+
return $this->data[self::SECTION_IPTC]['jobtitle'];
156+
}
157+
88158
/**
89159
* Returns the ISO speed
90160
*
@@ -315,4 +385,4 @@ public function getCreationDate()
315385

316386
return $dt;
317387
}
318-
}
388+
}

lib/PHPExif/Reader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ class Reader
5959
'keywords' => '2#025',
6060
'copyright' => '2#116',
6161
'caption' => '2#120',
62+
'headline' => '2#105',
63+
'credit' => '2#110',
64+
'source' => '2#115',
65+
'jobtitle' => '2#085'
6266
);
6367

6468

@@ -169,4 +173,4 @@ public function getIptcData($file)
169173

170174
return $arrData;
171175
}
172-
}
176+
}

0 commit comments

Comments
 (0)