PhotoCD.pm 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. #------------------------------------------------------------------------------
  2. # File: PhotoCD.pm
  3. #
  4. # Description: Read Kodak Photo CD Image Pac (PCD) metadata
  5. #
  6. # Revisions: 2012/05/07 - P. Harvey Created
  7. #
  8. # References: 1) http://pcdtojpeg.sourceforge.net/
  9. #------------------------------------------------------------------------------
  10. package Image::ExifTool::PhotoCD;
  11. use strict;
  12. use vars qw($VERSION);
  13. use Image::ExifTool qw(:DataAccess :Utils);
  14. use Image::ExifTool::Exif; # (for Composite:ImageSize)
  15. $VERSION = '1.01';
  16. sub ProcessExtData($$$);
  17. # PhotoCD info
  18. %Image::ExifTool::PhotoCD::Main = (
  19. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  20. GROUPS => { 2 => 'Image' },
  21. NOTES => 'Tags extracted from Kodak Photo CD Image Pac (PCD) files.',
  22. 7 => {
  23. Name => 'SpecificationVersion',
  24. Format => 'int8u[2]',
  25. RawConv => '$val eq "255 255" ? "n/a" : $val',
  26. ValueConv => '$val =~ tr/ /./; $val',
  27. },
  28. 9 => {
  29. Name => 'AuthoringSoftwareRelease',
  30. Format => 'int8u[2]',
  31. RawConv => '$val eq "255 255" ? "n/a" : $val',
  32. ValueConv => '$val =~ tr/ /./; $val',
  33. },
  34. 11 => {
  35. Name => 'ImageMagnificationDescriptor',
  36. Format => 'int8u[2]',
  37. ValueConv => '$val =~ tr/ /./; $val',
  38. },
  39. 13 => {
  40. Name => 'CreateDate',
  41. Format => 'int32u',
  42. Groups => { 2 => 'Time' },
  43. RawConv => '$val == 0xffffffff ? undef : $val',
  44. ValueConv => 'ConvertUnixTime($val,1)',
  45. PrintConv => '$self->ConvertDateTime($val)',
  46. },
  47. 17 => {
  48. Name => 'ModifyDate',
  49. Format => 'int32u',
  50. Groups => { 2 => 'Time' },
  51. RawConv => '$val == 0xffffffff ? undef : $val',
  52. ValueConv => 'ConvertUnixTime($val,1)',
  53. PrintConv => '$self->ConvertDateTime($val)',
  54. },
  55. 21 => {
  56. Name => 'ImageMedium',
  57. PrintConv => {
  58. 0 => 'Color negative',
  59. 1 => 'Color reversal',
  60. 2 => 'Color hard copy',
  61. 3 => 'Thermal hard copy',
  62. 4 => 'Black and white negative',
  63. 5 => 'Black and white reversal',
  64. 6 => 'Black and white hard copy',
  65. 7 => 'Internegative',
  66. 8 => 'Synthetic image',
  67. },
  68. },
  69. 22 => {
  70. Name => 'ProductType',
  71. Format => 'string[20]',
  72. ValueConv => '$val =~ s/[ \0]+$//; $val',
  73. },
  74. 42 => {
  75. Name => 'ScannerVendorID',
  76. Format => 'string[20]',
  77. ValueConv => '$val =~ s/[ \0]+$//; $val',
  78. },
  79. 62 => {
  80. Name => 'ScannerProductID',
  81. Format => 'string[16]',
  82. ValueConv => '$val =~ s/[ \0]+$//; $val',
  83. },
  84. 78 => {
  85. Name => 'ScannerFirmwareVersion',
  86. Format => 'string[4]',
  87. ValueConv => '$val =~ s/[ \0]+$//; $val',
  88. },
  89. 82 => {
  90. Name => 'ScannerFirmwareDate',
  91. Format => 'string[8]',
  92. ValueConv => '$val =~ s/[ \0]+$//; $val',
  93. },
  94. 90 => {
  95. Name => 'ScannerSerialNumber',
  96. Format => 'string[20]',
  97. ValueConv => '$val =~ s/[ \0]+$//; $val',
  98. },
  99. 110 => {
  100. Name => 'ScannerPixelSize',
  101. Format => 'undef[2]',
  102. ValueConv => 'join(".",unpack("H2H2",$val))',
  103. PrintConv => '"$val micrometers"',
  104. },
  105. 112 => {
  106. Name => 'ImageWorkstationMake',
  107. Format => 'string[20]',
  108. ValueConv => '$val =~ s/[ \0]+$//; $val',
  109. },
  110. 132 => {
  111. Name => 'CharacterSet',
  112. PrintConv => {
  113. 1 => '38 characters ISO 646',
  114. 2 => '65 characters ISO 646',
  115. 3 => '95 characters ISO 646',
  116. 4 => '191 characters ISO 8850-1',
  117. 5 => 'ISO 2022',
  118. 6 => 'Includes characters not ISO 2375 registered',
  119. },
  120. },
  121. 133 => {
  122. Name => 'CharacterEscapeSequence',
  123. Format => 'undef[32]',
  124. Binary => 1,
  125. Unknown => 1,
  126. },
  127. 165 => {
  128. Name => 'PhotoFinisherName',
  129. Format => 'string[60]',
  130. ValueConv => '$val =~ s/[ \0]+$//; $val',
  131. },
  132. 225 => {
  133. Name => 'HasSBA',
  134. Format => 'undef[3]',
  135. Hidden => 1,
  136. RawConv => '$val eq "SBA" and $$self{HasSBA} = 1; undef',
  137. },
  138. 228 => {
  139. Name => 'SceneBalanceAlgorithmRevision',
  140. Condition => '$$self{HasSBA}',
  141. Format => 'int8u[2]',
  142. ValueConv => '$val =~ tr/ /./; $val',
  143. },
  144. 230 => {
  145. Name => 'SceneBalanceAlgorithmCommand',
  146. Condition => '$$self{HasSBA}',
  147. PrintConv => {
  148. 0 => 'Neutral SBA On, Color SBA On',
  149. 1 => 'Neutral SBA Off, Color SBA Off',
  150. 2 => 'Neutral SBA On, Color SBA Off',
  151. 3 => 'Neutral SBA Off, Color SBA On',
  152. },
  153. },
  154. 325 => {
  155. Name => 'SceneBalanceAlgorithmFilmID',
  156. Condition => '$$self{HasSBA}',
  157. Format => 'int16u',
  158. PrintConv => {
  159. 1 => '3M ScotchColor AT 100',
  160. 2 => '3M ScotchColor AT 200',
  161. 3 => '3M ScotchColor HR2 400',
  162. 7 => '3M Scotch HR 200 Gen 2',
  163. 9 => '3M Scotch HR 400 Gen 2',
  164. 16 => 'Agfa Agfacolor XRS 400 Gen 1',
  165. 17 => 'Agfa Agfacolor XRG/XRS 400',
  166. 18 => 'Agfa Agfacolor XRG/XRS 200',
  167. 19 => 'Agfa Agfacolor XRS 1000 Gen 2',
  168. 20 => 'Agfa Agfacolor XRS 400 Gen 2',
  169. 21 => 'Agfa Agfacolor XRS/XRC 100',
  170. 26 => 'Fuji Reala 100 (JAPAN)',
  171. 27 => 'Fuji Reala 100 Gen 1',
  172. 28 => 'Fuji Reala 100 Gen 2',
  173. 29 => 'Fuji SHR 400 Gen 2',
  174. 30 => 'Fuji Super HG 100',
  175. 31 => 'Fuji Super HG 1600 Gen 1',
  176. 32 => 'Fuji Super HG 200',
  177. 33 => 'Fuji Super HG 400',
  178. 34 => 'Fuji Super HG 100 Gen 2',
  179. 35 => 'Fuji Super HR 100 Gen 1',
  180. 36 => 'Fuji Super HR 100 Gen 2',
  181. 37 => 'Fuji Super HR 1600 Gen 2',
  182. 38 => 'Fuji Super HR 200 Gen 1',
  183. 39 => 'Fuji Super HR 200 Gen 2',
  184. 40 => 'Fuji Super HR 400 Gen 1',
  185. 43 => 'Fuji NSP 160S (Pro)',
  186. 45 => 'Kodak Kodacolor VR 100 Gen 2',
  187. 47 => 'Kodak Gold 400 Gen 3',
  188. 55 => 'Kodak Ektar 100 Gen 1',
  189. 56 => 'Kodak Ektar 1000 Gen 1',
  190. 57 => 'Kodak Ektar 125 Gen 1',
  191. 58 => 'Kodak Royal Gold 25 RZ',
  192. 60 => 'Kodak Gold 1600 Gen 1',
  193. 61 => 'Kodak Gold 200 Gen 2',
  194. 62 => 'Kodak Gold 400 Gen 2',
  195. 65 => 'Kodak Kodacolor VR 100 Gen 1',
  196. 66 => 'Kodak Kodacolor VR 1000 Gen 2',
  197. 67 => 'Kodak Kodacolor VR 1000 Gen 1',
  198. 68 => 'Kodak Kodacolor VR 200 Gen 1',
  199. 69 => 'Kodak Kodacolor VR 400 Gen 1',
  200. 70 => 'Kodak Kodacolor VR 200 Gen 2',
  201. 71 => 'Kodak Kodacolor VRG 100 Gen 1',
  202. 72 => 'Kodak Gold 100 Gen 2',
  203. 73 => 'Kodak Kodacolor VRG 200 Gen 1',
  204. 74 => 'Kodak Gold 400 Gen 1',
  205. 87 => 'Kodak Ektacolor Gold 160',
  206. 88 => 'Kodak Ektapress 1600 Gen 1 PPC',
  207. 89 => 'Kodak Ektapress Gold 100 Gen 1 PPA',
  208. 90 => 'Kodak Ektapress Gold 400 PPB-3',
  209. 92 => 'Kodak Ektar 25 Professional PHR',
  210. 97 => 'Kodak T-Max 100 Professional',
  211. 98 => 'Kodak T-Max 3200 Professional',
  212. 99 => 'Kodak T-Max 400 Professional',
  213. 101 => 'Kodak Vericolor 400 Prof VPH',
  214. 102 => 'Kodak Vericolor III Pro',
  215. 121 => 'Konika Konica Color SR-G 3200',
  216. 122 => 'Konika Konica Color Super SR100',
  217. 123 => 'Konika Konica Color Super SR 400',
  218. 138 => 'Kodak Gold Unknown',
  219. 139 => 'Kodak Unknown Neg A- Normal SBA',
  220. 143 => 'Kodak Ektar 100 Gen 2',
  221. 147 => 'Kodak Kodacolor CII',
  222. 148 => 'Kodak Kodacolor II',
  223. 149 => 'Kodak Gold Plus 200 Gen 3',
  224. 150 => 'Kodak Internegative +10% Contrast',
  225. 151 => 'Agfa Agfacolor Ultra 50',
  226. 152 => 'Fuji NHG 400',
  227. 153 => 'Agfa Agfacolor XRG 100',
  228. 154 => 'Kodak Gold Plus 100 Gen 3',
  229. 155 => 'Konika Konica Color Super SR200 Gen 1',
  230. 156 => 'Konika Konica Color SR-G 160',
  231. 157 => 'Agfa Agfacolor Optima 125',
  232. 158 => 'Agfa Agfacolor Portrait 160',
  233. 162 => 'Kodak Kodacolor VRG 400 Gen 1',
  234. 163 => 'Kodak Gold 200 Gen 1',
  235. 164 => 'Kodak Kodacolor VRG 100 Gen 2',
  236. 174 => 'Kodak Internegative +20% Contrast',
  237. 175 => 'Kodak Internegative +30% Contrast',
  238. 176 => 'Kodak Internegative +40% Contrast',
  239. 184 => 'Kodak TMax-100 D-76 CI = .40',
  240. 185 => 'Kodak TMax-100 D-76 CI = .50',
  241. 186 => 'Kodak TMax-100 D-76 CI = .55',
  242. 187 => 'Kodak TMax-100 D-76 CI = .70',
  243. 188 => 'Kodak TMax-100 D-76 CI = .80',
  244. 189 => 'Kodak TMax-100 TMax CI = .40',
  245. 190 => 'Kodak TMax-100 TMax CI = .50',
  246. 191 => 'Kodak TMax-100 TMax CI = .55',
  247. 192 => 'Kodak TMax-100 TMax CI = .70',
  248. 193 => 'Kodak TMax-100 TMax CI = .80',
  249. 195 => 'Kodak TMax-400 D-76 CI = .40',
  250. 196 => 'Kodak TMax-400 D-76 CI = .50',
  251. 197 => 'Kodak TMax-400 D-76 CI = .55',
  252. 198 => 'Kodak TMax-400 D-76 CI = .70',
  253. 214 => 'Kodak TMax-400 D-76 CI = .80',
  254. 215 => 'Kodak TMax-400 TMax CI = .40',
  255. 216 => 'Kodak TMax-400 TMax CI = .50',
  256. 217 => 'Kodak TMax-400 TMax CI = .55',
  257. 218 => 'Kodak TMax-400 TMax CI = .70',
  258. 219 => 'Kodak TMax-400 TMax CI = .80',
  259. 224 => '3M ScotchColor ATG 400/EXL 400',
  260. 266 => 'Agfa Agfacolor Optima 200',
  261. 267 => 'Konika Impressa 50',
  262. 268 => 'Polaroid Polaroid CP 200',
  263. 269 => 'Konika Konica Color Super SR200 Gen 2',
  264. 270 => 'ILFORD XP2 400',
  265. 271 => 'Polaroid Polaroid Color HD2 100',
  266. 272 => 'Polaroid Polaroid Color HD2 400',
  267. 273 => 'Polaroid Polaroid Color HD2 200',
  268. 282 => '3M ScotchColor ATG-1 200',
  269. 284 => 'Konika XG 400',
  270. 307 => 'Kodak Universal Reversal B/W',
  271. 308 => 'Kodak RPC Copy Film Gen 1',
  272. 312 => 'Kodak Universal E6',
  273. 324 => 'Kodak Gold Ultra 400 Gen 4',
  274. 328 => 'Fuji Super G 100',
  275. 329 => 'Fuji Super G 200',
  276. 330 => 'Fuji Super G 400 Gen 2',
  277. 333 => 'Kodak Universal K14',
  278. 334 => 'Fuji Super G 400 Gen 1',
  279. 366 => 'Kodak Vericolor HC 6329 VHC',
  280. 367 => 'Kodak Vericolor HC 4329 VHC',
  281. 368 => 'Kodak Vericolor L 6013 VPL',
  282. 369 => 'Kodak Vericolor L 4013 VPL',
  283. 418 => 'Kodak Ektacolor Gold II 400 Prof',
  284. 430 => 'Kodak Royal Gold 1000',
  285. 431 => 'Kodak Kodacolor VR 200 / 5093',
  286. 432 => 'Kodak Gold Plus 100 Gen 4',
  287. 443 => 'Kodak Royal Gold 100',
  288. 444 => 'Kodak Royal Gold 400',
  289. 445 => 'Kodak Universal E6 auto-balance',
  290. 446 => 'Kodak Universal E6 illum. corr.',
  291. 447 => 'Kodak Universal K14 auto-balance',
  292. 448 => 'Kodak Universal K14 illum. corr.',
  293. 449 => 'Kodak Ektar 100 Gen 3 SY',
  294. 456 => 'Kodak Ektar 25',
  295. 457 => 'Kodak Ektar 100 Gen 3 CX',
  296. 458 => 'Kodak Ektapress Plus 100 Prof PJA-1',
  297. 459 => 'Kodak Ektapress Gold II 100 Prof',
  298. 460 => 'Kodak Pro 100 PRN',
  299. 461 => 'Kodak Vericolor HC 100 Prof VHC-2',
  300. 462 => 'Kodak Prof Color Neg 100',
  301. 463 => 'Kodak Ektar 1000 Gen 2',
  302. 464 => 'Kodak Ektapress Plus 1600 Pro PJC-1',
  303. 465 => 'Kodak Ektapress Gold II 1600 Prof',
  304. 466 => 'Kodak Super Gold 1600 GF Gen 2',
  305. 467 => 'Kodak Kodacolor 100 Print Gen 4',
  306. 468 => 'Kodak Super Gold 100 Gen 4',
  307. 469 => 'Kodak Gold 100 Gen 4',
  308. 470 => 'Kodak Gold III 100 Gen 4',
  309. 471 => 'Kodak Funtime 100 FA',
  310. 472 => 'Kodak Funtime 200 FB',
  311. 473 => 'Kodak Kodacolor VR 200 Gen 4',
  312. 474 => 'Kodak Gold Super 200 Gen 4',
  313. 475 => 'Kodak Kodacolor 200 Print Gen 4',
  314. 476 => 'Kodak Super Gold 200 Gen 4',
  315. 477 => 'Kodak Gold 200 Gen 4',
  316. 478 => 'Kodak Gold III 200 Gen 4',
  317. 479 => 'Kodak Gold Ultra 400 Gen 5',
  318. 480 => 'Kodak Super Gold 400 Gen 5',
  319. 481 => 'Kodak Gold 400 Gen 5',
  320. 482 => 'Kodak Gold III 400 Gen 5',
  321. 483 => 'Kodak Kodacolor 400 Print Gen 5',
  322. 484 => 'Kodak Ektapress Plus 400 Prof PJB-2',
  323. 485 => 'Kodak Ektapress Gold II 400 Prof G5',
  324. 486 => 'Kodak Pro 400 PPF-2',
  325. 487 => 'Kodak Ektacolor Gold II 400 EGP-4',
  326. 488 => 'Kodak Ektacolor Gold 400 Prof EGP-4',
  327. 489 => 'Kodak Ektapress Gold II Multspd PJM',
  328. 490 => 'Kodak Pro 400 MC PMC',
  329. 491 => 'Kodak Vericolor 400 Prof VPH-2',
  330. 492 => 'Kodak Vericolor 400 Plus Prof VPH-2',
  331. 493 => 'Kodak Unknown Neg Product Code 83',
  332. 505 => 'Kodak Ektacolor Pro Gold 160 GPX',
  333. 508 => 'Kodak Royal Gold 200',
  334. 517 => 'Kodak 4050000000',
  335. 519 => 'Kodak Gold Plus 100 Gen 5',
  336. 520 => 'Kodak Gold 800 Gen 1',
  337. 521 => 'Kodak Gold Super 200 Gen 5',
  338. 522 => 'Kodak Ektapress Plus 200 Prof',
  339. 523 => 'Kodak 4050 E6 auto-balance',
  340. 524 => 'Kodak 4050 E6 ilum. corr.',
  341. 525 => 'Kodak 4050 K14',
  342. 526 => 'Kodak 4050 K14 auto-balance',
  343. 527 => 'Kodak 4050 K14 ilum. corr.',
  344. 528 => 'Kodak 4050 Reversal B&W',
  345. 532 => 'Kodak Advantix 200',
  346. 533 => 'Kodak Advantix 400',
  347. 534 => 'Kodak Advantix 100',
  348. 535 => 'Kodak Ektapress Multspd Prof PJM-2',
  349. 536 => 'Kodak Kodacolor VR 200 Gen 5',
  350. 537 => 'Kodak Funtime 200 FB Gen 2',
  351. 538 => 'Kodak Commercial 200',
  352. 539 => 'Kodak Royal Gold 25 Copystand',
  353. 540 => 'Kodak Kodacolor DA 100 Gen 5',
  354. 545 => 'Kodak Kodacolor VR 400 Gen 2',
  355. 546 => 'Kodak Gold 100 Gen 6',
  356. 547 => 'Kodak Gold 200 Gen 6',
  357. 548 => 'Kodak Gold 400 Gen 6',
  358. 549 => 'Kodak Royal Gold 100 Gen 2',
  359. 550 => 'Kodak Royal Gold 200 Gen 2',
  360. 551 => 'Kodak Royal Gold 400 Gen 2',
  361. 552 => 'Kodak Gold Max 800 Gen 2',
  362. 554 => 'Kodak 4050 E6 high contrast',
  363. 555 => 'Kodak 4050 E6 low saturation high contrast',
  364. 556 => 'Kodak 4050 E6 low saturation',
  365. 557 => 'Kodak Universal E-6 Low Saturation',
  366. 558 => 'Kodak T-Max T400 CN',
  367. 563 => 'Kodak Ektapress PJ100',
  368. 564 => 'Kodak Ektapress PJ400',
  369. 565 => 'Kodak Ektapress PJ800',
  370. 567 => 'Kodak Portra 160NC',
  371. 568 => 'Kodak Portra 160VC',
  372. 569 => 'Kodak Portra 400NC',
  373. 570 => 'Kodak Portra 400VC',
  374. 575 => 'Kodak Advantix 100-2',
  375. 576 => 'Kodak Advantix 200-2',
  376. 577 => 'Kodak Advantix Black & White + 400',
  377. 578 => 'Kodak Ektapress PJ800-2',
  378. },
  379. },
  380. 331 => {
  381. Name => 'CopyrightStatus',
  382. Condition => '$$self{HasSBA}',
  383. RawConv => '$$self{CopyrightStatus} = $val',
  384. PrintConv => {
  385. 1 => 'Restrictions apply',
  386. 0xff => 'Not specified',
  387. },
  388. },
  389. 332 => {
  390. Name => 'CopyrightFileName',
  391. Condition => '$$self{CopyrightStatus} and $$self{CopyrightStatus} == 1',
  392. Format => 'string[12]',
  393. ValueConv => '$val =~ s/[ \0]+$//; $val',
  394. },
  395. 1538 => {
  396. Name => 'Orientation',
  397. Mask => 0x03,
  398. RawConv => '$$self{Orient} = $val',
  399. PrintConv => {
  400. 0 => 'Horizontal (normal)',
  401. 1 => 'Rotate 270 CW',
  402. 2 => 'Rotate 180',
  403. 3 => 'Rotate 90 CW',
  404. },
  405. },
  406. 1538.1 => {
  407. Name => 'ImageWidth',
  408. Mask => 0x0c,
  409. # 0x00=Base (768x512), 0x04=4Base (1536x1024), 0x08=16Base (3072x2048)
  410. ValueConv => '($$self{Orient} & 0x01 ? 512 : 768) * (($val || 2) / 2)',
  411. },
  412. 1538.2 => {
  413. Name => 'ImageHeight',
  414. Mask => 0x0c,
  415. ValueConv => '($$self{Orient} & 0x01 ? 768 : 512) * (($val || 2) / 2)',
  416. },
  417. 1538.3 => {
  418. Name => 'CompressionClass',
  419. Mask => 0x60,
  420. PrintConv => {
  421. 0x00 => 'Class 1 - 35mm film; Pictoral hard copy',
  422. 0x20 => 'Class 2 - Large format film',
  423. 0x40 => 'Class 3 - Text and graphics, high resolution',
  424. 0x60 => 'Class 4 - Text and graphics, high dynamic range',
  425. },
  426. },
  427. #1544 => 'InterleaveRatio',
  428. #1545 => 'ADPCMResolution',
  429. #1546 => {
  430. # Name => 'ADPCMMagnificationPanning',
  431. # Format => 'int8u[2]',
  432. #},
  433. #1548 => 'ADPCMMagnificationFactor',
  434. #1549 => {
  435. # Name => 'ADPCMDisplayOffset',
  436. # Format => 'int8u[2]',
  437. #},
  438. #1551 => 'ADPCMTransitionDescriptor',
  439. );
  440. #------------------------------------------------------------------------------
  441. # Extract information from a PhotoCD image
  442. # Inputs: 0) ExifTool object reference, 1) dirInfo reference
  443. # Returns: 1 on success, 0 if this wasn't a valid PhotoCD file
  444. sub ProcessPCD($$)
  445. {
  446. my ($et, $dirInfo) = @_;
  447. my $raf = $$dirInfo{RAF};
  448. my $buff;
  449. return 0 unless $raf->Seek(2048, 0) and
  450. $raf->Read($buff, 2048) == 2048 and
  451. $buff =~ /^PCD_IPI/;
  452. SetByteOrder('MM');
  453. $et->SetFileType();
  454. my %dirInfo = (
  455. DirName => 'PhotoCD',
  456. DataPt => \$buff,
  457. DataPos => 4096,
  458. );
  459. my $tagTablePtr = GetTagTable('Image::ExifTool::PhotoCD::Main');
  460. return $et->ProcessBinaryData(\%dirInfo, $tagTablePtr);
  461. }
  462. 1; # end
  463. __END__
  464. =head1 NAME
  465. Image::ExifTool::PhotoCD - Read Kodak Photo CD Image Pac (PCD) metadata
  466. =head1 SYNOPSIS
  467. This module is used by Image::ExifTool
  468. =head1 DESCRIPTION
  469. This module contains routines required by Image::ExifTool to extract
  470. information from Kodak Photo CD Image Pac (PCD) files.
  471. =head1 AUTHOR
  472. Copyright 2003-2016, Phil Harvey (phil at owl.phy.queensu.ca)
  473. This library is free software; you can redistribute it and/or modify it
  474. under the same terms as Perl itself.
  475. =head1 REFERENCES
  476. =over 4
  477. =item L<http://pcdtojpeg.sourceforge.net/>
  478. =back
  479. =head1 SEE ALSO
  480. L<Image::ExifTool::TagNames/PhotoCD Tags>,
  481. L<Image::ExifTool(3pm)|Image::ExifTool>
  482. =cut