├── src
├── __init__.py
├── Image-ExifTool
│ └── lib
│ │ ├── Image
│ │ └── ExifTool
│ │ │ ├── Olympus.pm
│ │ │ ├── Pentax.pm
│ │ │ ├── Charset
│ │ │ ├── Latin.pm
│ │ │ ├── Turkish.pm
│ │ │ ├── Vietnam.pm
│ │ │ ├── PDFDoc.pm
│ │ │ ├── Baltic.pm
│ │ │ ├── Latin2.pm
│ │ │ ├── Hebrew.pm
│ │ │ ├── Arabic.pm
│ │ │ ├── Greek.pm
│ │ │ ├── Thai.pm
│ │ │ ├── MacIceland.pm
│ │ │ ├── MacRoman.pm
│ │ │ ├── Cyrillic.pm
│ │ │ ├── MacTurkish.pm
│ │ │ ├── MacRomanian.pm
│ │ │ ├── MacCroatian.pm
│ │ │ ├── MacGreek.pm
│ │ │ ├── MacLatin2.pm
│ │ │ ├── MacCyrillic.pm
│ │ │ ├── MacArabic.pm
│ │ │ ├── MacHebrew.pm
│ │ │ ├── MacThai.pm
│ │ │ └── Symbol.pm
│ │ │ ├── Unknown.pm
│ │ │ ├── GE.pm
│ │ │ ├── Nintendo.pm
│ │ │ ├── PrintIM.pm
│ │ │ ├── Theora.pm
│ │ │ ├── JVC.pm
│ │ │ ├── Scalado.pm
│ │ │ ├── PGF.pm
│ │ │ ├── MPC.pm
│ │ │ ├── Radiance.pm
│ │ │ ├── KyoceraRaw.pm
│ │ │ ├── Stim.pm
│ │ │ ├── PPM.pm
│ │ │ ├── Apple.pm
│ │ │ ├── Rawzor.pm
│ │ │ ├── ITC.pm
│ │ │ ├── DPX.pm
│ │ │ ├── Lytro.pm
│ │ │ ├── iWork.pm
│ │ │ ├── CaptureOne.pm
│ │ │ ├── FotoStation.pm
│ │ │ ├── HP.pm
│ │ │ ├── PhotoMechanic.pm
│ │ │ ├── Vorbis.pm
│ │ │ └── GIMP.pm
│ │ └── File
│ │ └── RandomAccess.pod
└── com.andrewning.sortphotos.plist
├── MANIFEST.in
├── example.png
├── .gitignore
└── setup.py
/src/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | graft src/Image-ExifTool
--------------------------------------------------------------------------------
/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewning/sortphotos/HEAD/example.png
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Olympus.pm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewning/sortphotos/HEAD/src/Image-ExifTool/lib/Image/ExifTool/Olympus.pm
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Pentax.pm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewning/sortphotos/HEAD/src/Image-ExifTool/lib/Image/ExifTool/Pentax.pm
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.py[cod]
2 |
3 | .DS_Store
4 |
5 | # C extensions
6 | *.so
7 |
8 | # Packages
9 | *.egg
10 | *.egg-info
11 | dist
12 | build
13 | eggs
14 | parts
15 | bin
16 | var
17 | sdist
18 | develop-eggs
19 | .installed.cfg
20 | lib
21 | lib64
22 |
23 | # Installer logs
24 | pip-log.txt
25 |
26 | # Unit test / coverage reports
27 | .coverage
28 | .tox
29 | nosetests.xml
30 |
31 | # Translations
32 | *.mo
33 |
34 | # Mr Developer
35 | .mr.developer.cfg
36 | .project
37 | .pydevproject
38 |
39 | !src/Image-ExifTool/lib
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 |
4 | from setuptools import setup, find_packages
5 |
6 | setup(
7 | name='sortphotos',
8 | version='1.0',
9 | description='Organizes photos and videos into folders using date/time information ',
10 | author='Andrew Ning',
11 | packages=find_packages(),
12 | include_package_data=True,
13 | license='MIT License',
14 | entry_points={
15 | 'console_scripts': [
16 | 'sortphotos = src.sortphotos:main',
17 | ]
18 | }
19 | )
20 |
21 |
--------------------------------------------------------------------------------
/src/com.andrewning.sortphotos.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Label
6 | com.andrewning.sortphotos
7 | ProgramArguments
8 |
9 | python
10 | /usr/local/bin/sortphotos.py
11 | -m
12 | /Users/Me/Pictures/DumpHere
13 | /Users/Me/Pictures
14 |
15 | StartInterval
16 | 86400
17 |
18 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/Latin.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Latin.pm
3 | #
4 | # Description: cp1252 to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::Latin = (
15 | 0x80 => 0x20ac, 0x82 => 0x201a, 0x83 => 0x0192, 0x84 => 0x201e,
16 | 0x85 => 0x2026, 0x86 => 0x2020, 0x87 => 0x2021, 0x88 => 0x02c6,
17 | 0x89 => 0x2030, 0x8a => 0x0160, 0x8b => 0x2039, 0x8c => 0x0152,
18 | 0x8e => 0x017d, 0x91 => 0x2018, 0x92 => 0x2019, 0x93 => 0x201c,
19 | 0x94 => 0x201d, 0x95 => 0x2022, 0x96 => 0x2013, 0x97 => 0x2014,
20 | 0x98 => 0x02dc, 0x99 => 0x2122, 0x9a => 0x0161, 0x9b => 0x203a,
21 | 0x9c => 0x0153, 0x9e => 0x017e, 0x9f => 0x0178,
22 | );
23 |
24 | 1; # end
25 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/Turkish.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Turkish.pm
3 | #
4 | # Description: cp1254 to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::Turkish = (
15 | 0x80 => 0x20ac, 0x82 => 0x201a, 0x83 => 0x0192, 0x84 => 0x201e,
16 | 0x85 => 0x2026, 0x86 => 0x2020, 0x87 => 0x2021, 0x88 => 0x02c6,
17 | 0x89 => 0x2030, 0x8a => 0x0160, 0x8b => 0x2039, 0x8c => 0x0152,
18 | 0x91 => 0x2018, 0x92 => 0x2019, 0x93 => 0x201c, 0x94 => 0x201d,
19 | 0x95 => 0x2022, 0x96 => 0x2013, 0x97 => 0x2014, 0x98 => 0x02dc,
20 | 0x99 => 0x2122, 0x9a => 0x0161, 0x9b => 0x203a, 0x9c => 0x0153,
21 | 0x9f => 0x0178, 0xd0 => 0x011e, 0xdd => 0x0130, 0xde => 0x015e,
22 | 0xf0 => 0x011f, 0xfd => 0x0131, 0xfe => 0x015f,
23 | );
24 |
25 | 1; # end
26 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/Vietnam.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Vietnam.pm
3 | #
4 | # Description: cp1258 to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::Vietnam = (
15 | 0x80 => 0x20ac, 0x82 => 0x201a, 0x83 => 0x0192, 0x84 => 0x201e,
16 | 0x85 => 0x2026, 0x86 => 0x2020, 0x87 => 0x2021, 0x88 => 0x02c6,
17 | 0x89 => 0x2030, 0x8b => 0x2039, 0x8c => 0x0152, 0x91 => 0x2018,
18 | 0x92 => 0x2019, 0x93 => 0x201c, 0x94 => 0x201d, 0x95 => 0x2022,
19 | 0x96 => 0x2013, 0x97 => 0x2014, 0x98 => 0x02dc, 0x99 => 0x2122,
20 | 0x9b => 0x203a, 0x9c => 0x0153, 0x9f => 0x0178, 0xc3 => 0x0102,
21 | 0xcc => 0x0300, 0xd0 => 0x0110, 0xd2 => 0x0309, 0xd5 => 0x01a0,
22 | 0xdd => 0x01af, 0xde => 0x0303, 0xe3 => 0x0103, 0xec => 0x0301,
23 | 0xf0 => 0x0111, 0xf2 => 0x0323, 0xf5 => 0x01a1, 0xfd => 0x01b0,
24 | 0xfe => 0x20ab,
25 | );
26 |
27 | 1; # end
28 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/PDFDoc.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: PDFDoc.pm
3 | #
4 | # Description: PDFDocEncoding to Unicode
5 | #
6 | # Revisions: 2010/10/16 - P. Harvey created
7 | #
8 | # References: 1) http://www.adobe.com/devnet/pdf/pdf_reference.html
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | # This set re-maps characters with codepoints less than 0x80
12 | #------------------------------------------------------------------------------
13 | use strict;
14 |
15 | %Image::ExifTool::Charset::PDFDoc = (
16 | 0x18 => 0x02d8, 0x82 => 0x2021, 0x8c => 0x201e, 0x96 => 0x0152,
17 | 0x19 => 0x02c7, 0x83 => 0x2026, 0x8d => 0x201c, 0x97 => 0x0160,
18 | 0x1a => 0x02c6, 0x84 => 0x2014, 0x8e => 0x201d, 0x98 => 0x0178,
19 | 0x1b => 0x02d9, 0x85 => 0x2013, 0x8f => 0x2018, 0x99 => 0x017d,
20 | 0x1c => 0x02dd, 0x86 => 0x0192, 0x90 => 0x2019, 0x9a => 0x0131,
21 | 0x1d => 0x02db, 0x87 => 0x2044, 0x91 => 0x201a, 0x9b => 0x0142,
22 | 0x1e => 0x02da, 0x88 => 0x2039, 0x92 => 0x2122, 0x9c => 0x0153,
23 | 0x1f => 0x02dc, 0x89 => 0x203a, 0x93 => 0xfb01, 0x9d => 0x0161,
24 | 0x80 => 0x2022, 0x8a => 0x2212, 0x94 => 0xfb02, 0x9e => 0x017e,
25 | 0x81 => 0x2020, 0x8b => 0x2030, 0x95 => 0x0141, 0xa0 => 0x20ac,
26 | );
27 |
28 | 1; # end
29 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/Baltic.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Baltic.pm
3 | #
4 | # Description: cp1257 to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::Baltic = (
15 | 0x80 => 0x20ac, 0x82 => 0x201a, 0x84 => 0x201e, 0x85 => 0x2026,
16 | 0x86 => 0x2020, 0x87 => 0x2021, 0x89 => 0x2030, 0x8b => 0x2039, 0x8d => 0xa8,
17 | 0x8e => 0x02c7, 0x8f => 0xb8, 0x91 => 0x2018, 0x92 => 0x2019, 0x93 => 0x201c,
18 | 0x94 => 0x201d, 0x95 => 0x2022, 0x96 => 0x2013, 0x97 => 0x2014,
19 | 0x99 => 0x2122, 0x9b => 0x203a, 0x9d => 0xaf, 0x9e => 0x02db, 0xa8 => 0xd8,
20 | 0xaa => 0x0156, 0xaf => 0xc6, 0xb8 => 0xf8, 0xba => 0x0157, 0xbf => 0xe6,
21 | 0xc0 => 0x0104, 0xc1 => 0x012e, 0xc2 => 0x0100, 0xc3 => 0x0106,
22 | 0xc6 => 0x0118, 0xc7 => 0x0112, 0xc8 => 0x010c, 0xca => 0x0179,
23 | 0xcb => 0x0116, 0xcc => 0x0122, 0xcd => 0x0136, 0xce => 0x012a,
24 | 0xcf => 0x013b, 0xd0 => 0x0160, 0xd1 => 0x0143, 0xd2 => 0x0145,
25 | 0xd4 => 0x014c, 0xd8 => 0x0172, 0xd9 => 0x0141, 0xda => 0x015a,
26 | 0xdb => 0x016a, 0xdd => 0x017b, 0xde => 0x017d, 0xe0 => 0x0105,
27 | 0xe1 => 0x012f, 0xe2 => 0x0101, 0xe3 => 0x0107, 0xe6 => 0x0119,
28 | 0xe7 => 0x0113, 0xe8 => 0x010d, 0xea => 0x017a, 0xeb => 0x0117,
29 | 0xec => 0x0123, 0xed => 0x0137, 0xee => 0x012b, 0xef => 0x013c,
30 | 0xf0 => 0x0161, 0xf1 => 0x0144, 0xf2 => 0x0146, 0xf4 => 0x014d,
31 | 0xf8 => 0x0173, 0xf9 => 0x0142, 0xfa => 0x015b, 0xfb => 0x016b,
32 | 0xfd => 0x017c, 0xfe => 0x017e, 0xff => 0x02d9,
33 | );
34 |
35 | 1; # end
36 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/Latin2.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Latin2.pm
3 | #
4 | # Description: cp1250 to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::Latin2 = (
15 | 0x80 => 0x20ac, 0x82 => 0x201a, 0x84 => 0x201e, 0x85 => 0x2026,
16 | 0x86 => 0x2020, 0x87 => 0x2021, 0x89 => 0x2030, 0x8a => 0x0160,
17 | 0x8b => 0x2039, 0x8c => 0x015a, 0x8d => 0x0164, 0x8e => 0x017d,
18 | 0x8f => 0x0179, 0x91 => 0x2018, 0x92 => 0x2019, 0x93 => 0x201c,
19 | 0x94 => 0x201d, 0x95 => 0x2022, 0x96 => 0x2013, 0x97 => 0x2014,
20 | 0x99 => 0x2122, 0x9a => 0x0161, 0x9b => 0x203a, 0x9c => 0x015b,
21 | 0x9d => 0x0165, 0x9e => 0x017e, 0x9f => 0x017a, 0xa1 => 0x02c7,
22 | 0xa2 => 0x02d8, 0xa3 => 0x0141, 0xa5 => 0x0104, 0xaa => 0x015e,
23 | 0xaf => 0x017b, 0xb2 => 0x02db, 0xb3 => 0x0142, 0xb9 => 0x0105,
24 | 0xba => 0x015f, 0xbc => 0x013d, 0xbd => 0x02dd, 0xbe => 0x013e,
25 | 0xbf => 0x017c, 0xc0 => 0x0154, 0xc3 => 0x0102, 0xc5 => 0x0139,
26 | 0xc6 => 0x0106, 0xc8 => 0x010c, 0xca => 0x0118, 0xcc => 0x011a,
27 | 0xcf => 0x010e, 0xd0 => 0x0110, 0xd1 => 0x0143, 0xd2 => 0x0147,
28 | 0xd5 => 0x0150, 0xd8 => 0x0158, 0xd9 => 0x016e, 0xdb => 0x0170,
29 | 0xde => 0x0162, 0xe0 => 0x0155, 0xe3 => 0x0103, 0xe5 => 0x013a,
30 | 0xe6 => 0x0107, 0xe8 => 0x010d, 0xea => 0x0119, 0xec => 0x011b,
31 | 0xef => 0x010f, 0xf0 => 0x0111, 0xf1 => 0x0144, 0xf2 => 0x0148,
32 | 0xf5 => 0x0151, 0xf8 => 0x0159, 0xf9 => 0x016f, 0xfb => 0x0171,
33 | 0xfe => 0x0163, 0xff => 0x02d9,
34 | );
35 |
36 | 1; # end
37 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/Hebrew.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Hebrew.pm
3 | #
4 | # Description: cp1255 to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::Hebrew = (
15 | 0x80 => 0x20ac, 0x82 => 0x201a, 0x83 => 0x0192, 0x84 => 0x201e,
16 | 0x85 => 0x2026, 0x86 => 0x2020, 0x87 => 0x2021, 0x88 => 0x02c6,
17 | 0x89 => 0x2030, 0x8b => 0x2039, 0x91 => 0x2018, 0x92 => 0x2019,
18 | 0x93 => 0x201c, 0x94 => 0x201d, 0x95 => 0x2022, 0x96 => 0x2013,
19 | 0x97 => 0x2014, 0x98 => 0x02dc, 0x99 => 0x2122, 0x9b => 0x203a,
20 | 0xa4 => 0x20aa, 0xaa => 0xd7, 0xba => 0xf7, 0xc0 => 0x05b0, 0xc1 => 0x05b1,
21 | 0xc2 => 0x05b2, 0xc3 => 0x05b3, 0xc4 => 0x05b4, 0xc5 => 0x05b5,
22 | 0xc6 => 0x05b6, 0xc7 => 0x05b7, 0xc8 => 0x05b8, 0xc9 => 0x05b9,
23 | 0xcb => 0x05bb, 0xcc => 0x05bc, 0xcd => 0x05bd, 0xce => 0x05be,
24 | 0xcf => 0x05bf, 0xd0 => 0x05c0, 0xd1 => 0x05c1, 0xd2 => 0x05c2,
25 | 0xd3 => 0x05c3, 0xd4 => 0x05f0, 0xd5 => 0x05f1, 0xd6 => 0x05f2,
26 | 0xd7 => 0x05f3, 0xd8 => 0x05f4, 0xe0 => 0x05d0, 0xe1 => 0x05d1,
27 | 0xe2 => 0x05d2, 0xe3 => 0x05d3, 0xe4 => 0x05d4, 0xe5 => 0x05d5,
28 | 0xe6 => 0x05d6, 0xe7 => 0x05d7, 0xe8 => 0x05d8, 0xe9 => 0x05d9,
29 | 0xea => 0x05da, 0xeb => 0x05db, 0xec => 0x05dc, 0xed => 0x05dd,
30 | 0xee => 0x05de, 0xef => 0x05df, 0xf0 => 0x05e0, 0xf1 => 0x05e1,
31 | 0xf2 => 0x05e2, 0xf3 => 0x05e3, 0xf4 => 0x05e4, 0xf5 => 0x05e5,
32 | 0xf6 => 0x05e6, 0xf7 => 0x05e7, 0xf8 => 0x05e8, 0xf9 => 0x05e9,
33 | 0xfa => 0x05ea, 0xfd => 0x200e, 0xfe => 0x200f,
34 | );
35 |
36 | 1; # end
37 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Unknown.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Unknown.pm
3 | #
4 | # Description: Unknown EXIF maker notes tags
5 | #
6 | # Revisions: 04/07/2004 - P. Harvey Created
7 | #------------------------------------------------------------------------------
8 |
9 | package Image::ExifTool::Unknown;
10 |
11 | use strict;
12 | use vars qw($VERSION);
13 | use Image::ExifTool::Exif;
14 |
15 | $VERSION = '1.13';
16 |
17 | # Unknown maker notes
18 | %Image::ExifTool::Unknown::Main = (
19 | WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
20 | CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
21 | GROUPS => { 0 => 'MakerNotes', 1 => 'MakerUnknown', 2 => 'Camera' },
22 |
23 | # this seems to be a common fixture, so look for it in unknown maker notes
24 | 0x0e00 => {
25 | Name => 'PrintIM',
26 | Description => 'Print Image Matching',
27 | SubDirectory => {
28 | TagTable => 'Image::ExifTool::PrintIM::Main',
29 | },
30 | },
31 | );
32 |
33 |
34 | 1; # end
35 |
36 | __END__
37 |
38 | =head1 NAME
39 |
40 | Image::ExifTool::Unknown - Unknown EXIF maker notes tags
41 |
42 | =head1 SYNOPSIS
43 |
44 | This module is loaded automatically by Image::ExifTool when required.
45 |
46 | =head1 DESCRIPTION
47 |
48 | Image::ExifTool has definitions for the maker notes from many manufacturers,
49 | however information can sometimes be extracted from unknown manufacturers if
50 | the maker notes are in standard IFD format. This module contains the
51 | definitions necessary for Image::ExifTool to read the maker notes from
52 | unknown manufacturers.
53 |
54 | =head1 AUTHOR
55 |
56 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
57 |
58 | This library is free software; you can redistribute it and/or modify it
59 | under the same terms as Perl itself.
60 |
61 | =head1 SEE ALSO
62 |
63 | L,
64 | L
65 |
66 | =cut
67 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/Arabic.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Arabic.pm
3 | #
4 | # Description: cp1256 to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::Arabic = (
15 | 0x80 => 0x20ac, 0x81 => 0x067e, 0x82 => 0x201a, 0x83 => 0x0192,
16 | 0x84 => 0x201e, 0x85 => 0x2026, 0x86 => 0x2020, 0x87 => 0x2021,
17 | 0x88 => 0x02c6, 0x89 => 0x2030, 0x8a => 0x0679, 0x8b => 0x2039,
18 | 0x8c => 0x0152, 0x8d => 0x0686, 0x8e => 0x0698, 0x8f => 0x0688,
19 | 0x90 => 0x06af, 0x91 => 0x2018, 0x92 => 0x2019, 0x93 => 0x201c,
20 | 0x94 => 0x201d, 0x95 => 0x2022, 0x96 => 0x2013, 0x97 => 0x2014,
21 | 0x98 => 0x06a9, 0x99 => 0x2122, 0x9a => 0x0691, 0x9b => 0x203a,
22 | 0x9c => 0x0153, 0x9d => 0x200c, 0x9e => 0x200d, 0x9f => 0x06ba,
23 | 0xa1 => 0x060c, 0xaa => 0x06be, 0xba => 0x061b, 0xbf => 0x061f,
24 | 0xc0 => 0x06c1, 0xc1 => 0x0621, 0xc2 => 0x0622, 0xc3 => 0x0623,
25 | 0xc4 => 0x0624, 0xc5 => 0x0625, 0xc6 => 0x0626, 0xc7 => 0x0627,
26 | 0xc8 => 0x0628, 0xc9 => 0x0629, 0xca => 0x062a, 0xcb => 0x062b,
27 | 0xcc => 0x062c, 0xcd => 0x062d, 0xce => 0x062e, 0xcf => 0x062f,
28 | 0xd0 => 0x0630, 0xd1 => 0x0631, 0xd2 => 0x0632, 0xd3 => 0x0633,
29 | 0xd4 => 0x0634, 0xd5 => 0x0635, 0xd6 => 0x0636, 0xd8 => 0x0637,
30 | 0xd9 => 0x0638, 0xda => 0x0639, 0xdb => 0x063a, 0xdc => 0x0640,
31 | 0xdd => 0x0641, 0xde => 0x0642, 0xdf => 0x0643, 0xe1 => 0x0644,
32 | 0xe3 => 0x0645, 0xe4 => 0x0646, 0xe5 => 0x0647, 0xe6 => 0x0648,
33 | 0xec => 0x0649, 0xed => 0x064a, 0xf0 => 0x064b, 0xf1 => 0x064c,
34 | 0xf2 => 0x064d, 0xf3 => 0x064e, 0xf5 => 0x064f, 0xf6 => 0x0650,
35 | 0xf8 => 0x0651, 0xfa => 0x0652, 0xfd => 0x200e, 0xfe => 0x200f,
36 | 0xff => 0x06d2,
37 | );
38 |
39 | 1; # end
40 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/Greek.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Greek.pm
3 | #
4 | # Description: cp1253 to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1253.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::Greek = (
15 | 0x80 => 0x20ac, 0x82 => 0x201a, 0x83 => 0x0192, 0x84 => 0x201e,
16 | 0x85 => 0x2026, 0x86 => 0x2020, 0x87 => 0x2021, 0x89 => 0x2030,
17 | 0x8b => 0x2039, 0x91 => 0x2018, 0x92 => 0x2019, 0x93 => 0x201c,
18 | 0x94 => 0x201d, 0x95 => 0x2022, 0x96 => 0x2013, 0x97 => 0x2014,
19 | 0x99 => 0x2122, 0x9b => 0x203a, 0xa1 => 0x0385, 0xa2 => 0x0386,
20 | 0xaf => 0x2015, 0xb4 => 0x0384, 0xb8 => 0x0388, 0xb9 => 0x0389,
21 | 0xba => 0x038a, 0xbc => 0x038c, 0xbe => 0x038e, 0xbf => 0x038f,
22 | 0xc0 => 0x0390, 0xc1 => 0x0391, 0xc2 => 0x0392, 0xc3 => 0x0393,
23 | 0xc4 => 0x0394, 0xc5 => 0x0395, 0xc6 => 0x0396, 0xc7 => 0x0397,
24 | 0xc8 => 0x0398, 0xc9 => 0x0399, 0xca => 0x039a, 0xcb => 0x039b,
25 | 0xcc => 0x039c, 0xcd => 0x039d, 0xce => 0x039e, 0xcf => 0x039f,
26 | 0xd0 => 0x03a0, 0xd1 => 0x03a1, 0xd3 => 0x03a3, 0xd4 => 0x03a4,
27 | 0xd5 => 0x03a5, 0xd6 => 0x03a6, 0xd7 => 0x03a7, 0xd8 => 0x03a8,
28 | 0xd9 => 0x03a9, 0xda => 0x03aa, 0xdb => 0x03ab, 0xdc => 0x03ac,
29 | 0xdd => 0x03ad, 0xde => 0x03ae, 0xdf => 0x03af, 0xe0 => 0x03b0,
30 | 0xe1 => 0x03b1, 0xe2 => 0x03b2, 0xe3 => 0x03b3, 0xe4 => 0x03b4,
31 | 0xe5 => 0x03b5, 0xe6 => 0x03b6, 0xe7 => 0x03b7, 0xe8 => 0x03b8,
32 | 0xe9 => 0x03b9, 0xea => 0x03ba, 0xeb => 0x03bb, 0xec => 0x03bc,
33 | 0xed => 0x03bd, 0xee => 0x03be, 0xef => 0x03bf, 0xf0 => 0x03c0,
34 | 0xf1 => 0x03c1, 0xf2 => 0x03c2, 0xf3 => 0x03c3, 0xf4 => 0x03c4,
35 | 0xf5 => 0x03c5, 0xf6 => 0x03c6, 0xf7 => 0x03c7, 0xf8 => 0x03c8,
36 | 0xf9 => 0x03c9, 0xfa => 0x03ca, 0xfb => 0x03cb, 0xfc => 0x03cc,
37 | 0xfd => 0x03cd, 0xfe => 0x03ce,
38 | );
39 |
40 | 1; # end
41 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/Thai.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Thai.pm
3 | #
4 | # Description: cp874 to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP874.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::Thai = (
15 | 0x80 => 0x20ac, 0x85 => 0x2026, 0x91 => 0x2018, 0x92 => 0x2019,
16 | 0x93 => 0x201c, 0x94 => 0x201d, 0x95 => 0x2022, 0x96 => 0x2013,
17 | 0x97 => 0x2014, 0xa1 => 0x0e01, 0xa2 => 0x0e02, 0xa3 => 0x0e03,
18 | 0xa4 => 0x0e04, 0xa5 => 0x0e05, 0xa6 => 0x0e06, 0xa7 => 0x0e07,
19 | 0xa8 => 0x0e08, 0xa9 => 0x0e09, 0xaa => 0x0e0a, 0xab => 0x0e0b,
20 | 0xac => 0x0e0c, 0xad => 0x0e0d, 0xae => 0x0e0e, 0xaf => 0x0e0f,
21 | 0xb0 => 0x0e10, 0xb1 => 0x0e11, 0xb2 => 0x0e12, 0xb3 => 0x0e13,
22 | 0xb4 => 0x0e14, 0xb5 => 0x0e15, 0xb6 => 0x0e16, 0xb7 => 0x0e17,
23 | 0xb8 => 0x0e18, 0xb9 => 0x0e19, 0xba => 0x0e1a, 0xbb => 0x0e1b,
24 | 0xbc => 0x0e1c, 0xbd => 0x0e1d, 0xbe => 0x0e1e, 0xbf => 0x0e1f,
25 | 0xc0 => 0x0e20, 0xc1 => 0x0e21, 0xc2 => 0x0e22, 0xc3 => 0x0e23,
26 | 0xc4 => 0x0e24, 0xc5 => 0x0e25, 0xc6 => 0x0e26, 0xc7 => 0x0e27,
27 | 0xc8 => 0x0e28, 0xc9 => 0x0e29, 0xca => 0x0e2a, 0xcb => 0x0e2b,
28 | 0xcc => 0x0e2c, 0xcd => 0x0e2d, 0xce => 0x0e2e, 0xcf => 0x0e2f,
29 | 0xd0 => 0x0e30, 0xd1 => 0x0e31, 0xd2 => 0x0e32, 0xd3 => 0x0e33,
30 | 0xd4 => 0x0e34, 0xd5 => 0x0e35, 0xd6 => 0x0e36, 0xd7 => 0x0e37,
31 | 0xd8 => 0x0e38, 0xd9 => 0x0e39, 0xda => 0x0e3a, 0xdf => 0x0e3f,
32 | 0xe0 => 0x0e40, 0xe1 => 0x0e41, 0xe2 => 0x0e42, 0xe3 => 0x0e43,
33 | 0xe4 => 0x0e44, 0xe5 => 0x0e45, 0xe6 => 0x0e46, 0xe7 => 0x0e47,
34 | 0xe8 => 0x0e48, 0xe9 => 0x0e49, 0xea => 0x0e4a, 0xeb => 0x0e4b,
35 | 0xec => 0x0e4c, 0xed => 0x0e4d, 0xee => 0x0e4e, 0xef => 0x0e4f,
36 | 0xf0 => 0x0e50, 0xf1 => 0x0e51, 0xf2 => 0x0e52, 0xf3 => 0x0e53,
37 | 0xf4 => 0x0e54, 0xf5 => 0x0e55, 0xf6 => 0x0e56, 0xf7 => 0x0e57,
38 | 0xf8 => 0x0e58, 0xf9 => 0x0e59, 0xfa => 0x0e5a, 0xfb => 0x0e5b,
39 | );
40 |
41 | 1; # end
42 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/GE.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: GE.pm
3 | #
4 | # Description: General Imaging maker notes tags
5 | #
6 | # Revisions: 2010-12-14 - P. Harvey Created
7 | #------------------------------------------------------------------------------
8 |
9 | package Image::ExifTool::GE;
10 |
11 | use strict;
12 | use vars qw($VERSION);
13 | use Image::ExifTool qw(:DataAccess :Utils);
14 | use Image::ExifTool::Exif;
15 |
16 | $VERSION = '1.00';
17 |
18 | sub ProcessGE2($$$);
19 |
20 | # GE type 1 maker notes (ref PH)
21 | # (similar to Kodak::Type11 and Ricoh::Type2)
22 | %Image::ExifTool::GE::Main = (
23 | WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
24 | CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
25 | WRITABLE => 1,
26 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
27 | NOTES => q{
28 | This table lists tags found in the maker notes of some General Imaging
29 | camera models.
30 | },
31 | # 0x0104 - int32u
32 | # 0x0200 - int32u[3] (with invalid offset of 0)
33 | 0x0202 => {
34 | Name => 'Macro',
35 | Writable => 'int16u',
36 | PrintConv => { 0 => 'Off', 1 => 'On' },
37 | },
38 | # 0x0203 - int16u: 0
39 | # 0x0204 - rational64u: 10/10
40 | # 0x0205 - rational64u: 7.249,7.34,9.47 (changes with camera model)
41 | # 0x0206 - int16u[6] (with invalid offset of 0)
42 | 0x0207 => {
43 | Name => 'GEModel',
44 | Format => 'string',
45 | },
46 | 0x0300 => {
47 | Name => 'GEMake',
48 | Format => 'string',
49 | },
50 | # 0x0500 - int16u: 0
51 | # 0x0600 - int32u: 0
52 | );
53 |
54 | __END__
55 |
56 | =head1 NAME
57 |
58 | Image::ExifTool::GE - General Imaging maker notes tags
59 |
60 | =head1 SYNOPSIS
61 |
62 | This module is loaded automatically by Image::ExifTool when required.
63 |
64 | =head1 DESCRIPTION
65 |
66 | This module contains definitions required by Image::ExifTool to interpret
67 | General Imaging maker notes.
68 |
69 | =head1 AUTHOR
70 |
71 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
72 |
73 | This library is free software; you can redistribute it and/or modify it
74 | under the same terms as Perl itself.
75 |
76 | =head1 SEE ALSO
77 |
78 | L,
79 | L
80 |
81 | =cut
82 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/MacIceland.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: MacIceland.pm
3 | #
4 | # Description: Mac Icelandic to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/ICELAND.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::MacIceland = (
15 | 0x80 => 0xc4, 0x81 => 0xc5, 0x82 => 0xc7, 0x83 => 0xc9, 0x84 => 0xd1,
16 | 0x85 => 0xd6, 0x86 => 0xdc, 0x87 => 0xe1, 0x88 => 0xe0, 0x89 => 0xe2,
17 | 0x8a => 0xe4, 0x8b => 0xe3, 0x8c => 0xe5, 0x8d => 0xe7, 0x8e => 0xe9,
18 | 0x8f => 0xe8, 0x90 => 0xea, 0x91 => 0xeb, 0x92 => 0xed, 0x93 => 0xec,
19 | 0x94 => 0xee, 0x95 => 0xef, 0x96 => 0xf1, 0x97 => 0xf3, 0x98 => 0xf2,
20 | 0x99 => 0xf4, 0x9a => 0xf6, 0x9b => 0xf5, 0x9c => 0xfa, 0x9d => 0xf9,
21 | 0x9e => 0xfb, 0x9f => 0xfc, 0xa0 => 0xdd, 0xa1 => 0xb0, 0xa4 => 0xa7,
22 | 0xa5 => 0x2022, 0xa6 => 0xb6, 0xa7 => 0xdf, 0xa8 => 0xae, 0xaa => 0x2122,
23 | 0xab => 0xb4, 0xac => 0xa8, 0xad => 0x2260, 0xae => 0xc6, 0xaf => 0xd8,
24 | 0xb0 => 0x221e, 0xb2 => 0x2264, 0xb3 => 0x2265, 0xb4 => 0xa5, 0xb6 => 0x2202,
25 | 0xb7 => 0x2211, 0xb8 => 0x220f, 0xb9 => 0x03c0, 0xba => 0x222b, 0xbb => 0xaa,
26 | 0xbc => 0xba, 0xbd => 0x03a9, 0xbe => 0xe6, 0xbf => 0xf8, 0xc0 => 0xbf,
27 | 0xc1 => 0xa1, 0xc2 => 0xac, 0xc3 => 0x221a, 0xc4 => 0x0192, 0xc5 => 0x2248,
28 | 0xc6 => 0x2206, 0xc7 => 0xab, 0xc8 => 0xbb, 0xc9 => 0x2026, 0xca => 0xa0,
29 | 0xcb => 0xc0, 0xcc => 0xc3, 0xcd => 0xd5, 0xce => 0x0152, 0xcf => 0x0153,
30 | 0xd0 => 0x2013, 0xd1 => 0x2014, 0xd2 => 0x201c, 0xd3 => 0x201d,
31 | 0xd4 => 0x2018, 0xd5 => 0x2019, 0xd6 => 0xf7, 0xd7 => 0x25ca, 0xd8 => 0xff,
32 | 0xd9 => 0x0178, 0xda => 0x2044, 0xdb => 0x20ac, 0xdc => 0xd0, 0xdd => 0xf0,
33 | 0xdf => 0xfe, 0xe0 => 0xfd, 0xe1 => 0xb7, 0xe2 => 0x201a, 0xe3 => 0x201e,
34 | 0xe4 => 0x2030, 0xe5 => 0xc2, 0xe6 => 0xca, 0xe7 => 0xc1, 0xe8 => 0xcb,
35 | 0xe9 => 0xc8, 0xea => 0xcd, 0xeb => 0xce, 0xec => 0xcf, 0xed => 0xcc,
36 | 0xee => 0xd3, 0xef => 0xd4, 0xf0 => 0xf8ff, 0xf1 => 0xd2, 0xf2 => 0xda,
37 | 0xf3 => 0xdb, 0xf4 => 0xd9, 0xf5 => 0x0131, 0xf6 => 0x02c6, 0xf7 => 0x02dc,
38 | 0xf8 => 0xaf, 0xf9 => 0x02d8, 0xfa => 0x02d9, 0xfb => 0x02da, 0xfc => 0xb8,
39 | 0xfd => 0x02dd, 0xfe => 0x02db, 0xff => 0x02c7,
40 | );
41 |
42 | 1; # end
43 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/MacRoman.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: MacRoman.pm
3 | #
4 | # Description: Mac Roman to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMAN.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::MacRoman = (
15 | 0x80 => 0xc4, 0x81 => 0xc5, 0x82 => 0xc7, 0x83 => 0xc9, 0x84 => 0xd1,
16 | 0x85 => 0xd6, 0x86 => 0xdc, 0x87 => 0xe1, 0x88 => 0xe0, 0x89 => 0xe2,
17 | 0x8a => 0xe4, 0x8b => 0xe3, 0x8c => 0xe5, 0x8d => 0xe7, 0x8e => 0xe9,
18 | 0x8f => 0xe8, 0x90 => 0xea, 0x91 => 0xeb, 0x92 => 0xed, 0x93 => 0xec,
19 | 0x94 => 0xee, 0x95 => 0xef, 0x96 => 0xf1, 0x97 => 0xf3, 0x98 => 0xf2,
20 | 0x99 => 0xf4, 0x9a => 0xf6, 0x9b => 0xf5, 0x9c => 0xfa, 0x9d => 0xf9,
21 | 0x9e => 0xfb, 0x9f => 0xfc, 0xa0 => 0x2020, 0xa1 => 0xb0, 0xa4 => 0xa7,
22 | 0xa5 => 0x2022, 0xa6 => 0xb6, 0xa7 => 0xdf, 0xa8 => 0xae, 0xaa => 0x2122,
23 | 0xab => 0xb4, 0xac => 0xa8, 0xad => 0x2260, 0xae => 0xc6, 0xaf => 0xd8,
24 | 0xb0 => 0x221e, 0xb2 => 0x2264, 0xb3 => 0x2265, 0xb4 => 0xa5, 0xb6 => 0x2202,
25 | 0xb7 => 0x2211, 0xb8 => 0x220f, 0xb9 => 0x03c0, 0xba => 0x222b, 0xbb => 0xaa,
26 | 0xbc => 0xba, 0xbd => 0x03a9, 0xbe => 0xe6, 0xbf => 0xf8, 0xc0 => 0xbf,
27 | 0xc1 => 0xa1, 0xc2 => 0xac, 0xc3 => 0x221a, 0xc4 => 0x0192, 0xc5 => 0x2248,
28 | 0xc6 => 0x2206, 0xc7 => 0xab, 0xc8 => 0xbb, 0xc9 => 0x2026, 0xca => 0xa0,
29 | 0xcb => 0xc0, 0xcc => 0xc3, 0xcd => 0xd5, 0xce => 0x0152, 0xcf => 0x0153,
30 | 0xd0 => 0x2013, 0xd1 => 0x2014, 0xd2 => 0x201c, 0xd3 => 0x201d,
31 | 0xd4 => 0x2018, 0xd5 => 0x2019, 0xd6 => 0xf7, 0xd7 => 0x25ca, 0xd8 => 0xff,
32 | 0xd9 => 0x0178, 0xda => 0x2044, 0xdb => 0x20ac, 0xdc => 0x2039,
33 | 0xdd => 0x203a, 0xde => 0xfb01, 0xdf => 0xfb02, 0xe0 => 0x2021, 0xe1 => 0xb7,
34 | 0xe2 => 0x201a, 0xe3 => 0x201e, 0xe4 => 0x2030, 0xe5 => 0xc2, 0xe6 => 0xca,
35 | 0xe7 => 0xc1, 0xe8 => 0xcb, 0xe9 => 0xc8, 0xea => 0xcd, 0xeb => 0xce,
36 | 0xec => 0xcf, 0xed => 0xcc, 0xee => 0xd3, 0xef => 0xd4, 0xf0 => 0xf8ff,
37 | 0xf1 => 0xd2, 0xf2 => 0xda, 0xf3 => 0xdb, 0xf4 => 0xd9, 0xf5 => 0x0131,
38 | 0xf6 => 0x02c6, 0xf7 => 0x02dc, 0xf8 => 0xaf, 0xf9 => 0x02d8, 0xfa => 0x02d9,
39 | 0xfb => 0x02da, 0xfc => 0xb8, 0xfd => 0x02dd, 0xfe => 0x02db, 0xff => 0x02c7,
40 | );
41 |
42 | 1; # end
43 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/Cyrillic.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Cyrillic.pm
3 | #
4 | # Description: cp1251 to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::Cyrillic = (
15 | 0x80 => 0x0402, 0x81 => 0x0403, 0x82 => 0x201a, 0x83 => 0x0453,
16 | 0x84 => 0x201e, 0x85 => 0x2026, 0x86 => 0x2020, 0x87 => 0x2021,
17 | 0x88 => 0x20ac, 0x89 => 0x2030, 0x8a => 0x0409, 0x8b => 0x2039,
18 | 0x8c => 0x040a, 0x8d => 0x040c, 0x8e => 0x040b, 0x8f => 0x040f,
19 | 0x90 => 0x0452, 0x91 => 0x2018, 0x92 => 0x2019, 0x93 => 0x201c,
20 | 0x94 => 0x201d, 0x95 => 0x2022, 0x96 => 0x2013, 0x97 => 0x2014,
21 | 0x99 => 0x2122, 0x9a => 0x0459, 0x9b => 0x203a, 0x9c => 0x045a,
22 | 0x9d => 0x045c, 0x9e => 0x045b, 0x9f => 0x045f, 0xa1 => 0x040e,
23 | 0xa2 => 0x045e, 0xa3 => 0x0408, 0xa5 => 0x0490, 0xa8 => 0x0401,
24 | 0xaa => 0x0404, 0xaf => 0x0407, 0xb2 => 0x0406, 0xb3 => 0x0456,
25 | 0xb4 => 0x0491, 0xb8 => 0x0451, 0xb9 => 0x2116, 0xba => 0x0454,
26 | 0xbc => 0x0458, 0xbd => 0x0405, 0xbe => 0x0455, 0xbf => 0x0457,
27 | 0xc0 => 0x0410, 0xc1 => 0x0411, 0xc2 => 0x0412, 0xc3 => 0x0413,
28 | 0xc4 => 0x0414, 0xc5 => 0x0415, 0xc6 => 0x0416, 0xc7 => 0x0417,
29 | 0xc8 => 0x0418, 0xc9 => 0x0419, 0xca => 0x041a, 0xcb => 0x041b,
30 | 0xcc => 0x041c, 0xcd => 0x041d, 0xce => 0x041e, 0xcf => 0x041f,
31 | 0xd0 => 0x0420, 0xd1 => 0x0421, 0xd2 => 0x0422, 0xd3 => 0x0423,
32 | 0xd4 => 0x0424, 0xd5 => 0x0425, 0xd6 => 0x0426, 0xd7 => 0x0427,
33 | 0xd8 => 0x0428, 0xd9 => 0x0429, 0xda => 0x042a, 0xdb => 0x042b,
34 | 0xdc => 0x042c, 0xdd => 0x042d, 0xde => 0x042e, 0xdf => 0x042f,
35 | 0xe0 => 0x0430, 0xe1 => 0x0431, 0xe2 => 0x0432, 0xe3 => 0x0433,
36 | 0xe4 => 0x0434, 0xe5 => 0x0435, 0xe6 => 0x0436, 0xe7 => 0x0437,
37 | 0xe8 => 0x0438, 0xe9 => 0x0439, 0xea => 0x043a, 0xeb => 0x043b,
38 | 0xec => 0x043c, 0xed => 0x043d, 0xee => 0x043e, 0xef => 0x043f,
39 | 0xf0 => 0x0440, 0xf1 => 0x0441, 0xf2 => 0x0442, 0xf3 => 0x0443,
40 | 0xf4 => 0x0444, 0xf5 => 0x0445, 0xf6 => 0x0446, 0xf7 => 0x0447,
41 | 0xf8 => 0x0448, 0xf9 => 0x0449, 0xfa => 0x044a, 0xfb => 0x044b,
42 | 0xfc => 0x044c, 0xfd => 0x044d, 0xfe => 0x044e, 0xff => 0x044f,
43 | );
44 |
45 | 1; # end
46 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/MacTurkish.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: MacTurkish.pm
3 | #
4 | # Description: Mac Turkish to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/TURKISH.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::MacTurkish = (
15 | 0x80 => 0xc4, 0x81 => 0xc5, 0x82 => 0xc7, 0x83 => 0xc9, 0x84 => 0xd1,
16 | 0x85 => 0xd6, 0x86 => 0xdc, 0x87 => 0xe1, 0x88 => 0xe0, 0x89 => 0xe2,
17 | 0x8a => 0xe4, 0x8b => 0xe3, 0x8c => 0xe5, 0x8d => 0xe7, 0x8e => 0xe9,
18 | 0x8f => 0xe8, 0x90 => 0xea, 0x91 => 0xeb, 0x92 => 0xed, 0x93 => 0xec,
19 | 0x94 => 0xee, 0x95 => 0xef, 0x96 => 0xf1, 0x97 => 0xf3, 0x98 => 0xf2,
20 | 0x99 => 0xf4, 0x9a => 0xf6, 0x9b => 0xf5, 0x9c => 0xfa, 0x9d => 0xf9,
21 | 0x9e => 0xfb, 0x9f => 0xfc, 0xa0 => 0x2020, 0xa1 => 0xb0, 0xa4 => 0xa7,
22 | 0xa5 => 0x2022, 0xa6 => 0xb6, 0xa7 => 0xdf, 0xa8 => 0xae, 0xaa => 0x2122,
23 | 0xab => 0xb4, 0xac => 0xa8, 0xad => 0x2260, 0xae => 0xc6, 0xaf => 0xd8,
24 | 0xb0 => 0x221e, 0xb2 => 0x2264, 0xb3 => 0x2265, 0xb4 => 0xa5, 0xb6 => 0x2202,
25 | 0xb7 => 0x2211, 0xb8 => 0x220f, 0xb9 => 0x03c0, 0xba => 0x222b, 0xbb => 0xaa,
26 | 0xbc => 0xba, 0xbd => 0x03a9, 0xbe => 0xe6, 0xbf => 0xf8, 0xc0 => 0xbf,
27 | 0xc1 => 0xa1, 0xc2 => 0xac, 0xc3 => 0x221a, 0xc4 => 0x0192, 0xc5 => 0x2248,
28 | 0xc6 => 0x2206, 0xc7 => 0xab, 0xc8 => 0xbb, 0xc9 => 0x2026, 0xca => 0xa0,
29 | 0xcb => 0xc0, 0xcc => 0xc3, 0xcd => 0xd5, 0xce => 0x0152, 0xcf => 0x0153,
30 | 0xd0 => 0x2013, 0xd1 => 0x2014, 0xd2 => 0x201c, 0xd3 => 0x201d,
31 | 0xd4 => 0x2018, 0xd5 => 0x2019, 0xd6 => 0xf7, 0xd7 => 0x25ca, 0xd8 => 0xff,
32 | 0xd9 => 0x0178, 0xda => 0x011e, 0xdb => 0x011f, 0xdc => 0x0130,
33 | 0xdd => 0x0131, 0xde => 0x015e, 0xdf => 0x015f, 0xe0 => 0x2021, 0xe1 => 0xb7,
34 | 0xe2 => 0x201a, 0xe3 => 0x201e, 0xe4 => 0x2030, 0xe5 => 0xc2, 0xe6 => 0xca,
35 | 0xe7 => 0xc1, 0xe8 => 0xcb, 0xe9 => 0xc8, 0xea => 0xcd, 0xeb => 0xce,
36 | 0xec => 0xcf, 0xed => 0xcc, 0xee => 0xd3, 0xef => 0xd4, 0xf0 => 0xf8ff,
37 | 0xf1 => 0xd2, 0xf2 => 0xda, 0xf3 => 0xdb, 0xf4 => 0xd9, 0xf5 => 0xf8a0,
38 | 0xf6 => 0x02c6, 0xf7 => 0x02dc, 0xf8 => 0xaf, 0xf9 => 0x02d8, 0xfa => 0x02d9,
39 | 0xfb => 0x02da, 0xfc => 0xb8, 0xfd => 0x02dd, 0xfe => 0x02db, 0xff => 0x02c7,
40 | );
41 |
42 | 1; # end
43 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/MacRomanian.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: MacRomanian.pm
3 | #
4 | # Description: Mac Romanian to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMANIAN.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::MacRomanian = (
15 | 0x80 => 0xc4, 0x81 => 0xc5, 0x82 => 0xc7, 0x83 => 0xc9, 0x84 => 0xd1,
16 | 0x85 => 0xd6, 0x86 => 0xdc, 0x87 => 0xe1, 0x88 => 0xe0, 0x89 => 0xe2,
17 | 0x8a => 0xe4, 0x8b => 0xe3, 0x8c => 0xe5, 0x8d => 0xe7, 0x8e => 0xe9,
18 | 0x8f => 0xe8, 0x90 => 0xea, 0x91 => 0xeb, 0x92 => 0xed, 0x93 => 0xec,
19 | 0x94 => 0xee, 0x95 => 0xef, 0x96 => 0xf1, 0x97 => 0xf3, 0x98 => 0xf2,
20 | 0x99 => 0xf4, 0x9a => 0xf6, 0x9b => 0xf5, 0x9c => 0xfa, 0x9d => 0xf9,
21 | 0x9e => 0xfb, 0x9f => 0xfc, 0xa0 => 0x2020, 0xa1 => 0xb0, 0xa4 => 0xa7,
22 | 0xa5 => 0x2022, 0xa6 => 0xb6, 0xa7 => 0xdf, 0xa8 => 0xae, 0xaa => 0x2122,
23 | 0xab => 0xb4, 0xac => 0xa8, 0xad => 0x2260, 0xae => 0x0102, 0xaf => 0x0218,
24 | 0xb0 => 0x221e, 0xb2 => 0x2264, 0xb3 => 0x2265, 0xb4 => 0xa5, 0xb6 => 0x2202,
25 | 0xb7 => 0x2211, 0xb8 => 0x220f, 0xb9 => 0x03c0, 0xba => 0x222b, 0xbb => 0xaa,
26 | 0xbc => 0xba, 0xbd => 0x03a9, 0xbe => 0x0103, 0xbf => 0x0219, 0xc0 => 0xbf,
27 | 0xc1 => 0xa1, 0xc2 => 0xac, 0xc3 => 0x221a, 0xc4 => 0x0192, 0xc5 => 0x2248,
28 | 0xc6 => 0x2206, 0xc7 => 0xab, 0xc8 => 0xbb, 0xc9 => 0x2026, 0xca => 0xa0,
29 | 0xcb => 0xc0, 0xcc => 0xc3, 0xcd => 0xd5, 0xce => 0x0152, 0xcf => 0x0153,
30 | 0xd0 => 0x2013, 0xd1 => 0x2014, 0xd2 => 0x201c, 0xd3 => 0x201d,
31 | 0xd4 => 0x2018, 0xd5 => 0x2019, 0xd6 => 0xf7, 0xd7 => 0x25ca, 0xd8 => 0xff,
32 | 0xd9 => 0x0178, 0xda => 0x2044, 0xdb => 0x20ac, 0xdc => 0x2039,
33 | 0xdd => 0x203a, 0xde => 0x021a, 0xdf => 0x021b, 0xe0 => 0x2021, 0xe1 => 0xb7,
34 | 0xe2 => 0x201a, 0xe3 => 0x201e, 0xe4 => 0x2030, 0xe5 => 0xc2, 0xe6 => 0xca,
35 | 0xe7 => 0xc1, 0xe8 => 0xcb, 0xe9 => 0xc8, 0xea => 0xcd, 0xeb => 0xce,
36 | 0xec => 0xcf, 0xed => 0xcc, 0xee => 0xd3, 0xef => 0xd4, 0xf0 => 0xf8ff,
37 | 0xf1 => 0xd2, 0xf2 => 0xda, 0xf3 => 0xdb, 0xf4 => 0xd9, 0xf5 => 0x0131,
38 | 0xf6 => 0x02c6, 0xf7 => 0x02dc, 0xf8 => 0xaf, 0xf9 => 0x02d8, 0xfa => 0x02d9,
39 | 0xfb => 0x02da, 0xfc => 0xb8, 0xfd => 0x02dd, 0xfe => 0x02db, 0xff => 0x02c7,
40 | );
41 |
42 | 1; # end
43 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/MacCroatian.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: MacCroatian.pm
3 | #
4 | # Description: Mac Croatian to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/CROATIAN.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::MacCroatian = (
15 | 0x80 => 0xc4, 0x81 => 0xc5, 0x82 => 0xc7, 0x83 => 0xc9, 0x84 => 0xd1,
16 | 0x85 => 0xd6, 0x86 => 0xdc, 0x87 => 0xe1, 0x88 => 0xe0, 0x89 => 0xe2,
17 | 0x8a => 0xe4, 0x8b => 0xe3, 0x8c => 0xe5, 0x8d => 0xe7, 0x8e => 0xe9,
18 | 0x8f => 0xe8, 0x90 => 0xea, 0x91 => 0xeb, 0x92 => 0xed, 0x93 => 0xec,
19 | 0x94 => 0xee, 0x95 => 0xef, 0x96 => 0xf1, 0x97 => 0xf3, 0x98 => 0xf2,
20 | 0x99 => 0xf4, 0x9a => 0xf6, 0x9b => 0xf5, 0x9c => 0xfa, 0x9d => 0xf9,
21 | 0x9e => 0xfb, 0x9f => 0xfc, 0xa0 => 0x2020, 0xa1 => 0xb0, 0xa4 => 0xa7,
22 | 0xa5 => 0x2022, 0xa6 => 0xb6, 0xa7 => 0xdf, 0xa8 => 0xae, 0xa9 => 0x0160,
23 | 0xaa => 0x2122, 0xab => 0xb4, 0xac => 0xa8, 0xad => 0x2260, 0xae => 0x017d,
24 | 0xaf => 0xd8, 0xb0 => 0x221e, 0xb2 => 0x2264, 0xb3 => 0x2265, 0xb4 => 0x2206,
25 | 0xb6 => 0x2202, 0xb7 => 0x2211, 0xb8 => 0x220f, 0xb9 => 0x0161,
26 | 0xba => 0x222b, 0xbb => 0xaa, 0xbc => 0xba, 0xbd => 0x03a9, 0xbe => 0x017e,
27 | 0xbf => 0xf8, 0xc0 => 0xbf, 0xc1 => 0xa1, 0xc2 => 0xac, 0xc3 => 0x221a,
28 | 0xc4 => 0x0192, 0xc5 => 0x2248, 0xc6 => 0x0106, 0xc7 => 0xab, 0xc8 => 0x010c,
29 | 0xc9 => 0x2026, 0xca => 0xa0, 0xcb => 0xc0, 0xcc => 0xc3, 0xcd => 0xd5,
30 | 0xce => 0x0152, 0xcf => 0x0153, 0xd0 => 0x0110, 0xd1 => 0x2014,
31 | 0xd2 => 0x201c, 0xd3 => 0x201d, 0xd4 => 0x2018, 0xd5 => 0x2019, 0xd6 => 0xf7,
32 | 0xd7 => 0x25ca, 0xd8 => 0xf8ff, 0xd9 => 0xa9, 0xda => 0x2044, 0xdb => 0x20ac,
33 | 0xdc => 0x2039, 0xdd => 0x203a, 0xde => 0xc6, 0xdf => 0xbb, 0xe0 => 0x2013,
34 | 0xe1 => 0xb7, 0xe2 => 0x201a, 0xe3 => 0x201e, 0xe4 => 0x2030, 0xe5 => 0xc2,
35 | 0xe6 => 0x0107, 0xe7 => 0xc1, 0xe8 => 0x010d, 0xe9 => 0xc8, 0xea => 0xcd,
36 | 0xeb => 0xce, 0xec => 0xcf, 0xed => 0xcc, 0xee => 0xd3, 0xef => 0xd4,
37 | 0xf0 => 0x0111, 0xf1 => 0xd2, 0xf2 => 0xda, 0xf3 => 0xdb, 0xf4 => 0xd9,
38 | 0xf5 => 0x0131, 0xf6 => 0x02c6, 0xf7 => 0x02dc, 0xf8 => 0xaf, 0xf9 => 0x03c0,
39 | 0xfa => 0xcb, 0xfb => 0x02da, 0xfc => 0xb8, 0xfd => 0xca, 0xfe => 0xe6,
40 | 0xff => 0x02c7,
41 | );
42 |
43 | 1; # end
44 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/MacGreek.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: MacGreek.pm
3 | #
4 | # Description: Mac Greek to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/GREEK.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::MacGreek = (
15 | 0x80 => 0xc4, 0x81 => 0xb9, 0x82 => 0xb2, 0x83 => 0xc9, 0x84 => 0xb3,
16 | 0x85 => 0xd6, 0x86 => 0xdc, 0x87 => 0x0385, 0x88 => 0xe0, 0x89 => 0xe2,
17 | 0x8a => 0xe4, 0x8b => 0x0384, 0x8c => 0xa8, 0x8d => 0xe7, 0x8e => 0xe9,
18 | 0x8f => 0xe8, 0x90 => 0xea, 0x91 => 0xeb, 0x92 => 0xa3, 0x93 => 0x2122,
19 | 0x94 => 0xee, 0x95 => 0xef, 0x96 => 0x2022, 0x97 => 0xbd, 0x98 => 0x2030,
20 | 0x99 => 0xf4, 0x9a => 0xf6, 0x9b => 0xa6, 0x9c => 0x20ac, 0x9d => 0xf9,
21 | 0x9e => 0xfb, 0x9f => 0xfc, 0xa0 => 0x2020, 0xa1 => 0x0393, 0xa2 => 0x0394,
22 | 0xa3 => 0x0398, 0xa4 => 0x039b, 0xa5 => 0x039e, 0xa6 => 0x03a0, 0xa7 => 0xdf,
23 | 0xa8 => 0xae, 0xaa => 0x03a3, 0xab => 0x03aa, 0xac => 0xa7, 0xad => 0x2260,
24 | 0xae => 0xb0, 0xaf => 0xb7, 0xb0 => 0x0391, 0xb2 => 0x2264, 0xb3 => 0x2265,
25 | 0xb4 => 0xa5, 0xb5 => 0x0392, 0xb6 => 0x0395, 0xb7 => 0x0396, 0xb8 => 0x0397,
26 | 0xb9 => 0x0399, 0xba => 0x039a, 0xbb => 0x039c, 0xbc => 0x03a6,
27 | 0xbd => 0x03ab, 0xbe => 0x03a8, 0xbf => 0x03a9, 0xc0 => 0x03ac,
28 | 0xc1 => 0x039d, 0xc2 => 0xac, 0xc3 => 0x039f, 0xc4 => 0x03a1, 0xc5 => 0x2248,
29 | 0xc6 => 0x03a4, 0xc7 => 0xab, 0xc8 => 0xbb, 0xc9 => 0x2026, 0xca => 0xa0,
30 | 0xcb => 0x03a5, 0xcc => 0x03a7, 0xcd => 0x0386, 0xce => 0x0388,
31 | 0xcf => 0x0153, 0xd0 => 0x2013, 0xd1 => 0x2015, 0xd2 => 0x201c,
32 | 0xd3 => 0x201d, 0xd4 => 0x2018, 0xd5 => 0x2019, 0xd6 => 0xf7, 0xd7 => 0x0389,
33 | 0xd8 => 0x038a, 0xd9 => 0x038c, 0xda => 0x038e, 0xdb => 0x03ad,
34 | 0xdc => 0x03ae, 0xdd => 0x03af, 0xde => 0x03cc, 0xdf => 0x038f,
35 | 0xe0 => 0x03cd, 0xe1 => 0x03b1, 0xe2 => 0x03b2, 0xe3 => 0x03c8,
36 | 0xe4 => 0x03b4, 0xe5 => 0x03b5, 0xe6 => 0x03c6, 0xe7 => 0x03b3,
37 | 0xe8 => 0x03b7, 0xe9 => 0x03b9, 0xea => 0x03be, 0xeb => 0x03ba,
38 | 0xec => 0x03bb, 0xed => 0x03bc, 0xee => 0x03bd, 0xef => 0x03bf,
39 | 0xf0 => 0x03c0, 0xf1 => 0x03ce, 0xf2 => 0x03c1, 0xf3 => 0x03c3,
40 | 0xf4 => 0x03c4, 0xf5 => 0x03b8, 0xf6 => 0x03c9, 0xf7 => 0x03c2,
41 | 0xf8 => 0x03c7, 0xf9 => 0x03c5, 0xfa => 0x03b6, 0xfb => 0x03ca,
42 | 0xfc => 0x03cb, 0xfd => 0x0390, 0xfe => 0x03b0, 0xff => 0xad,
43 | );
44 |
45 | 1; # end
46 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/MacLatin2.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: MacLatin2.pm
3 | #
4 | # Description: Mac Central European to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/CENTEURO.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::MacLatin2 = (
15 | 0x80 => 0xc4, 0x81 => 0x0100, 0x82 => 0x0101, 0x83 => 0xc9, 0x84 => 0x0104,
16 | 0x85 => 0xd6, 0x86 => 0xdc, 0x87 => 0xe1, 0x88 => 0x0105, 0x89 => 0x010c,
17 | 0x8a => 0xe4, 0x8b => 0x010d, 0x8c => 0x0106, 0x8d => 0x0107, 0x8e => 0xe9,
18 | 0x8f => 0x0179, 0x90 => 0x017a, 0x91 => 0x010e, 0x92 => 0xed, 0x93 => 0x010f,
19 | 0x94 => 0x0112, 0x95 => 0x0113, 0x96 => 0x0116, 0x97 => 0xf3, 0x98 => 0x0117,
20 | 0x99 => 0xf4, 0x9a => 0xf6, 0x9b => 0xf5, 0x9c => 0xfa, 0x9d => 0x011a,
21 | 0x9e => 0x011b, 0x9f => 0xfc, 0xa0 => 0x2020, 0xa1 => 0xb0, 0xa2 => 0x0118,
22 | 0xa4 => 0xa7, 0xa5 => 0x2022, 0xa6 => 0xb6, 0xa7 => 0xdf, 0xa8 => 0xae,
23 | 0xaa => 0x2122, 0xab => 0x0119, 0xac => 0xa8, 0xad => 0x2260, 0xae => 0x0123,
24 | 0xaf => 0x012e, 0xb0 => 0x012f, 0xb1 => 0x012a, 0xb2 => 0x2264,
25 | 0xb3 => 0x2265, 0xb4 => 0x012b, 0xb5 => 0x0136, 0xb6 => 0x2202,
26 | 0xb7 => 0x2211, 0xb8 => 0x0142, 0xb9 => 0x013b, 0xba => 0x013c,
27 | 0xbb => 0x013d, 0xbc => 0x013e, 0xbd => 0x0139, 0xbe => 0x013a,
28 | 0xbf => 0x0145, 0xc0 => 0x0146, 0xc1 => 0x0143, 0xc2 => 0xac, 0xc3 => 0x221a,
29 | 0xc4 => 0x0144, 0xc5 => 0x0147, 0xc6 => 0x2206, 0xc7 => 0xab, 0xc8 => 0xbb,
30 | 0xc9 => 0x2026, 0xca => 0xa0, 0xcb => 0x0148, 0xcc => 0x0150, 0xcd => 0xd5,
31 | 0xce => 0x0151, 0xcf => 0x014c, 0xd0 => 0x2013, 0xd1 => 0x2014,
32 | 0xd2 => 0x201c, 0xd3 => 0x201d, 0xd4 => 0x2018, 0xd5 => 0x2019, 0xd6 => 0xf7,
33 | 0xd7 => 0x25ca, 0xd8 => 0x014d, 0xd9 => 0x0154, 0xda => 0x0155,
34 | 0xdb => 0x0158, 0xdc => 0x2039, 0xdd => 0x203a, 0xde => 0x0159,
35 | 0xdf => 0x0156, 0xe0 => 0x0157, 0xe1 => 0x0160, 0xe2 => 0x201a,
36 | 0xe3 => 0x201e, 0xe4 => 0x0161, 0xe5 => 0x015a, 0xe6 => 0x015b, 0xe7 => 0xc1,
37 | 0xe8 => 0x0164, 0xe9 => 0x0165, 0xea => 0xcd, 0xeb => 0x017d, 0xec => 0x017e,
38 | 0xed => 0x016a, 0xee => 0xd3, 0xef => 0xd4, 0xf0 => 0x016b, 0xf1 => 0x016e,
39 | 0xf2 => 0xda, 0xf3 => 0x016f, 0xf4 => 0x0170, 0xf5 => 0x0171, 0xf6 => 0x0172,
40 | 0xf7 => 0x0173, 0xf8 => 0xdd, 0xf9 => 0xfd, 0xfa => 0x0137, 0xfb => 0x017b,
41 | 0xfc => 0x0141, 0xfd => 0x017c, 0xfe => 0x0122, 0xff => 0x02c7,
42 | );
43 |
44 | 1; # end
45 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/MacCyrillic.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: MacCyrillic.pm
3 | #
4 | # Description: Mac Cyrillic to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::MacCyrillic = (
15 | 0x80 => 0x0410, 0x81 => 0x0411, 0x82 => 0x0412, 0x83 => 0x0413,
16 | 0x84 => 0x0414, 0x85 => 0x0415, 0x86 => 0x0416, 0x87 => 0x0417,
17 | 0x88 => 0x0418, 0x89 => 0x0419, 0x8a => 0x041a, 0x8b => 0x041b,
18 | 0x8c => 0x041c, 0x8d => 0x041d, 0x8e => 0x041e, 0x8f => 0x041f,
19 | 0x90 => 0x0420, 0x91 => 0x0421, 0x92 => 0x0422, 0x93 => 0x0423,
20 | 0x94 => 0x0424, 0x95 => 0x0425, 0x96 => 0x0426, 0x97 => 0x0427,
21 | 0x98 => 0x0428, 0x99 => 0x0429, 0x9a => 0x042a, 0x9b => 0x042b,
22 | 0x9c => 0x042c, 0x9d => 0x042d, 0x9e => 0x042e, 0x9f => 0x042f,
23 | 0xa0 => 0x2020, 0xa1 => 0xb0, 0xa2 => 0x0490, 0xa4 => 0xa7, 0xa5 => 0x2022,
24 | 0xa6 => 0xb6, 0xa7 => 0x0406, 0xa8 => 0xae, 0xaa => 0x2122, 0xab => 0x0402,
25 | 0xac => 0x0452, 0xad => 0x2260, 0xae => 0x0403, 0xaf => 0x0453,
26 | 0xb0 => 0x221e, 0xb2 => 0x2264, 0xb3 => 0x2265, 0xb4 => 0x0456,
27 | 0xb6 => 0x0491, 0xb7 => 0x0408, 0xb8 => 0x0404, 0xb9 => 0x0454,
28 | 0xba => 0x0407, 0xbb => 0x0457, 0xbc => 0x0409, 0xbd => 0x0459,
29 | 0xbe => 0x040a, 0xbf => 0x045a, 0xc0 => 0x0458, 0xc1 => 0x0405, 0xc2 => 0xac,
30 | 0xc3 => 0x221a, 0xc4 => 0x0192, 0xc5 => 0x2248, 0xc6 => 0x2206, 0xc7 => 0xab,
31 | 0xc8 => 0xbb, 0xc9 => 0x2026, 0xca => 0xa0, 0xcb => 0x040b, 0xcc => 0x045b,
32 | 0xcd => 0x040c, 0xce => 0x045c, 0xcf => 0x0455, 0xd0 => 0x2013,
33 | 0xd1 => 0x2014, 0xd2 => 0x201c, 0xd3 => 0x201d, 0xd4 => 0x2018,
34 | 0xd5 => 0x2019, 0xd6 => 0xf7, 0xd7 => 0x201e, 0xd8 => 0x040e, 0xd9 => 0x045e,
35 | 0xda => 0x040f, 0xdb => 0x045f, 0xdc => 0x2116, 0xdd => 0x0401,
36 | 0xde => 0x0451, 0xdf => 0x044f, 0xe0 => 0x0430, 0xe1 => 0x0431,
37 | 0xe2 => 0x0432, 0xe3 => 0x0433, 0xe4 => 0x0434, 0xe5 => 0x0435,
38 | 0xe6 => 0x0436, 0xe7 => 0x0437, 0xe8 => 0x0438, 0xe9 => 0x0439,
39 | 0xea => 0x043a, 0xeb => 0x043b, 0xec => 0x043c, 0xed => 0x043d,
40 | 0xee => 0x043e, 0xef => 0x043f, 0xf0 => 0x0440, 0xf1 => 0x0441,
41 | 0xf2 => 0x0442, 0xf3 => 0x0443, 0xf4 => 0x0444, 0xf5 => 0x0445,
42 | 0xf6 => 0x0446, 0xf7 => 0x0447, 0xf8 => 0x0448, 0xf9 => 0x0449,
43 | 0xfa => 0x044a, 0xfb => 0x044b, 0xfc => 0x044c, 0xfd => 0x044d,
44 | 0xfe => 0x044e, 0xff => 0x20ac,
45 | );
46 |
47 | 1; # end
48 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/MacArabic.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: MacArabic.pm
3 | #
4 | # Description: Mac Arabic to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/ARABIC.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | # and directional characters are ignored
12 | #------------------------------------------------------------------------------
13 | use strict;
14 |
15 | %Image::ExifTool::Charset::MacArabic = (
16 | 0x80 => 0xc4, 0x81 => 0xa0, 0x82 => 0xc7, 0x83 => 0xc9, 0x84 => 0xd1,
17 | 0x85 => 0xd6, 0x86 => 0xdc, 0x87 => 0xe1, 0x88 => 0xe0, 0x89 => 0xe2,
18 | 0x8a => 0xe4, 0x8b => 0x06ba, 0x8c => 0xab, 0x8d => 0xe7, 0x8e => 0xe9,
19 | 0x8f => 0xe8, 0x90 => 0xea, 0x91 => 0xeb, 0x92 => 0xed, 0x93 => 0x2026,
20 | 0x94 => 0xee, 0x95 => 0xef, 0x96 => 0xf1, 0x97 => 0xf3, 0x98 => 0xbb,
21 | 0x99 => 0xf4, 0x9a => 0xf6, 0x9b => 0xf7, 0x9c => 0xfa, 0x9d => 0xf9,
22 | 0x9e => 0xfb, 0x9f => 0xfc, 0xa0 => 0x20, 0xa1 => 0x21, 0xa2 => 0x22,
23 | 0xa3 => 0x23, 0xa4 => 0x24, 0xa5 => 0x066a, 0xa6 => 0x26, 0xa7 => 0x27,
24 | 0xa8 => 0x28, 0xa9 => 0x29, 0xaa => 0x2a, 0xab => 0x2b, 0xac => 0x060c,
25 | 0xad => 0x2d, 0xae => 0x2e, 0xaf => 0x2f, 0xb0 => 0x0660, 0xb1 => 0x0661,
26 | 0xb2 => 0x0662, 0xb3 => 0x0663, 0xb4 => 0x0664, 0xb5 => 0x0665,
27 | 0xb6 => 0x0666, 0xb7 => 0x0667, 0xb8 => 0x0668, 0xb9 => 0x0669, 0xba => 0x3a,
28 | 0xbb => 0x061b, 0xbc => 0x3c, 0xbd => 0x3d, 0xbe => 0x3e, 0xbf => 0x061f,
29 | 0xc0 => 0x274a, 0xc1 => 0x0621, 0xc2 => 0x0622, 0xc3 => 0x0623,
30 | 0xc4 => 0x0624, 0xc5 => 0x0625, 0xc6 => 0x0626, 0xc7 => 0x0627,
31 | 0xc8 => 0x0628, 0xc9 => 0x0629, 0xca => 0x062a, 0xcb => 0x062b,
32 | 0xcc => 0x062c, 0xcd => 0x062d, 0xce => 0x062e, 0xcf => 0x062f,
33 | 0xd0 => 0x0630, 0xd1 => 0x0631, 0xd2 => 0x0632, 0xd3 => 0x0633,
34 | 0xd4 => 0x0634, 0xd5 => 0x0635, 0xd6 => 0x0636, 0xd7 => 0x0637,
35 | 0xd8 => 0x0638, 0xd9 => 0x0639, 0xda => 0x063a, 0xdb => 0x5b, 0xdc => 0x5c,
36 | 0xdd => 0x5d, 0xde => 0x5e, 0xdf => 0x5f, 0xe0 => 0x0640, 0xe1 => 0x0641,
37 | 0xe2 => 0x0642, 0xe3 => 0x0643, 0xe4 => 0x0644, 0xe5 => 0x0645,
38 | 0xe6 => 0x0646, 0xe7 => 0x0647, 0xe8 => 0x0648, 0xe9 => 0x0649,
39 | 0xea => 0x064a, 0xeb => 0x064b, 0xec => 0x064c, 0xed => 0x064d,
40 | 0xee => 0x064e, 0xef => 0x064f, 0xf0 => 0x0650, 0xf1 => 0x0651,
41 | 0xf2 => 0x0652, 0xf3 => 0x067e, 0xf4 => 0x0679, 0xf5 => 0x0686,
42 | 0xf6 => 0x06d5, 0xf7 => 0x06a4, 0xf8 => 0x06af, 0xf9 => 0x0688,
43 | 0xfa => 0x0691, 0xfb => 0x7b, 0xfc => 0x7c, 0xfd => 0x7d, 0xfe => 0x0698,
44 | 0xff => 0x06d2,
45 | );
46 |
47 | 1; # end
48 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/MacHebrew.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: MacHebrew.pm
3 | #
4 | # Description: Mac Hebrew to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/HEBREW.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | # and directional characters are ignored
12 | #------------------------------------------------------------------------------
13 | use strict;
14 |
15 | %Image::ExifTool::Charset::MacHebrew = (
16 | 0x80 => 0xc4, 0x81 => [0x05f2,0x05b7], 0x82 => 0xc7, 0x83 => 0xc9,
17 | 0x84 => 0xd1, 0x85 => 0xd6, 0x86 => 0xdc, 0x87 => 0xe1, 0x88 => 0xe0,
18 | 0x89 => 0xe2, 0x8a => 0xe4, 0x8b => 0xe3, 0x8c => 0xe5, 0x8d => 0xe7,
19 | 0x8e => 0xe9, 0x8f => 0xe8, 0x90 => 0xea, 0x91 => 0xeb, 0x92 => 0xed,
20 | 0x93 => 0xec, 0x94 => 0xee, 0x95 => 0xef, 0x96 => 0xf1, 0x97 => 0xf3,
21 | 0x98 => 0xf2, 0x99 => 0xf4, 0x9a => 0xf6, 0x9b => 0xf5, 0x9c => 0xfa,
22 | 0x9d => 0xf9, 0x9e => 0xfb, 0x9f => 0xfc, 0xa0 => 0x20, 0xa1 => 0x21,
23 | 0xa2 => 0x22, 0xa3 => 0x23, 0xa4 => 0x24, 0xa5 => 0x25, 0xa6 => 0x20aa,
24 | 0xa7 => 0x27, 0xa8 => 0x29, 0xa9 => 0x28, 0xaa => 0x2a, 0xab => 0x2b,
25 | 0xac => 0x2c, 0xad => 0x2d, 0xae => 0x2e, 0xaf => 0x2f, 0xb0 => 0x30,
26 | 0xb1 => 0x31, 0xb2 => 0x32, 0xb3 => 0x33, 0xb4 => 0x34, 0xb5 => 0x35,
27 | 0xb6 => 0x36, 0xb7 => 0x37, 0xb8 => 0x38, 0xb9 => 0x39, 0xba => 0x3a,
28 | 0xbb => 0x3b, 0xbc => 0x3c, 0xbd => 0x3d, 0xbe => 0x3e, 0xbf => 0x3f,
29 | 0xc0 => [0xf86a,0x05dc,0x05b9], 0xc1 => 0x201e, 0xc2 => 0xf89b,
30 | 0xc3 => 0xf89c, 0xc4 => 0xf89d, 0xc5 => 0xf89e, 0xc6 => 0x05bc,
31 | 0xc7 => 0xfb4b, 0xc8 => 0xfb35, 0xc9 => 0x2026, 0xca => 0xa0, 0xcb => 0x05b8,
32 | 0xcc => 0x05b7, 0xcd => 0x05b5, 0xce => 0x05b6, 0xcf => 0x05b4,
33 | 0xd0 => 0x2013, 0xd1 => 0x2014, 0xd2 => 0x201c, 0xd3 => 0x201d,
34 | 0xd4 => 0x2018, 0xd5 => 0x2019, 0xd6 => 0xfb2a, 0xd7 => 0xfb2b,
35 | 0xd8 => 0x05bf, 0xd9 => 0x05b0, 0xda => 0x05b2, 0xdb => 0x05b1,
36 | 0xdc => 0x05bb, 0xdd => 0x05b9, 0xde => [0x05b8,0xf87f], 0xdf => 0x05b3,
37 | 0xe0 => 0x05d0, 0xe1 => 0x05d1, 0xe2 => 0x05d2, 0xe3 => 0x05d3,
38 | 0xe4 => 0x05d4, 0xe5 => 0x05d5, 0xe6 => 0x05d6, 0xe7 => 0x05d7,
39 | 0xe8 => 0x05d8, 0xe9 => 0x05d9, 0xea => 0x05da, 0xeb => 0x05db,
40 | 0xec => 0x05dc, 0xed => 0x05dd, 0xee => 0x05de, 0xef => 0x05df,
41 | 0xf0 => 0x05e0, 0xf1 => 0x05e1, 0xf2 => 0x05e2, 0xf3 => 0x05e3,
42 | 0xf4 => 0x05e4, 0xf5 => 0x05e5, 0xf6 => 0x05e6, 0xf7 => 0x05e7,
43 | 0xf8 => 0x05e8, 0xf9 => 0x05e9, 0xfa => 0x05ea, 0xfb => 0x7d, 0xfc => 0x5d,
44 | 0xfd => 0x7b, 0xfe => 0x5b, 0xff => 0x7c,
45 | );
46 |
47 | 1; # end
48 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/MacThai.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: MacThai.pm
3 | #
4 | # Description: Mac Thai to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/THAI.TXT
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode
11 | #------------------------------------------------------------------------------
12 | use strict;
13 |
14 | %Image::ExifTool::Charset::MacThai = (
15 | 0x80 => 0xab, 0x81 => 0xbb, 0x82 => 0x2026, 0x83 => [0x0e48,0xf875],
16 | 0x84 => [0x0e49,0xf875], 0x85 => [0x0e4a,0xf875], 0x86 => [0x0e4b,0xf875],
17 | 0x87 => [0x0e4c,0xf875], 0x88 => [0x0e48,0xf873], 0x89 => [0x0e49,0xf873],
18 | 0x8a => [0x0e4a,0xf873], 0x8b => [0x0e4b,0xf873], 0x8c => [0x0e4c,0xf873],
19 | 0x8d => 0x201c, 0x8e => 0x201d, 0x8f => [0x0e4d,0xf874], 0x91 => 0x2022,
20 | 0x92 => [0x0e31,0xf874], 0x93 => [0x0e47,0xf874], 0x94 => [0x0e34,0xf874],
21 | 0x95 => [0x0e35,0xf874], 0x96 => [0x0e36,0xf874], 0x97 => [0x0e37,0xf874],
22 | 0x98 => [0x0e48,0xf874], 0x99 => [0x0e49,0xf874], 0x9a => [0x0e4a,0xf874],
23 | 0x9b => [0x0e4b,0xf874], 0x9c => [0x0e4c,0xf874], 0x9d => 0x2018,
24 | 0x9e => 0x2019, 0xa1 => 0x0e01, 0xa2 => 0x0e02, 0xa3 => 0x0e03,
25 | 0xa4 => 0x0e04, 0xa5 => 0x0e05, 0xa6 => 0x0e06, 0xa7 => 0x0e07,
26 | 0xa8 => 0x0e08, 0xa9 => 0x0e09, 0xaa => 0x0e0a, 0xab => 0x0e0b,
27 | 0xac => 0x0e0c, 0xad => 0x0e0d, 0xae => 0x0e0e, 0xaf => 0x0e0f,
28 | 0xb0 => 0x0e10, 0xb1 => 0x0e11, 0xb2 => 0x0e12, 0xb3 => 0x0e13,
29 | 0xb4 => 0x0e14, 0xb5 => 0x0e15, 0xb6 => 0x0e16, 0xb7 => 0x0e17,
30 | 0xb8 => 0x0e18, 0xb9 => 0x0e19, 0xba => 0x0e1a, 0xbb => 0x0e1b,
31 | 0xbc => 0x0e1c, 0xbd => 0x0e1d, 0xbe => 0x0e1e, 0xbf => 0x0e1f,
32 | 0xc0 => 0x0e20, 0xc1 => 0x0e21, 0xc2 => 0x0e22, 0xc3 => 0x0e23,
33 | 0xc4 => 0x0e24, 0xc5 => 0x0e25, 0xc6 => 0x0e26, 0xc7 => 0x0e27,
34 | 0xc8 => 0x0e28, 0xc9 => 0x0e29, 0xca => 0x0e2a, 0xcb => 0x0e2b,
35 | 0xcc => 0x0e2c, 0xcd => 0x0e2d, 0xce => 0x0e2e, 0xcf => 0x0e2f,
36 | 0xd0 => 0x0e30, 0xd1 => 0x0e31, 0xd2 => 0x0e32, 0xd3 => 0x0e33,
37 | 0xd4 => 0x0e34, 0xd5 => 0x0e35, 0xd6 => 0x0e36, 0xd7 => 0x0e37,
38 | 0xd8 => 0x0e38, 0xd9 => 0x0e39, 0xda => 0x0e3a, 0xdb => 0x2060,
39 | 0xdc => 0x200b, 0xdd => 0x2013, 0xde => 0x2014, 0xdf => 0x0e3f,
40 | 0xe0 => 0x0e40, 0xe1 => 0x0e41, 0xe2 => 0x0e42, 0xe3 => 0x0e43,
41 | 0xe4 => 0x0e44, 0xe5 => 0x0e45, 0xe6 => 0x0e46, 0xe7 => 0x0e47,
42 | 0xe8 => 0x0e48, 0xe9 => 0x0e49, 0xea => 0x0e4a, 0xeb => 0x0e4b,
43 | 0xec => 0x0e4c, 0xed => 0x0e4d, 0xee => 0x2122, 0xef => 0x0e4f,
44 | 0xf0 => 0x0e50, 0xf1 => 0x0e51, 0xf2 => 0x0e52, 0xf3 => 0x0e53,
45 | 0xf4 => 0x0e54, 0xf5 => 0x0e55, 0xf6 => 0x0e56, 0xf7 => 0x0e57,
46 | 0xf8 => 0x0e58, 0xf9 => 0x0e59, 0xfa => 0xae, 0xfb => 0xa9,
47 | );
48 |
49 | 1; # end
50 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Charset/Symbol.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Symbol.pm
3 | #
4 | # Description: Symbol to Unicode
5 | #
6 | # Revisions: 2010/01/20 - P. Harvey created
7 | #
8 | # References: 1) http://blogs.msdn.com/michkap/archive/2005/11/08/490495.aspx
9 | #
10 | # Notes: The table omits 1-byte characters with the same values as Unicode.
11 | # This set re-maps characters with codepoints less than 0x80
12 | # (Although all bytes >= 0x20 should be mapped according to the
13 | # reference, I didn't map chars below 0x80 because I have some
14 | # samples where these are regular ASCII characters, even though
15 | # I think the encoding is probably incorrect for these samples)
16 | #------------------------------------------------------------------------------
17 | use strict;
18 |
19 | %Image::ExifTool::Charset::Symbol = (
20 | 0x80 => 0xf080, 0x81 => 0xf081, 0x82 => 0xf082, 0x83 => 0xf083,
21 | 0x84 => 0xf084, 0x85 => 0xf085, 0x86 => 0xf086, 0x87 => 0xf087,
22 | 0x88 => 0xf088, 0x89 => 0xf089, 0x8a => 0xf08a, 0x8b => 0xf08b,
23 | 0x8c => 0xf08c, 0x8d => 0xf08d, 0x8e => 0xf08e, 0x8f => 0xf08f,
24 | 0x90 => 0xf090, 0x91 => 0xf091, 0x92 => 0xf092, 0x93 => 0xf093,
25 | 0x94 => 0xf094, 0x95 => 0xf095, 0x96 => 0xf096, 0x97 => 0xf097,
26 | 0x98 => 0xf098, 0x99 => 0xf099, 0x9a => 0xf09a, 0x9b => 0xf09b,
27 | 0x9c => 0xf09c, 0x9d => 0xf09d, 0x9e => 0xf09e, 0x9f => 0xf09f,
28 | 0xa0 => 0xf0a0, 0xa1 => 0xf0a1, 0xa2 => 0xf0a2, 0xa3 => 0xf0a3,
29 | 0xa4 => 0xf0a4, 0xa5 => 0xf0a5, 0xa6 => 0xf0a6, 0xa7 => 0xf0a7,
30 | 0xa8 => 0xf0a8, 0xa9 => 0xf0a9, 0xaa => 0xf0aa, 0xab => 0xf0ab,
31 | 0xac => 0xf0ac, 0xad => 0xf0ad, 0xae => 0xf0ae, 0xaf => 0xf0af,
32 | 0xb0 => 0xf0b0, 0xb1 => 0xf0b1, 0xb2 => 0xf0b2, 0xb3 => 0xf0b3,
33 | 0xb4 => 0xf0b4, 0xb5 => 0xf0b5, 0xb6 => 0xf0b6, 0xb7 => 0xf0b7,
34 | 0xb8 => 0xf0b8, 0xb9 => 0xf0b9, 0xba => 0xf0ba, 0xbb => 0xf0bb,
35 | 0xbc => 0xf0bc, 0xbd => 0xf0bd, 0xbe => 0xf0be, 0xbf => 0xf0bf,
36 | 0xc0 => 0xf0c0, 0xc1 => 0xf0c1, 0xc2 => 0xf0c2, 0xc3 => 0xf0c3,
37 | 0xc4 => 0xf0c4, 0xc5 => 0xf0c5, 0xc6 => 0xf0c6, 0xc7 => 0xf0c7,
38 | 0xc8 => 0xf0c8, 0xc9 => 0xf0c9, 0xca => 0xf0ca, 0xcb => 0xf0cb,
39 | 0xcc => 0xf0cc, 0xcd => 0xf0cd, 0xce => 0xf0ce, 0xcf => 0xf0cf,
40 | 0xd0 => 0xf0d0, 0xd1 => 0xf0d1, 0xd2 => 0xf0d2, 0xd3 => 0xf0d3,
41 | 0xd4 => 0xf0d4, 0xd5 => 0xf0d5, 0xd6 => 0xf0d6, 0xd7 => 0xf0d7,
42 | 0xd8 => 0xf0d8, 0xd9 => 0xf0d9, 0xda => 0xf0da, 0xdb => 0xf0db,
43 | 0xdc => 0xf0dc, 0xdd => 0xf0dd, 0xde => 0xf0de, 0xdf => 0xf0df,
44 | 0xe0 => 0xf0e0, 0xe1 => 0xf0e1, 0xe2 => 0xf0e2, 0xe3 => 0xf0e3,
45 | 0xe4 => 0xf0e4, 0xe5 => 0xf0e5, 0xe6 => 0xf0e6, 0xe7 => 0xf0e7,
46 | 0xe8 => 0xf0e8, 0xe9 => 0xf0e9, 0xea => 0xf0ea, 0xeb => 0xf0eb,
47 | 0xec => 0xf0ec, 0xed => 0xf0ed, 0xee => 0xf0ee, 0xef => 0xf0ef,
48 | 0xf0 => 0xf0f0, 0xf1 => 0xf0f1, 0xf2 => 0xf0f2, 0xf3 => 0xf0f3,
49 | 0xf4 => 0xf0f4, 0xf5 => 0xf0f5, 0xf6 => 0xf0f6, 0xf7 => 0xf0f7,
50 | 0xf8 => 0xf0f8, 0xf9 => 0xf0f9, 0xfa => 0xf0fa, 0xfb => 0xf0fb,
51 | 0xfc => 0xf0fc, 0xfd => 0xf0fd, 0xfe => 0xf0fe, 0xff => 0xf0ff,
52 | );
53 |
54 | 1; # end
55 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Nintendo.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Nintendo.pm
3 | #
4 | # Description: Nintendo EXIF maker notes tags
5 | #
6 | # Revisions: 2014/03/25 - P. Harvey Created
7 | #
8 | # References: 1) http://3dbrew.org/wiki/MPO
9 | #------------------------------------------------------------------------------
10 |
11 | package Image::ExifTool::Nintendo;
12 |
13 | use strict;
14 | use vars qw($VERSION);
15 | use Image::ExifTool::Exif;
16 |
17 | $VERSION = '1.00';
18 |
19 | %Image::ExifTool::Nintendo::Main = (
20 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
21 | WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
22 | CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
23 | WRITABLE => 1,
24 | # 0x1000 - undef[28]
25 | # 0x1001 - undef[8]
26 | # 0x1100 - undef[80] (found in MPO files)
27 | 0x1101 => {
28 | Name => 'CameraInfo',
29 | SubDirectory => {
30 | TagTable => 'Image::ExifTool::Nintendo::CameraInfo',
31 | ByteOrder => 'Little-endian',
32 | },
33 | },
34 | );
35 |
36 | # Nintendo MPO info (ref 1)
37 | %Image::ExifTool::Nintendo::CameraInfo = (
38 | GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
39 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
40 | WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
41 | CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
42 | WRITABLE => 1,
43 | PRIORITY => 0,
44 | FORMAT => 'int8u',
45 | FIRST_ENTRY => 0,
46 | 0x00 => { # "3DS1"
47 | Name => 'ModelID',
48 | Format => 'undef[4]',
49 | },
50 | # 0x04 - int32u: 1,2,4,5
51 | 0x08 => {
52 | Name => 'TimeStamp',
53 | Format => 'int32u',
54 | Groups => { 2 => 'Time' },
55 | Shift => 'Time',
56 | # zero time is 2000/01/01 (10957 days after Unix time zero)
57 | ValueConv => 'ConvertUnixTime($val + 10957 * 24 * 3600)',
58 | ValueConvInv => 'GetUnixTime($val) - 10957 * 24 * 3600',
59 | PrintConv => '$self->ConvertDateTime($val)',
60 | PrintConvInv => '$self->InverseDateTime($val)',
61 | },
62 | # 0x10 - int32u: title ID low
63 | # 0x14 - int32u: flags
64 | 0x18 => {
65 | Name => 'InternalSerialNumber',
66 | Groups => { 2 => 'Camera' },
67 | Format => 'undef[4]',
68 | ValueConv => '"0x" . unpack("H*",$val)',
69 | ValueConvInv => '$val=~s/^0x//; pack("H*",$val)',
70 | },
71 | 0x28 => {
72 | Name => 'Parallax',
73 | Format => 'float',
74 | PrintConv => 'sprintf("%.2f", $val)',
75 | PrintConvInv => '$val',
76 | },
77 | 0x30 => {
78 | Name => 'Category',
79 | Format => 'int16u',
80 | PrintHex => 1,
81 | PrintConv => {
82 | 0x0000 => '(none)',
83 | 0x1000 => 'Mii',
84 | 0x2000 => 'Man',
85 | 0x4000 => 'Woman',
86 | },
87 | },
88 | # 0x32 - int16u: filter
89 | );
90 |
91 | 1; # end
92 |
93 | __END__
94 |
95 | =head1 NAME
96 |
97 | Image::ExifTool::Nintendo - Nintendo EXIF maker notes tags
98 |
99 | =head1 SYNOPSIS
100 |
101 | This module is loaded automatically by Image::ExifTool when required.
102 |
103 | =head1 DESCRIPTION
104 |
105 | This module contains definitions required by Image::ExifTool to
106 | interpret Nintendo maker notes EXIF meta information.
107 |
108 | =head1 AUTHOR
109 |
110 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
111 |
112 | This library is free software; you can redistribute it and/or modify it
113 | under the same terms as Perl itself.
114 |
115 | =head1 REFERENCES
116 |
117 | =over 4
118 |
119 | =item L
120 |
121 | =back
122 |
123 | =head1 SEE ALSO
124 |
125 | L,
126 | L
127 |
128 | =cut
129 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/PrintIM.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: PrintIM.pm
3 | #
4 | # Description: Read PrintIM meta information
5 | #
6 | # Revisions: 04/07/2004 - P. Harvey Created
7 | #------------------------------------------------------------------------------
8 |
9 | package Image::ExifTool::PrintIM;
10 |
11 | use strict;
12 | use vars qw($VERSION);
13 | use Image::ExifTool qw(:DataAccess);
14 |
15 | $VERSION = '1.07';
16 |
17 | sub ProcessPrintIM($$$);
18 |
19 | # PrintIM table (proprietary specification by Epson)
20 | %Image::ExifTool::PrintIM::Main = (
21 | PROCESS_PROC => \&ProcessPrintIM,
22 | GROUPS => { 0 => 'PrintIM', 1 => 'PrintIM', 2 => 'Printing' },
23 | PRINT_CONV => 'sprintf("0x%.8x", $val)',
24 | TAG_PREFIX => 'PrintIM',
25 | PrintIMVersion => { # values: 0100, 0250, 0260, 0300
26 | Description => 'PrintIM Version',
27 | PrintConv => undef,
28 | },
29 | # the following names are from http://www.kanzaki.com/ns/exif
30 | # but the decoding is unknown:
31 | # 9 => { Name => 'PIMContrast', Unknown => 1 }, #1
32 | # 10 => { Name => 'PIMBrightness', Unknown => 1 }, #1
33 | # 11 => { Name => 'PIMColorbalance', Unknown => 1 }, #1
34 | # 12 => { Name => 'PIMSaturation', Unknown => 1 }, #1
35 | # 13 => { Name => 'PIMSharpness', Unknown => 1 }, #1
36 | );
37 |
38 |
39 | #------------------------------------------------------------------------------
40 | # Process PrintIM IFD
41 | # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
42 | # Returns: 1 on success
43 | sub ProcessPrintIM($$$)
44 | {
45 | my ($et, $dirInfo, $tagTablePtr) = @_;
46 | my $dataPt = $$dirInfo{DataPt};
47 | my $offset = $$dirInfo{DirStart};
48 | my $size = $$dirInfo{DirLen};
49 | my $verbose = $et->Options('Verbose');
50 |
51 | unless ($size) {
52 | $et->Warn('Empty PrintIM data', 1);
53 | return 0;
54 | }
55 | unless ($size > 15) {
56 | $et->Warn('Bad PrintIM data');
57 | return 0;
58 | }
59 | unless (substr($$dataPt, $offset, 7) eq 'PrintIM') {
60 | $et->Warn('Invalid PrintIM header');
61 | return 0;
62 | }
63 | # check size of PrintIM block
64 | my $num = Get16u($dataPt, $offset + 14);
65 | if ($size < 16 + $num * 6) {
66 | # size is too big, maybe byte ordering is wrong
67 | ToggleByteOrder();
68 | $num = Get16u($dataPt, $offset + 14);
69 | if ($size < 16 + $num * 6) {
70 | $et->Warn('Bad PrintIM size');
71 | return 0;
72 | }
73 | }
74 | $verbose and $et->VerboseDir('PrintIM', $num);
75 | $et->HandleTag($tagTablePtr, 'PrintIMVersion', substr($$dataPt, $offset + 8, 4),
76 | DataPt => $dataPt,
77 | Start => $offset + 8,
78 | Size => 4,
79 | );
80 | my $n;
81 | for ($n=0; $n<$num; ++$n) {
82 | my $pos = $offset + 16 + $n * 6;
83 | my $tag = Get16u($dataPt, $pos);
84 | my $val = Get32u($dataPt, $pos + 2);
85 | $et->HandleTag($tagTablePtr, $tag, $val,
86 | Index => $n,
87 | DataPt => $dataPt,
88 | Start => $pos + 2,
89 | Size => 4,
90 | );
91 | }
92 | return 1;
93 | }
94 |
95 |
96 | 1; # end
97 |
98 | __END__
99 |
100 | =head1 NAME
101 |
102 | Image::ExifTool::PrintIM - Read PrintIM meta information
103 |
104 | =head1 SYNOPSIS
105 |
106 | This module is loaded automatically by Image::ExifTool when required.
107 |
108 | =head1 DESCRIPTION
109 |
110 | This module contains definitions required by Image::ExifTool to interpret
111 | Print Image Matching meta information.
112 |
113 | =head1 AUTHOR
114 |
115 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
116 |
117 | This library is free software; you can redistribute it and/or modify it
118 | under the same terms as Perl itself.
119 |
120 | =head1 SEE ALSO
121 |
122 | L,
123 | L
124 |
125 | =cut
126 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Theora.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Theora.pm
3 | #
4 | # Description: Read Theora video meta information
5 | #
6 | # Revisions: 2011/07/13 - P. Harvey Created
7 | #
8 | # References: 1) http://www.theora.org/doc/Theora.pdf
9 | #------------------------------------------------------------------------------
10 |
11 | package Image::ExifTool::Theora;
12 |
13 | use strict;
14 | use vars qw($VERSION);
15 | use Image::ExifTool qw(:DataAccess :Utils);
16 |
17 | $VERSION = '1.00';
18 |
19 | # Theora header types
20 | %Image::ExifTool::Theora::Main = (
21 | NOTES => q{
22 | Information extracted from Ogg Theora video files. See
23 | L for the Theora specification.
24 | },
25 | 0x80 => {
26 | Name => 'Identification',
27 | SubDirectory => {
28 | TagTable => 'Image::ExifTool::Theora::Identification',
29 | ByteOrder => 'BigEndian',
30 | },
31 | },
32 | 0x81 => {
33 | Name => 'Comments',
34 | SubDirectory => {
35 | TagTable => 'Image::ExifTool::Vorbis::Comments',
36 | },
37 | },
38 | # 0x82 - Setup
39 | );
40 |
41 | # tags extracted from Theora Idenfication header
42 | %Image::ExifTool::Theora::Identification = (
43 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
44 | GROUPS => { 2 => 'Video' },
45 | NOTES => 'Tags extracted from the Theora identification header.',
46 | 0 => {
47 | Name => 'TheoraVersion',
48 | Format => 'int8u[3]',
49 | PrintConv => '$val =~ tr/ /./; $val',
50 | },
51 | 7 => {
52 | Name => 'ImageWidth',
53 | Format => 'int32u',
54 | ValueConv => '$val >> 8',
55 | },
56 | 10 => {
57 | Name => 'ImageHeight',
58 | Format => 'int32u',
59 | ValueConv => '$val >> 8',
60 | },
61 | 13 => 'XOffset',
62 | 14 => 'YOffset',
63 | 15 => {
64 | Name => 'FrameRate',
65 | Format => 'rational64u',
66 | PrintConv => 'int($val * 1000 + 0.5) / 1000',
67 | },
68 | 23 => {
69 | Name => 'PixelAspectRatio',
70 | Format => 'int16u[3]',
71 | ValueConv => 'my @a=split(" ",$val); (($a[0]<<8)+($a[1]>>8)) / ((($a[1]&0xff)<<8)+$a[2])',
72 | PrintConv => 'int($val * 1000 + 0.5) / 1000',
73 | },
74 | 29 => {
75 | Name => 'ColorSpace',
76 | PrintConv => {
77 | 0 => 'Undefined',
78 | 1 => 'Rec. 470M',
79 | 2 => 'Rec. 470BG',
80 | },
81 | },
82 | 30 => {
83 | Name => 'NominalVideoBitrate',
84 | Format => 'int32u',
85 | ValueConv => '$val >> 8',
86 | PrintConv => {
87 | 0 => 'Unspecified',
88 | OTHER => \&Image::ExifTool::ConvertBitrate,
89 | },
90 | },
91 | 33 => {
92 | Name => 'Quality',
93 | ValueConv => '$val >> 2',
94 | },
95 | 34 => {
96 | Name => 'PixelFormat',
97 | ValueConv => '($val >> 3) & 0x3',
98 | PrintConv => {
99 | 0 => '4:2:0',
100 | 2 => '4:2:2',
101 | 3 => '4:4:4',
102 | },
103 | },
104 | );
105 |
106 | 1; # end
107 |
108 | __END__
109 |
110 | =head1 NAME
111 |
112 | Image::ExifTool::Theora - Read Theora video meta information
113 |
114 | =head1 SYNOPSIS
115 |
116 | This module is used by Image::ExifTool
117 |
118 | =head1 DESCRIPTION
119 |
120 | This module contains definitions required by Image::ExifTool to extract meta
121 | information from Theora video streams.
122 |
123 | =head1 AUTHOR
124 |
125 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
126 |
127 | This library is free software; you can redistribute it and/or modify it
128 | under the same terms as Perl itself.
129 |
130 | =head1 REFERENCES
131 |
132 | =over 4
133 |
134 | =item L
135 |
136 | =back
137 |
138 | =head1 SEE ALSO
139 |
140 | L,
141 | L,
142 | L
143 |
144 | =cut
145 |
146 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/JVC.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: JVC.pm
3 | #
4 | # Description: JVC EXIF maker notes tags
5 | #
6 | # Revisions: 12/21/2005 - P. Harvey Created
7 | #------------------------------------------------------------------------------
8 |
9 | package Image::ExifTool::JVC;
10 |
11 | use strict;
12 | use vars qw($VERSION);
13 | use Image::ExifTool qw(:DataAccess :Utils);
14 | use Image::ExifTool::Exif;
15 |
16 | $VERSION = '1.03';
17 |
18 | sub ProcessJVCText($$$);
19 |
20 | # JVC EXIF-based maker notes
21 | %Image::ExifTool::JVC::Main = (
22 | WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
23 | CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
24 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
25 | NOTES => 'JVC EXIF maker note tags.',
26 | #0x0001 - almost always '2', but '3' for GR-DV700 samples
27 | 0x0002 => { #PH
28 | Name => 'CPUVersions',
29 | # remove trailing nulls/spaces and split at remaining nulls/spaces
30 | ValueConv => '$_=$val; s/(\s*\0)+$//; s/(\s*\0)+/, /g; $_',
31 | },
32 | 0x0003 => { #PH
33 | Name => 'Quality',
34 | PrintConv => {
35 | 0 => 'Low',
36 | 1 => 'Normal',
37 | 2 => 'Fine',
38 | },
39 | },
40 | );
41 |
42 | # JVC text-based maker notes
43 | %Image::ExifTool::JVC::Text = (
44 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
45 | PROCESS_PROC => \&ProcessJVCText,
46 | NOTES => 'JVC/Victor text-based maker note tags.',
47 | VER => 'MakerNoteVersion', #PH
48 | QTY => { #PH
49 | Name => 'Quality',
50 | PrintConv => {
51 | STND => 'Normal',
52 | STD => 'Normal',
53 | FINE => 'Fine',
54 | },
55 | },
56 | );
57 |
58 | #------------------------------------------------------------------------------
59 | # Process JVC text-based maker notes
60 | # Inputs: 0) ExifTool object reference
61 | # 1) Reference to directory information hash
62 | # 2) Pointer to tag table for this directory
63 | # Returns: 1 on success, otherwise returns 0 and sets a Warning
64 | sub ProcessJVCText($$$)
65 | {
66 | my ($et, $dirInfo, $tagTablePtr) = @_;
67 | my $dataPt = $$dirInfo{DataPt};
68 | my $dirStart = $$dirInfo{DirStart} || 0;
69 | my $dataLen = $$dirInfo{DataLen};
70 | my $dirLen = $$dirInfo{DirLen} || $dataLen - $dirStart;
71 | my $verbose = $et->Options('Verbose');
72 |
73 | my $data = substr($$dataPt, $dirStart, $dirLen);
74 | # validate text maker notes
75 | unless ($data =~ /^VER:/) {
76 | $et->Warn('Bad JVC text maker notes');
77 | return 0;
78 | }
79 | while ($data =~ m/([A-Z]+):(.{3,4})/sg) {
80 | my ($tag, $val) = ($1, $2);
81 | my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag);
82 | $et->VerboseInfo($tag, $tagInfo,
83 | Table => $tagTablePtr,
84 | Value => $val,
85 | ) if $verbose;
86 | unless ($tagInfo) {
87 | next unless $$et{OPTIONS}{Unknown};
88 | $tagInfo = {
89 | Name => "JVC_Text_$tag",
90 | Unknown => 1,
91 | PrintConv => 'length($val) > 60 ? substr($val,0,55) . "[...]" : $val',
92 | };
93 | # add tag information to table
94 | AddTagToTable($tagTablePtr, $tag, $tagInfo);
95 | }
96 | $et->FoundTag($tagInfo, $val);
97 | }
98 | return 1;
99 | }
100 |
101 | 1; # end
102 |
103 | __END__
104 |
105 | =head1 NAME
106 |
107 | Image::ExifTool::JVC - JVC EXIF maker notes tags
108 |
109 | =head1 SYNOPSIS
110 |
111 | This module is loaded automatically by Image::ExifTool when required.
112 |
113 | =head1 DESCRIPTION
114 |
115 | This module contains routines used by Image::ExifTool to interpret JVC maker
116 | notes.
117 |
118 | =head1 AUTHOR
119 |
120 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
121 |
122 | This library is free software; you can redistribute it and/or modify it
123 | under the same terms as Perl itself.
124 |
125 | =head1 SEE ALSO
126 |
127 | L,
128 | L
129 |
130 | =cut
131 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Scalado.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Scalado.pm
3 | #
4 | # Description: Read APP4 SCALADO metadata
5 | #
6 | # Revisions: 2013-09-13 - P. Harvey Created
7 | #------------------------------------------------------------------------------
8 |
9 | package Image::ExifTool::Scalado;
10 |
11 | use strict;
12 | use vars qw($VERSION);
13 | use Image::ExifTool qw(:DataAccess :Utils);
14 | use Image::ExifTool::PLIST;
15 |
16 | $VERSION = '1.01';
17 |
18 | sub ProcessScalado($$$);
19 |
20 | # JPEG APP4 SCALADO tags
21 | %Image::ExifTool::Scalado::Main = (
22 | GROUPS => { 0 => 'APP4', 1 => 'Scalado', 2 => 'Image' },
23 | PROCESS_PROC => \&ProcessScalado,
24 | TAG_PREFIX => 'Scalado',
25 | FORMAT => 'int32s',
26 | NOTES => q{
27 | Tags extracted from the JPEG APP4 "SCALADO" segment found in images from
28 | HTC, LG and Samsung phones. (Presumably written by Scalado mobile software,
29 | L.)
30 | },
31 | SPMO => {
32 | Name => 'DataLength',
33 | Unknown => 1,
34 | },
35 | WDTH => {
36 | Name => 'PreviewImageWidth',
37 | ValueConv => '$val ? abs($val) : undef',
38 | },
39 | HGHT => {
40 | Name => 'PreviewImageHeight',
41 | ValueConv => '$val ? abs($val) : undef',
42 | },
43 | QUAL => {
44 | Name => 'PreviewQuality',
45 | ValueConv => '$val ? abs($val) : undef',
46 | },
47 | # tags not yet decoded with observed values:
48 | # CHKH: 0, various negative values
49 | # CHKL: various negative values
50 | # CLEN: -1024
51 | # CSPC: -2232593
52 | # DATA: (+ve data length)
53 | # HDEC: 0
54 | # MAIN: 0, 60
55 | # META: 24
56 | # SCI0: (+ve data length) often 36
57 | # SCI1: (+ve data length) 36
58 | # SCX0: (+ve data length)
59 | # SCX1: (+ve data length) often 84
60 | # WDEC: 0
61 | # VERS: -131328
62 | );
63 |
64 | #------------------------------------------------------------------------------
65 | # Extract information from the JPEG APP4 SCALADO segment
66 | # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
67 | # Returns: 1 on success
68 | sub ProcessScalado($$$)
69 | {
70 | my ($et, $dirInfo, $tagTablePtr) = @_;
71 | my $dataPt = $$dirInfo{DataPt};
72 | my $pos = 0;
73 | my $end = length $$dataPt;
74 | my $unknown = $et->Options('Unknown');
75 |
76 | $et->VerboseDir('APP4 SCALADO', undef, $end);
77 | SetByteOrder('MM');
78 |
79 | for (;;) {
80 | last if $pos + 12 > $end;
81 | my $tag = substr($$dataPt, $pos, 4);
82 | my $ver = Get32u($dataPt, $pos + 4); # (looks like a version for some tags)
83 | if (not $$tagTablePtr{$tag} and $unknown) {
84 | my $name = $tag;
85 | $name =~ tr/-A-Za-z0-9_//dc;
86 | last unless length $name; # stop if tag is garbage
87 | AddTagToTable($tagTablePtr, $tag, {
88 | Name => "Scalado_$name",
89 | Description => "Scalado $name",
90 | Unknown => 1,
91 | });
92 | }
93 | $et->HandleTag($tagTablePtr, $tag, undef,
94 | DataPt => $dataPt,
95 | Start => $pos + 8,
96 | Size => 4,
97 | Extra => ", ver $ver",
98 | );
99 | if ($tag eq 'SPMO') {
100 | my $val = Get32u($dataPt, $pos + 8) ;
101 | if ($ver < 5) { # (I don't have samples for version 3 or 4, so I'm not sure about these)
102 | $end -= $val; # SPMO gives trailer data length
103 | } else {
104 | $end = $val + 12; # SPMO gives length of Scalado directory (excepting this entry)
105 | }
106 | }
107 | $pos += 12;
108 | }
109 | return 1;
110 | }
111 |
112 | 1; # end
113 |
114 | __END__
115 |
116 | =head1 NAME
117 |
118 | Image::ExifTool::Scalado - Read APP4 SCALADO metadata
119 |
120 | =head1 SYNOPSIS
121 |
122 | This module is loaded automatically by Image::ExifTool when required.
123 |
124 | =head1 DESCRIPTION
125 |
126 | This module contains definitions required by Image::ExifTool to read
127 | metadata from the JPEG APP4 SCALADO segment.
128 |
129 | =head1 AUTHOR
130 |
131 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
132 |
133 | This library is free software; you can redistribute it and/or modify it
134 | under the same terms as Perl itself.
135 |
136 | =head1 SEE ALSO
137 |
138 | L,
139 | L
140 |
141 | =cut
142 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/PGF.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: PGF.pm
3 | #
4 | # Description: Read Progressive Graphics File meta information
5 | #
6 | # Revisions: 2011/01/25 - P. Harvey Created
7 | #
8 | # References: 1) http://www.libpgf.org/
9 | # 2) http://www.exiv2.org/
10 | #------------------------------------------------------------------------------
11 |
12 | package Image::ExifTool::PGF;
13 |
14 | use strict;
15 | use vars qw($VERSION);
16 | use Image::ExifTool qw(:DataAccess :Utils);
17 |
18 | $VERSION = '1.02';
19 |
20 | # PGF header information
21 | %Image::ExifTool::PGF::Main = (
22 | GROUPS => { 0 => 'File', 1 => 'File', 2 => 'Image' },
23 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
24 | PRIORITY => 2, # (to take precedence over PNG tags from embedded image)
25 | NOTES => q{
26 | The following table lists information extracted from the header of
27 | Progressive Graphics File (PGF) images. As well, information is extracted
28 | from the embedded PNG metadata image if it exists. See
29 | L for the PGF specification.
30 | },
31 | 3 => {
32 | Name => 'PGFVersion',
33 | PrintConv => 'sprintf("0x%.2x", $val)',
34 | # this is actually a bitmask (ref digikam PGFtypes.h):
35 | # 0x02 - data structure PGFHeader of major version 2
36 | # 0x04 - 32-bit values
37 | # 0x08 - supports regions of interest
38 | # 0x10 - new coding scheme since major version 5
39 | # 0x20 - new HeaderSize: 32 bits instead of 16 bits
40 | },
41 | 8 => { Name => 'ImageWidth', Format => 'int32u' },
42 | 12 => { Name => 'ImageHeight', Format => 'int32u' },
43 | 16 => 'PyramidLevels',
44 | 17 => 'Quality',
45 | 18 => 'BitsPerPixel',
46 | 19 => 'ColorComponents',
47 | 20 => {
48 | Name => 'ColorMode',
49 | RawConv => '$$self{PGFColorMode} = $val',
50 | PrintConvColumns => 2,
51 | PrintConv => {
52 | 0 => 'Bitmap',
53 | 1 => 'Grayscale',
54 | 2 => 'Indexed',
55 | 3 => 'RGB',
56 | 4 => 'CMYK',
57 | 7 => 'Multichannel',
58 | 8 => 'Duotone',
59 | 9 => 'Lab',
60 | },
61 | },
62 | 21 => { Name => 'BackgroundColor', Format => 'int8u[3]' },
63 | );
64 |
65 | #------------------------------------------------------------------------------
66 | # Extract information from a PGF image
67 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference
68 | # Returns: 1 on success, 0 if this wasn't a valid PGF file
69 | sub ProcessPGF($$)
70 | {
71 | my ($et, $dirInfo) = @_;
72 | my $raf = $$dirInfo{RAF};
73 | my $buff;
74 |
75 | # read header and check magic number
76 | return 0 unless $raf->Read($buff, 24) == 24 and $buff =~ /^PGF(.)/s;
77 | my $ver = ord $1;
78 | $et->SetFileType();
79 | SetByteOrder('II');
80 |
81 | # currently support only version 0x36
82 | unless ($ver == 0x36) {
83 | $et->Error(sprintf('Unsupported PGF version 0x%.2x', $ver));
84 | return 1;
85 | }
86 | # extract information from the PGF header
87 | my $tagTablePtr = GetTagTable('Image::ExifTool::PGF::Main');
88 | $et->ProcessDirectory({ DataPt => \$buff, DataPos => 0 }, $tagTablePtr);
89 |
90 | my $len = Get32u(\$buff, 4) - 16; # length of post-header data
91 |
92 | # skip colour table if necessary
93 | $len -= $raf->Seek(1024, 1) ? 1024 : $len if $$et{PGFColorMode} == 2;
94 |
95 | # extract information from the embedded metadata image (PNG format)
96 | if ($len > 0 and $len < 0x1000000 and $raf->Read($buff, $len) == $len) {
97 | $et->ExtractInfo(\$buff, { ReEntry => 1 });
98 | }
99 | return 1;
100 | }
101 |
102 |
103 | 1; # end
104 |
105 | __END__
106 |
107 | =head1 NAME
108 |
109 | Image::ExifTool::PGF - Read Progressive Graphics File meta information
110 |
111 | =head1 SYNOPSIS
112 |
113 | This module is used by Image::ExifTool
114 |
115 | =head1 DESCRIPTION
116 |
117 | This module contains definitions required by Image::ExifTool to extract meta
118 | information from Progressive Graphics File (PGF) images.
119 |
120 | =head1 AUTHOR
121 |
122 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
123 |
124 | This library is free software; you can redistribute it and/or modify it
125 | under the same terms as Perl itself.
126 |
127 | =head1 REFERENCES
128 |
129 | =over 4
130 |
131 | =item L
132 |
133 | =item L
134 |
135 | =back
136 |
137 | =head1 SEE ALSO
138 |
139 | L,
140 | L
141 |
142 | =cut
143 |
144 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/MPC.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: MPC.pm
3 | #
4 | # Description: Read Musepack audio meta information
5 | #
6 | # Revisions: 11/14/2006 - P. Harvey Created
7 | #
8 | # References: 1) http://www.musepack.net/
9 | #------------------------------------------------------------------------------
10 |
11 | package Image::ExifTool::MPC;
12 |
13 | use strict;
14 | use vars qw($VERSION);
15 | use Image::ExifTool qw(:DataAccess :Utils);
16 | use Image::ExifTool::FLAC;
17 |
18 | $VERSION = '1.01';
19 |
20 | # MPC metadata blocks
21 | %Image::ExifTool::MPC::Main = (
22 | PROCESS_PROC => \&Image::ExifTool::FLAC::ProcessBitStream,
23 | GROUPS => { 2 => 'Audio' },
24 | NOTES => q{
25 | Tags used in Musepack (MPC) audio files. ExifTool also extracts ID3 and APE
26 | information from these files.
27 | },
28 | 'Bit032-063' => 'TotalFrames',
29 | 'Bit080-081' => {
30 | Name => 'SampleRate',
31 | PrintConv => {
32 | 0 => 44100,
33 | 1 => 48000,
34 | 2 => 37800,
35 | 3 => 32000,
36 | },
37 | },
38 | 'Bit084-087' => {
39 | Name => 'Quality',
40 | PrintConv => {
41 | 1 => 'Unstable/Experimental',
42 | 5 => '0',
43 | 6 => '1',
44 | 7 => '2 (Telephone)',
45 | 8 => '3 (Thumb)',
46 | 9 => '4 (Radio)',
47 | 10 => '5 (Standard)',
48 | 11 => '6 (Xtreme)',
49 | 12 => '7 (Insane)',
50 | 13 => '8 (BrainDead)',
51 | 14 => '9',
52 | 15 => '10',
53 | },
54 | },
55 | 'Bit088-093' => 'MaxBand',
56 | 'Bit096-111' => 'ReplayGainTrackPeak',
57 | 'Bit112-127' => 'ReplayGainTrackGain',
58 | 'Bit128-143' => 'ReplayGainAlbumPeak',
59 | 'Bit144-159' => 'ReplayGainAlbumGain',
60 | 'Bit179' => {
61 | Name => 'FastSeek',
62 | PrintConv => { 0 => 'No', 1 => 'Yes' },
63 | },
64 | 'Bit191' => {
65 | Name => 'Gapless',
66 | PrintConv => { 0 => 'No', 1 => 'Yes' },
67 | },
68 | 'Bit216-223' => {
69 | Name => 'EncoderVersion',
70 | PrintConv => '$val =~ s/(\d)(\d)(\d)$/$1.$2.$3/; $val',
71 | },
72 | );
73 |
74 | #------------------------------------------------------------------------------
75 | # Extract information from an MPC file
76 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference
77 | # - Just looks for MPC trailer if FileType is already set
78 | # Returns: 1 on success, 0 if this wasn't a valid MPC file
79 | sub ProcessMPC($$)
80 | {
81 | my ($et, $dirInfo) = @_;
82 |
83 | # must first check for leading ID3 information
84 | unless ($$et{DoneID3}) {
85 | require Image::ExifTool::ID3;
86 | Image::ExifTool::ID3::ProcessID3($et, $dirInfo) and return 1;
87 | }
88 | my $raf = $$dirInfo{RAF};
89 | my $buff;
90 |
91 | # check MPC signature
92 | $raf->Read($buff, 32) == 32 and $buff =~ /^MP\+(.)/s or return 0;
93 | my $vers = ord($1) & 0x0f;
94 | $et->SetFileType();
95 |
96 | # extract audio information (currently only from version 7 MPC files)
97 | if ($vers == 0x07) {
98 | SetByteOrder('II');
99 | my $pos = $raf->Tell() - 32;
100 | if ($et->Options('Verbose')) {
101 | $et->VPrint(0, "MPC Header (32 bytes):\n");
102 | $et->VerboseDump(\$buff, DataPos => $pos);
103 | }
104 | my $tagTablePtr = GetTagTable('Image::ExifTool::MPC::Main');
105 | my %dirInfo = ( DataPt => \$buff, DataPos => $pos );
106 | $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
107 | } else {
108 | $et->Warn('Audio info currently not extracted from this version MPC file');
109 | }
110 |
111 | # process APE trailer if it exists
112 | require Image::ExifTool::APE;
113 | Image::ExifTool::APE::ProcessAPE($et, $dirInfo);
114 |
115 | return 1;
116 | }
117 |
118 | 1; # end
119 |
120 | __END__
121 |
122 | =head1 NAME
123 |
124 | Image::ExifTool::MPC - Read Musepack audio meta information
125 |
126 | =head1 SYNOPSIS
127 |
128 | This module is used by Image::ExifTool
129 |
130 | =head1 DESCRIPTION
131 |
132 | This module contains definitions required by Image::ExifTool to extract meta
133 | information from Musepack (MPC) audio files.
134 |
135 | =head1 AUTHOR
136 |
137 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
138 |
139 | This library is free software; you can redistribute it and/or modify it
140 | under the same terms as Perl itself.
141 |
142 | =head1 REFERENCES
143 |
144 | =over 4
145 |
146 | =item L
147 |
148 | =back
149 |
150 | =head1 SEE ALSO
151 |
152 | L,
153 | L
154 |
155 | =cut
156 |
157 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Radiance.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Radiance.pm
3 | #
4 | # Description: Read Radiance RGBE HDR meta information
5 | #
6 | # Revisions: 2011/12/10 - P. Harvey Created
7 | #
8 | # References: 1) http://www.graphics.cornell.edu/online/formats/rgbe/
9 | # 2) http://radsite.lbl.gov/radiance/refer/filefmts.pdf
10 | #------------------------------------------------------------------------------
11 |
12 | package Image::ExifTool::Radiance;
13 |
14 | use strict;
15 | use vars qw($VERSION);
16 | use Image::ExifTool qw(:DataAccess :Utils);
17 |
18 | $VERSION = '1.01';
19 |
20 | # Radiance tags
21 | %Image::ExifTool::Radiance::Main = (
22 | GROUPS => { 2 => 'Image' },
23 | NOTES => q{
24 | Information extracted from Radiance RGBE HDR images. Tag ID's are all
25 | uppercase as stored in the file, but converted to lowercase by when
26 | extracting to avoid conflicts with internal ExifTool variables. See
27 | L and
28 | L for the
29 | specification.
30 | },
31 | _orient => {
32 | Name => 'Orientation',
33 | PrintConv => {
34 | '-Y +X' => 'Horizontal (normal)',
35 | '-Y -X' => 'Mirror horizontal',
36 | '+Y -X' => 'Rotate 180',
37 | '+Y +X' => 'Mirror vertical',
38 | '+X -Y' => 'Mirror horizontal and rotate 270 CW',
39 | '+X +Y' => 'Rotate 90 CW',
40 | '-X +Y' => 'Mirror horizontal and rotate 90 CW',
41 | '-X -Y' => 'Rotate 270 CW',
42 | },
43 | },
44 | _command => 'Command',
45 | software => 'Software',
46 | view => 'View',
47 | 'format' => 'Format', # <-- this is the one that caused the conflict when uppercase
48 | exposure => {
49 | Name => 'Exposure',
50 | Notes => 'divide pixel values by this to get watts/steradian/meter^2',
51 | },
52 | gamma => 'Gamma',
53 | colorcorr => 'ColorCorrection',
54 | pixaspect => 'PixelAspectRatio',
55 | primaries => 'ColorPrimaries',
56 | );
57 |
58 | #------------------------------------------------------------------------------
59 | # Extract information from a Radiance HDR file
60 | # Inputs: 0) ExifTool object reference, 1) DirInfo reference
61 | # Returns: 1 on success, 0 if this wasn't a valid RGBE image
62 | sub ProcessHDR($$)
63 | {
64 | my ($et, $dirInfo) = @_;
65 | my $raf = $$dirInfo{RAF};
66 | my $buff;
67 | local $/ = "\x0a"; # set newline character for reading
68 |
69 | # verify this is a valid RIFF file
70 | return 0 unless $raf->ReadLine($buff) and $buff =~ /^#\?(RADIANCE|RGBE)\x0a/s;
71 | $et->SetFileType();
72 | my $tagTablePtr = GetTagTable('Image::ExifTool::Radiance::Main');
73 |
74 | while ($raf->ReadLine($buff)) {
75 | chomp $buff;
76 | last unless length($buff) > 0 and length($buff) < 4096;
77 | unless ($buff =~ /^(.*)?\s*=\s*(.*)/) {
78 | $et->HandleTag($tagTablePtr, '_command', $buff);
79 | next;
80 | }
81 | # use lower-case tag names to avoid conflicts with reserved tag table entries
82 | my ($tag, $val) = (lc $1, $2);
83 | my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag);
84 | unless ($tagInfo) {
85 | my $name = $tag;
86 | $name =~ tr/-_a-zA-Z0-9//dc;
87 | next unless length($name) > 1;
88 | $name = ucfirst $name;
89 | $tagInfo = { Name => $name };
90 | AddTagToTable($tagTablePtr, $tag, $tagInfo);
91 | }
92 | $et->FoundTag($tagInfo, $val);
93 | }
94 | # get image dimensions
95 | if ($raf->ReadLine($buff) and $buff =~ /([-+][XY])\s*(\d+)\s*([-+][XY])\s*(\d+)/) {
96 | $et->HandleTag($tagTablePtr, '_orient', "$1 $3");
97 | $et->FoundTag('ImageHeight', $2);
98 | $et->FoundTag('ImageWidth', $4);
99 | }
100 | return 1;
101 | }
102 |
103 | 1; # end
104 |
105 | __END__
106 |
107 | =head1 NAME
108 |
109 | Image::ExifTool::Radiance - Read Radiance RGBE HDR meta information
110 |
111 | =head1 SYNOPSIS
112 |
113 | This module is used by Image::ExifTool
114 |
115 | =head1 DESCRIPTION
116 |
117 | This module contains definitions required by Image::ExifTool to extract meta
118 | information from Radiance RGBE images. RGBE (Red Green Blue Exponent)
119 | images are a type of high dynamic-range image.
120 |
121 | =head1 AUTHOR
122 |
123 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
124 |
125 | This library is free software; you can redistribute it and/or modify it
126 | under the same terms as Perl itself.
127 |
128 | =head1 REFERENCES
129 |
130 | =over 4
131 |
132 | =item L
133 |
134 | =item L
135 |
136 | =back
137 |
138 | =head1 SEE ALSO
139 |
140 | L,
141 | L
142 |
143 | =cut
144 |
145 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/KyoceraRaw.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: KyoceraRaw.pm
3 | #
4 | # Description: Read Kyocera RAW meta information
5 | #
6 | # Revisions: 02/17/2006 - P. Harvey Created
7 | #
8 | # References: 1) http://www.cybercom.net/~dcoffin/dcraw/
9 | #------------------------------------------------------------------------------
10 |
11 | package Image::ExifTool::KyoceraRaw;
12 |
13 | use strict;
14 | use vars qw($VERSION);
15 | use Image::ExifTool qw(:DataAccess :Utils);
16 |
17 | $VERSION = '1.03';
18 |
19 | sub ProcessRAW($$);
20 |
21 | # utility to reverse order of characters in a string
22 | sub ReverseString($) { pack('C*',reverse unpack('C*',shift)) }
23 |
24 | # Contax N Digital tags (ref PH)
25 | %Image::ExifTool::KyoceraRaw::Main = (
26 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
27 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
28 | NOTES => 'Tags for Kyocera Contax N Digital RAW images.',
29 | 0x01 => {
30 | Name => 'FirmwareVersion',
31 | Format => 'string[10]',
32 | ValueConv => \&ReverseString,
33 | },
34 | 0x0c => {
35 | Name => 'Model',
36 | Format => 'string[12]',
37 | ValueConv => \&ReverseString,
38 | },
39 | 0x19 => { #1
40 | Name => 'Make',
41 | Format => 'string[7]',
42 | ValueConv => \&ReverseString,
43 | },
44 | 0x21 => { #1
45 | Name => 'DateTimeOriginal',
46 | Description => 'Date/Time Original',
47 | Groups => { 2 => 'Time' },
48 | Format => 'string[20]',
49 | ValueConv => \&ReverseString,
50 | PrintConv => '$self->ConvertDateTime($val)',
51 | },
52 | 0x34 => {
53 | Name => 'ISO',
54 | Groups => { 2 => 'Image' },
55 | Format => 'int32u',
56 | PrintConv => {
57 | 7 => 25,
58 | 8 => 32,
59 | 9 => 40,
60 | 10 => 50,
61 | 11 => 64,
62 | 12 => 80,
63 | 13 => 100,
64 | 14 => 125,
65 | 15 => 160,
66 | 16 => 200,
67 | 17 => 250,
68 | 18 => 320,
69 | 19 => 400,
70 | },
71 | },
72 | 0x38 => {
73 | Name => 'ExposureTime',
74 | Groups => { 2 => 'Image' },
75 | Format => 'int32u',
76 | ValueConv => '2**($val / 8) / 16000',
77 | PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
78 | },
79 | 0x3c => { #1
80 | Name => 'WB_RGGBLevels',
81 | Groups => { 2 => 'Image' },
82 | Format => 'int32u[4]',
83 | },
84 | 0x58 => {
85 | Name => 'FNumber',
86 | Groups => { 2 => 'Image' },
87 | Format => 'int32u',
88 | ValueConv => '2**($val/16)',
89 | PrintConv => 'sprintf("%.2g",$val)',
90 | },
91 | 0x68 => {
92 | Name => 'MaxAperture',
93 | Format => 'int32u',
94 | ValueConv => '2**($val/16)',
95 | PrintConv => 'sprintf("%.2g",$val)',
96 | },
97 | 0x70 => {
98 | Name => 'FocalLength',
99 | Format => 'int32u',
100 | PrintConv => '"$val mm"',
101 | },
102 | 0x7c => {
103 | Name => 'Lens',
104 | Format => 'string[32]',
105 | },
106 | );
107 |
108 | #------------------------------------------------------------------------------
109 | # Extract information from Kyocera RAW image
110 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference
111 | # Returns: 1 if this was a valid Kyocera RAW image
112 | sub ProcessRAW($$)
113 | {
114 | my ($et, $dirInfo) = @_;
115 | my $raf = $$dirInfo{RAF};
116 | my $size = 156; # size of header
117 | my $buff;
118 |
119 | $raf->Read($buff, $size) == $size or return 0;
120 | # validate Make string ('KYOCERA' reversed)
121 | substr($buff, 0x19, 7) eq 'ARECOYK' or return 0;
122 | $et->SetFileType();
123 | SetByteOrder('MM');
124 | my %dirInfo = (
125 | DataPt => \$buff,
126 | DataPos => 0,
127 | DataLen => $size,
128 | DirStart => 0,
129 | DirLen => $size,
130 | );
131 | my $tagTablePtr = GetTagTable('Image::ExifTool::KyoceraRaw::Main');
132 | $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
133 | return 1;
134 | }
135 |
136 | 1; # end
137 |
138 | __END__
139 |
140 | =head1 NAME
141 |
142 | Image::ExifTool::KyoceraRaw - Read Kyocera RAW meta information
143 |
144 | =head1 SYNOPSIS
145 |
146 | This module is loaded automatically by Image::ExifTool when required.
147 |
148 | =head1 DESCRIPTION
149 |
150 | This module contains definitions required by Image::ExifTool to read
151 | meta information from Kyocera Contax N Digital RAW images.
152 |
153 | =head1 AUTHOR
154 |
155 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
156 |
157 | This library is free software; you can redistribute it and/or modify it
158 | under the same terms as Perl itself.
159 |
160 | =head1 REFERENCES
161 |
162 | =over 4
163 |
164 | =item L
165 |
166 | =back
167 |
168 | =head1 SEE ALSO
169 |
170 | L,
171 | L
172 |
173 | =cut
174 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/File/RandomAccess.pod:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: RandomAccess.pod -- Documentation for File::RandomAccess
3 | #
4 | # Description: Buffer to support random access reading of sequential file
5 | #
6 | # Legal: Copyright (c) 2003-2018 Phil Harvey (phil at owl.phy.queensu.ca)
7 | # This library is free software; you can redistribute it and/or
8 | # modify it under the same terms as Perl itself.
9 | #------------------------------------------------------------------------------
10 |
11 | =head1 NAME
12 |
13 | File::RandomAccess - Random access reads of sequential file or scalar
14 |
15 | =head1 SYNOPSIS
16 |
17 | use File::RandomAccess;
18 |
19 | $raf = new File::RandomAccess(\*FILE, $disableSeekTest);
20 |
21 | $raf = new File::RandomAccess(\$data);
22 |
23 | $err = $raf->Seek($pos);
24 | $num = $raf->Read($buff, $bytes);
25 |
26 | =head1 DESCRIPTION
27 |
28 | Allows random access to sequential file by buffering the file if necessary.
29 | Also allows access to data in memory to be accessed as if it were a file.
30 |
31 | =head1 METHODS
32 |
33 | =over 4
34 |
35 | =item B
36 |
37 | Creates a new RandomAccess object given a file reference or
38 | reference to data in memory.
39 |
40 | # Read from open file or pipe
41 | $raf = new File::RandomAccess(\*FILE);
42 |
43 | # Read from data in memory
44 | $raf = new File::RandomAccess(\$data);
45 |
46 | =over 4
47 |
48 | =item Inputs:
49 |
50 | 0) Reference to RandomAccess object or RandomAccess class name.
51 |
52 | 1) File reference or scalar reference.
53 |
54 | 2) Flag set if file is already random access (disables automatic SeekTest).
55 |
56 | =item Returns:
57 |
58 | Reference to RandomAccess object.
59 |
60 | =back
61 |
62 | =item B
63 |
64 | Performs test seek() on file to determine if buffering is necessary. If
65 | the seek() fails, then the file is buffered to allow random access.
66 | B() is automatically called from B unless specified.
67 |
68 | $result = $raf->SeekTest();
69 |
70 | =over 4
71 |
72 | =item Inputs:
73 |
74 | 0) Reference to RandomAccess object.
75 |
76 | =item Returns:
77 |
78 | 1 if seek test passed (ie. no buffering required).
79 |
80 | =item Notes:
81 |
82 | Must be called before any other i/o.
83 |
84 | =back
85 |
86 | =item B
87 |
88 | Get current position in file
89 |
90 | $pos = $raf->Tell();
91 |
92 | =over 4
93 |
94 | =item Inputs:
95 |
96 | 0) Reference to RandomAccess object.
97 |
98 | =item Returns:
99 |
100 | Current position in file
101 |
102 | =back
103 |
104 | =item B
105 |
106 | Seek to specified position in file. When buffered, this doesn't quite
107 | behave like seek() since it returns success even if you seek outside the
108 | limits of the file.
109 |
110 | $success = $raf->Seek($pos, 0);
111 |
112 | =over 4
113 |
114 | =item Inputs:
115 |
116 | 0) Reference to RandomAccess object.
117 |
118 | 1) Position.
119 |
120 | 2) Whence (0=from start, 1=from cur pos, 2=from end).
121 |
122 | =item Returns:
123 |
124 | 1 on success, 0 otherwise
125 |
126 | =back
127 |
128 | =item B
129 |
130 | Read data from the file.
131 |
132 | $num = $raf->Read($buff, 1024);
133 |
134 | =over 4
135 |
136 | =item Inputs:
137 |
138 | 0) Reference to RandomAccess object.
139 |
140 | 1) Buffer.
141 |
142 | 2) Number of bytes to read.
143 |
144 | =item Returns:
145 |
146 | Number of bytes actually read.
147 |
148 | =back
149 |
150 | =item B
151 |
152 | Read a line from file (end of line is $/).
153 |
154 | =over 4
155 |
156 | =item Inputs:
157 |
158 | 0) Reference to RandomAccess object.
159 |
160 | 1) Buffer.
161 |
162 | =item Returns:
163 |
164 | Number of bytes read.
165 |
166 | =back
167 |
168 | =item B
169 |
170 | Read whole file into buffer, without changing read pointer.
171 |
172 | =over 4
173 |
174 | =item Inputs:
175 |
176 | 0) Reference to RandomAccess object.
177 |
178 | =item Returns:
179 |
180 | Nothing.
181 |
182 | =back
183 |
184 | =item B
185 |
186 | Set binary mode for file.
187 |
188 | =over 4
189 |
190 | =item Inputs:
191 |
192 | 0) Reference to RandomAccess object.
193 |
194 | =item Returns:
195 |
196 | Nothing.
197 |
198 | =back
199 |
200 | =item B
201 |
202 | Close the file and free the buffer.
203 |
204 | =over 4
205 |
206 | =item Inputs:
207 |
208 | 0) Reference to RandomAccess object.
209 |
210 | =item Returns:
211 |
212 | Nothing.
213 |
214 | =back
215 |
216 | =back
217 |
218 | =head1 OPTIONS
219 |
220 | =over 4
221 |
222 | =item B
223 |
224 | Avoid buffering sequential files.
225 |
226 | $raf->{NoBuffer} = 1;
227 |
228 | When this option is set, old data is purged from the internal buffer before
229 | a read operation on a sequential file. In this mode, memory requirements
230 | may be significantly reduced when reading sequential files, but seeking
231 | backward is limited to within the size of the internal buffer (which will be
232 | at least as large as the last returned data block), and seeking relative to
233 | the end of file is not allowed.
234 |
235 | =back
236 |
237 | =head1 AUTHOR
238 |
239 | Copyright 2003-2018 Phil Harvey (phil at owl.phy.queensu.ca)
240 |
241 | This library is free software; you can redistribute it and/or modify it
242 | under the same terms as Perl itself.
243 |
244 | =head1 SEE ALSO
245 |
246 | L
247 |
248 | =cut
249 |
250 | # end
251 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Stim.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Stim.pm
3 | #
4 | # Description: Definitions for Stereo Still Image tags
5 | #
6 | # Revisions: 06/12/2009 - P. Harvey Created
7 | #
8 | # References: 1) http://www.cipa.jp/std/documents/e/DC-006_E.pdf
9 | #------------------------------------------------------------------------------
10 |
11 | package Image::ExifTool::Stim;
12 |
13 | use strict;
14 | use vars qw($VERSION);
15 |
16 | $VERSION = '1.01';
17 |
18 | # Tags found in APP3 Stim segment in JPEG images
19 | %Image::ExifTool::Stim::Main = (
20 | GROUPS => { 0 => 'Stim', 1 => 'Stim', 2 => 'Image'},
21 | NOTES => q{
22 | These tags are part of the CIPA Stereo Still Image specification, and are
23 | found in the APP3 "Stim" segment of JPEG images. See
24 | L for the
25 | official specification.
26 | },
27 | 0 => 'StimVersion',
28 | 1 => {
29 | Name => 'ApplicationData',
30 | Binary => 1,
31 | },
32 | 2 => {
33 | Name => 'ImageArrangement',
34 | PrintConv => {
35 | 0 => 'Parallel View Alignment',
36 | 1 => 'Cross View Alignment',
37 | },
38 | },
39 | 3 => {
40 | Name => 'ImageRotation',
41 | PrintConv => {
42 | 1 => 'None',
43 | },
44 | },
45 | 4 => 'ScalingFactor',
46 | 5 => 'CropXSize',
47 | 6 => 'CropYSize',
48 | 7 => {
49 | Name => 'CropX',
50 | SubDirectory => {
51 | TagTable => 'Image::ExifTool::Stim::CropX',
52 | },
53 | },
54 | 8 => {
55 | Name => 'CropY',
56 | SubDirectory => {
57 | TagTable => 'Image::ExifTool::Stim::CropY',
58 | },
59 | },
60 | 9 => {
61 | Name => 'ViewType',
62 | PrintConv => {
63 | 0 => 'No Pop-up Effect',
64 | 1 => 'Pop-up Effect',
65 | },
66 | },
67 | 10 => {
68 | Name => 'RepresentativeImage',
69 | PrintConv => {
70 | 0 => 'Left Viewpoint',
71 | 1 => 'Right Viewpoint',
72 | },
73 | },
74 | 11 => {
75 | Name => 'ConvergenceBaseImage',
76 | PrintConv => {
77 | 0 => 'Left Viewpoint',
78 | 1 => 'Right Viewpoint',
79 | 255 => 'Equivalent for Both Viewpoints',
80 | },
81 | },
82 | 12 => {
83 | Name => 'AssumedDisplaySize',
84 | PrintConv => '"$val mm"',
85 | },
86 | 13 => {
87 | Name => 'AssumedDistanceView',
88 | PrintConv => '"$val mm"',
89 | },
90 | 14 => 'RepresentativeDisparityNear',
91 | 15 => 'RepresentativeDisparityFar',
92 | 16 => {
93 | Name => 'InitialDisplayEffect',
94 | PrintConv => {
95 | 0 => 'Off',
96 | 1 => 'On',
97 | },
98 | },
99 | 17 => {
100 | Name => 'ConvergenceDistance',
101 | PrintConv => '$val ? "$val mm" : "inf"',
102 | },
103 | 18 => {
104 | Name => 'CameraArrangementInterval',
105 | PrintConv => '"$val mm"',
106 | },
107 | 19 => 'ShootingCount',
108 | );
109 |
110 | # crop offset X tags
111 | %Image::ExifTool::Stim::CropX = (
112 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
113 | GROUPS => { 0 => 'Stim', 1 => 'Stim', 2 => 'Image'},
114 | 0 => {
115 | Name => 'CropXCommonOffset',
116 | Format => 'int16u',
117 | PrintConv => {
118 | 0 => 'Common Offset Setting',
119 | 1 => 'Individual Offset Setting',
120 | },
121 | },
122 | 2 => 'CropXViewpointNumber',
123 | 3 => {
124 | Name => 'CropXOffset',
125 | Format => 'int32s',
126 | },
127 | 7 => 'CropXViewpointNumber2',
128 | 8 => {
129 | Name => 'CropXOffset2',
130 | Format => 'int32s',
131 | },
132 | );
133 |
134 | # crop offset Y tags
135 | %Image::ExifTool::Stim::CropY = (
136 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
137 | GROUPS => { 0 => 'Stim', 1 => 'Stim', 2 => 'Image'},
138 | 0 => {
139 | Name => 'CropYCommonOffset',
140 | Format => 'int16u',
141 | PrintConv => {
142 | 0 => 'Common Offset Setting',
143 | 1 => 'Individual Offset Setting',
144 | },
145 | },
146 | 2 => 'CropYViewpointNumber',
147 | 3 => {
148 | Name => 'CropYOffset',
149 | Format => 'int32s',
150 | },
151 | 7 => 'CropYViewpointNumber2',
152 | 8 => {
153 | Name => 'CropYOffset2',
154 | Format => 'int32s',
155 | },
156 | );
157 |
158 | 1; # end
159 |
160 | __END__
161 |
162 | =head1 NAME
163 |
164 | Image::ExifTool::Stim - Definitions for Stereo Still Image tags
165 |
166 | =head1 SYNOPSIS
167 |
168 | This module is used by Image::ExifTool
169 |
170 | =head1 DESCRIPTION
171 |
172 | This module contains tag definitions for Stereo Still Image format (Stim)
173 | information.
174 |
175 | =head1 AUTHOR
176 |
177 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
178 |
179 | This library is free software; you can redistribute it and/or modify it
180 | under the same terms as Perl itself.
181 |
182 | =head1 REFERENCES
183 |
184 | =over 4
185 |
186 | =item L
187 |
188 | =back
189 |
190 | =head1 SEE ALSO
191 |
192 | L,
193 | L
194 |
195 | =cut
196 |
197 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/PPM.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: PPM.pm
3 | #
4 | # Description: Read and write PPM meta information
5 | #
6 | # Revisions: 09/03/2005 - P. Harvey Created
7 | #
8 | # References: 1) http://netpbm.sourceforge.net/doc/ppm.html
9 | # 2) http://netpbm.sourceforge.net/doc/pgm.html
10 | # 3) http://netpbm.sourceforge.net/doc/pbm.html
11 | #------------------------------------------------------------------------------
12 |
13 | package Image::ExifTool::PPM;
14 |
15 | use strict;
16 | use vars qw($VERSION);
17 | use Image::ExifTool qw(:DataAccess :Utils);
18 |
19 | $VERSION = '1.09';
20 |
21 | #------------------------------------------------------------------------------
22 | # Read or write information in a PPM/PGM/PBM image
23 | # Inputs: 0) ExifTool object reference, 1) Directory information reference
24 | # Returns: 1 on success, 0 if this wasn't a valid PPM file, -1 on write error
25 | sub ProcessPPM($$)
26 | {
27 | my ($et, $dirInfo) = @_;
28 | my $raf = $$dirInfo{RAF};
29 | my $outfile = $$dirInfo{OutFile};
30 | my $verbose = $et->Options('Verbose');
31 | my $out = $et->Options('TextOut');
32 | my ($buff, $num, $type, %info);
33 | #
34 | # read as much of the image as necessary to extract the header and comments
35 | #
36 | for (;;) {
37 | if (defined $buff) {
38 | # need to read some more data
39 | my $tmp;
40 | return 0 unless $raf->Read($tmp, 1024);
41 | $buff .= $tmp;
42 | } else {
43 | return 0 unless $raf->Read($buff, 1024);
44 | }
45 | # verify this is a valid PPM file
46 | return 0 unless $buff =~ /^P([1-6])\s+/g;
47 | $num = $1;
48 | # note: may contain comments starting with '#'
49 | if ($buff =~ /\G#/gc) {
50 | # must read more if we are in the middle of a comment
51 | next unless $buff =~ /\G ?(.*\n(#.*\n)*)\s*/g;
52 | $info{Comment} = $1;
53 | next if $buff =~ /\G#/gc;
54 | } else {
55 | delete $info{Comment};
56 | }
57 | next unless $buff =~ /\G(\S+)\s+(\S+)\s/g;
58 | $info{ImageWidth} = $1;
59 | $info{ImageHeight} = $2;
60 | $type = [qw{PPM PBM PGM}]->[$num % 3];
61 | last if $type eq 'PBM'; # (no MaxVal for PBM images)
62 | if ($buff =~ /\G\s*#/gc) {
63 | next unless $buff =~ /\G ?(.*\n(#.*\n)*)\s*/g;
64 | $info{Comment} = '' unless exists $info{Comment};
65 | $info{Comment} .= $1;
66 | next if $buff =~ /\G#/gc;
67 | }
68 | next unless $buff =~ /\G(\S+)\s/g;
69 | $info{MaxVal} = $1;
70 | last;
71 | }
72 | # validate numerical values
73 | foreach (keys %info) {
74 | next if $_ eq 'Comment';
75 | return 0 unless $info{$_} =~ /^\d+$/;
76 | }
77 | if (defined $info{Comment}) {
78 | $info{Comment} =~ s/^# ?//mg; # remove "# " at the start of each line
79 | $info{Comment} =~ s/\n$//; # remove trailing newline
80 | }
81 | $et->SetFileType($type);
82 | my $len = pos($buff);
83 | #
84 | # rewrite the file if requested
85 | #
86 | if ($outfile) {
87 | my $nvHash;
88 | my $newComment = $et->GetNewValue('Comment', \$nvHash);
89 | my $oldComment = $info{Comment};
90 | if ($et->IsOverwriting($nvHash, $oldComment)) {
91 | ++$$et{CHANGED};
92 | $et->VerboseValue('- Comment', $oldComment) if defined $oldComment;
93 | $et->VerboseValue('+ Comment', $newComment) if defined $newComment;
94 | } else {
95 | $newComment = $oldComment; # use existing comment
96 | }
97 | my $hdr = "P$num\n";
98 | if (defined $newComment) {
99 | $newComment =~ s/\n/\n# /g;
100 | $hdr .= "# $newComment\n";
101 | }
102 | $hdr .= "$info{ImageWidth} $info{ImageHeight}\n";
103 | $hdr .= "$info{MaxVal}\n" if $type ne 'PBM';
104 | # write header and start of image
105 | Write($outfile, $hdr, substr($buff, $len)) or return -1;
106 | # copy over the rest of the image
107 | while ($raf->Read($buff, 0x10000)) {
108 | Write($outfile, $buff) or return -1;
109 | }
110 | return 1;
111 | }
112 | #
113 | # save extracted information
114 | #
115 | if ($verbose > 2) {
116 | print $out "$type header ($len bytes):\n";
117 | $et->VerboseDump(\$buff, Len => $len);
118 | }
119 | my $tag;
120 | foreach $tag (qw{Comment ImageWidth ImageHeight MaxVal}) {
121 | $et->FoundTag($tag, $info{$tag}) if defined $info{$tag};
122 | }
123 | return 1;
124 | }
125 |
126 | 1; # end
127 |
128 | __END__
129 |
130 | =head1 NAME
131 |
132 | Image::ExifTool::PPM - Read and write PPM meta information
133 |
134 | =head1 SYNOPSIS
135 |
136 | This module is used by Image::ExifTool
137 |
138 | =head1 DESCRIPTION
139 |
140 | This module contains definitions required by Image::ExifTool to read and
141 | write PPM (Portable Pixel Map), PGM (Portable Gray Map) and PBM (Portable
142 | BitMap) images.
143 |
144 | =head1 AUTHOR
145 |
146 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
147 |
148 | This library is free software; you can redistribute it and/or modify it
149 | under the same terms as Perl itself.
150 |
151 | =head1 REFERENCES
152 |
153 | =over 4
154 |
155 | =item L
156 |
157 | =item L
158 |
159 | =item L
160 |
161 | =back
162 |
163 | =head1 SEE ALSO
164 |
165 | L,
166 | L
167 |
168 | =cut
169 |
170 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Apple.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Apple.pm
3 | #
4 | # Description: Apple EXIF maker notes tags
5 | #
6 | # Revisions: 2013-09-13 - P. Harvey Created
7 | #
8 | # References: 1) http://www.photoinvestigator.co/blog/the-mystery-of-maker-apple-metadata/
9 | #------------------------------------------------------------------------------
10 |
11 | package Image::ExifTool::Apple;
12 |
13 | use strict;
14 | use vars qw($VERSION);
15 | use Image::ExifTool::Exif;
16 | use Image::ExifTool::PLIST;
17 |
18 | $VERSION = '1.04';
19 |
20 | # Apple iPhone metadata (ref PH)
21 | %Image::ExifTool::Apple::Main = (
22 | WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
23 | CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
24 | WRITABLE => 1,
25 | GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
26 | NOTES => 'Tags extracted from the maker notes of iPhone images.',
27 | # 0x0001 - int32s: seen 0,1,2,3,4,9
28 | # 0x0002 - binary plist with a single data object of size 512 bytes (iPhone5s)
29 | 0x0003 => {
30 | Name => 'RunTime', # (includes time plugged in, but not when suspended, ref 1)
31 | SubDirectory => { TagTable => 'Image::ExifTool::Apple::RunTime' },
32 | },
33 | # 0x0004 - int32s: normally 1, but 0 for low-light images
34 | # 0x0005 - int32s: seen values 113-247, and 100 for blank images
35 | # 0x0006 - int32s: seen values 27-258, and 20 for blank images
36 | # 0x0007 - int32s: seen 1
37 | 0x0008 => { #1
38 | Name => 'AccelerationVector',
39 | Groups => { 2 => 'Camera' },
40 | Writable => 'rational64s',
41 | Count => 3,
42 | # Note: the directions are contrary to the Apple documentation (which have the
43 | # signs of all axes reversed -- apparently the Apple geeks aren't very good
44 | # with basic physics, and don't understand the concept of acceleration. See
45 | # http://nscookbook.com/2013/03/ios-programming-recipe-19-using-core-motion-to-access-gyro-and-accelerometer/
46 | # for one of the few correct descriptions of this). Note that this leads to
47 | # a left-handed coordinate system for acceleration.
48 | Notes => q{
49 | XYZ coordinates of the acceleration vector in units of g. As viewed from
50 | the front of the phone, positive X is toward the left side, positive Y is
51 | toward the bottom, and positive Z points into the face of the phone
52 | },
53 | },
54 | # 0x0009 - int32s: seen 19,275,531,4371
55 | 0x000a => {
56 | Name => 'HDRImageType',
57 | Writable => 'int32s',
58 | PrintConv => {
59 | # 2 => ? (iPad mini 2)
60 | 3 => 'HDR Image',
61 | 4 => 'Original Image',
62 | },
63 | },
64 | 0x000b => {
65 | Name => 'BurstUUID',
66 | Writable => 'string',
67 | Notes => 'unique ID for all images in a burst',
68 | },
69 | # 0x000c - rational64s[2]: eg) "0.1640625 0.19921875"
70 | # 0x000d - int32s: 0,1,6,20,24,32,40
71 | # 0x000e - int32s: 0,1,4,12 (Orienation? 0=landscape? 4=portrait? ref 1)
72 | # 0x000f - int32s: 2,3
73 | # 0x0010 - int32s: 1
74 | 0x0011 => {
75 | Name => 'ContentIdentifier', #forum8750
76 | Writable => 'string',
77 | },
78 | # 0x0014 - int32s: 1,2,3,4,5 (iPhone 6s, iOS 6.1)
79 | 0x0015 => {
80 | Name => 'ImageUniqueID',
81 | Writable => 'string',
82 | },
83 | # 0x0016 - string[29]: "AXZ6pMTOh2L+acSh4Kg630XCScoO\0"
84 | # 0x0017 - int32s: 0,8192
85 | # 0x0019 - int32s: 0,2,128
86 | # 0x001a - string[6]: "q825s\0"
87 | # 0x001f - int32s: 0
88 | );
89 |
90 | # PLIST-format CMTime structure (ref PH)
91 | # (CMTime ref https://developer.apple.com/library/ios/documentation/CoreMedia/Reference/CMTime/Reference/reference.html)
92 | %Image::ExifTool::Apple::RunTime = (
93 | PROCESS_PROC => \&Image::ExifTool::PLIST::ProcessBinaryPLIST,
94 | GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
95 | NOTES => q{
96 | This PLIST-format information contains the elements of a CMTime structure
97 | representing the amount of time the phone has been running since the last
98 | boot, not including standby time.
99 | },
100 | timescale => { Name => 'RunTimeScale' }, # (seen 1000000000 --> ns)
101 | epoch => { Name => 'RunTimeEpoch' }, # (seen 0)
102 | value => { Name => 'RunTimeValue' }, # (should divide by RunTimeScale to get seconds)
103 | flags => {
104 | Name => 'RunTimeFlags',
105 | PrintConv => { BITMASK => {
106 | 0 => 'Valid',
107 | 1 => 'Has been rounded',
108 | 2 => 'Positive infinity',
109 | 3 => 'Negative infinity',
110 | 4 => 'Indefinite',
111 | }},
112 | },
113 | );
114 |
115 | # Apple composite tags
116 | %Image::ExifTool::Apple::Composite = (
117 | GROUPS => { 2 => 'Camera' },
118 | RunTimeSincePowerUp => {
119 | Require => {
120 | 0 => 'Apple:RunTimeValue',
121 | 1 => 'Apple:RunTimeScale',
122 | },
123 | ValueConv => '$val[1] ? $val[0] / $val[1] : undef',
124 | PrintConv => 'ConvertDuration($val)',
125 | },
126 | );
127 |
128 | # add our composite tags
129 | Image::ExifTool::AddCompositeTags('Image::ExifTool::Apple');
130 |
131 |
132 | 1; # end
133 |
134 | __END__
135 |
136 | =head1 NAME
137 |
138 | Image::ExifTool::Apple - Apple EXIF maker notes tags
139 |
140 | =head1 SYNOPSIS
141 |
142 | This module is loaded automatically by Image::ExifTool when required.
143 |
144 | =head1 DESCRIPTION
145 |
146 | This module contains definitions required by Image::ExifTool to interpret
147 | Apple maker notes in EXIF information.
148 |
149 | =head1 AUTHOR
150 |
151 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
152 |
153 | This library is free software; you can redistribute it and/or modify it
154 | under the same terms as Perl itself.
155 |
156 | =head1 SEE ALSO
157 |
158 | L,
159 | L
160 |
161 | =cut
162 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Rawzor.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Rawzor.pm
3 | #
4 | # Description: Read meta information from Rawzor compressed images
5 | #
6 | # Revisions: 09/09/2008 - P. Harvey Created
7 | #
8 | # References: 1) http://www.rawzor.com/
9 | #------------------------------------------------------------------------------
10 |
11 | package Image::ExifTool::Rawzor;
12 |
13 | use strict;
14 | use vars qw($VERSION);
15 | use Image::ExifTool qw(:DataAccess :Utils);
16 |
17 | $VERSION = '1.05';
18 |
19 | # currently support this version Rawzor images
20 | my $implementedRawzorVersion = 199; # (up to version 1.99)
21 |
22 | # Rawzor-specific tags
23 | %Image::ExifTool::Rawzor::Main = (
24 | GROUPS => { 2 => 'Other' },
25 | VARS => { NO_ID => 1 },
26 | NOTES => q{
27 | Rawzor files store compressed images of other formats. As well as the
28 | information listed below, exiftool uncompresses and extracts the meta
29 | information from the original image.
30 | },
31 | OriginalFileType => { },
32 | OriginalFileSize => {
33 | PrintConv => $Image::ExifTool::Extra{FileSize}->{PrintConv},
34 | },
35 | RawzorRequiredVersion => {
36 | ValueConv => '$val / 100',
37 | PrintConv => 'sprintf("%.2f", $val)',
38 | },
39 | RawzorCreatorVersion => {
40 | ValueConv => '$val / 100',
41 | PrintConv => 'sprintf("%.2f", $val)',
42 | },
43 | # compression factor is originalSize/compressedSize (and compression
44 | # ratio is the inverse - ref "Data Compression" by David Salomon)
45 | CompressionFactor => { PrintConv => 'sprintf("%.2f", $val)' },
46 | );
47 |
48 | #------------------------------------------------------------------------------
49 | # Extract information from a Rawzor file
50 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference
51 | # Returns: 1 on success, 0 if this wasn't a valid Rawzor file
52 | sub ProcessRWZ($$)
53 | {
54 | my ($et, $dirInfo) = @_;
55 | my $raf = $$dirInfo{RAF};
56 | my ($buff, $buf2);
57 |
58 | # read the Rawzor file header:
59 | # 0 string - "rawzor" signature
60 | # 6 int16u - Required SDK version
61 | # 8 int16u - Creator SDK version
62 | # 10 int64u - RWZ file size
63 | # 18 int64u - original raw file size
64 | # 26 undef[12] - reserved
65 | # 38 int64u - metadata offset
66 | $raf->Read($buff, 46) == 46 and $buff =~ /^rawzor/ or return 0;
67 |
68 | SetByteOrder('II');
69 | my $reqVers = Get16u(\$buff, 6);
70 | my $creatorVers = Get16u(\$buff, 8);
71 | my $rwzSize = Get64u(\$buff, 10);
72 | my $origSize = Get64u(\$buff, 18);
73 | my $tagTablePtr = GetTagTable('Image::ExifTool::Rawzor::Main');
74 | $et->HandleTag($tagTablePtr, RawzorRequiredVersion => $reqVers);
75 | $et->HandleTag($tagTablePtr, RawzorCreatorVersion => $creatorVers);
76 | $et->HandleTag($tagTablePtr, OriginalFileSize => $origSize);
77 | $et->HandleTag($tagTablePtr, CompressionFactor => $origSize/$rwzSize) if $rwzSize;
78 | # check version numbers
79 | if ($reqVers > $implementedRawzorVersion) {
80 | $et->Warn("Version $reqVers Rawzor images not yet supported");
81 | return 1;
82 | }
83 | my $metaOffset = Get64u(\$buff, 38);
84 | if ($metaOffset > 0x7fffffff) {
85 | $et->Warn('Bad metadata offset');
86 | return 1;
87 | }
88 | # check for the ability to uncompress the information
89 | unless (eval { require IO::Uncompress::Bunzip2 }) {
90 | $et->Warn('Install IO::Compress::Bzip2 to decode Rawzor bzip2 compression');
91 | return 1;
92 | }
93 | # read the metadata header:
94 | # 0 int64u - metadata section 0 end (offset in original file)
95 | # 8 int64u - metadata section 1 start
96 | # 16 int64u - metadata section 1 end
97 | # 24 int64u - metadata section 2 start
98 | # 32 undef[4] - reserved
99 | # 36 int32u - original metadata size
100 | # 40 int32u - compressed metadata size
101 | unless ($raf->Seek($metaOffset, 0) and $raf->Read($buff, 44) == 44) {
102 | $et->Warn('Error reading metadata header');
103 | return 1;
104 | }
105 | my $metaSize = Get32u(\$buff, 36);
106 | if ($metaSize) {
107 | $$et{DontValidateImageData} = 1;
108 | # validate the metadata header and read the compressed metadata
109 | my $end0 = Get64u(\$buff, 0);
110 | my $pos1 = Get64u(\$buff, 8);
111 | my $end1 = Get64u(\$buff, 16);
112 | my $pos2 = Get64u(\$buff, 24);
113 | my $len = Get32u(\$buff, 40);
114 | unless ($raf->Read($buff, $len) == $len and
115 | $end0 + ($end1 - $pos1) + ($origSize - $pos2) == $metaSize and
116 | $end0 <= $pos1 and $pos1 <= $end1 and $end1 <= $pos2)
117 | {
118 | $et->Warn('Error reading image metadata');
119 | return 1;
120 | }
121 | # uncompress the metadata
122 | unless (IO::Uncompress::Bunzip2::bunzip2(\$buff, \$buf2) and
123 | length($buf2) eq $metaSize)
124 | {
125 | $et->Warn('Error uncompressing image metadata');
126 | return 1;
127 | }
128 | # re-assemble the original file (sans image data)
129 | undef $buff; # (can't hurt to free memory as soon as possible)
130 | $buff = substr($buf2, 0, $end0) . ("\0" x ($pos1 - $end0)) .
131 | substr($buf2, $end0, $end1 - $pos1) . ("\0" x ($pos2 - $end1)) .
132 | substr($buf2, $end0 + $end1 - $pos1, $origSize - $pos2);
133 | undef $buf2;
134 |
135 | # extract original information by calling ExtractInfo recursively
136 | $et->ExtractInfo(\$buff, { ReEntry => 1 });
137 | undef $buff;
138 | }
139 | # set OriginalFileType from FileType of original file
140 | # then change FileType and MIMEType to indicate a Rawzor image
141 | my $origFileType = $$et{VALUE}{FileType};
142 | if ($origFileType) {
143 | $et->HandleTag($tagTablePtr, OriginalFileType => $origFileType);
144 | $et->OverrideFileType('RWZ');
145 | } else {
146 | $et->HandleTag($tagTablePtr, OriginalFileType => 'Unknown');
147 | $et->SetFileType();
148 | }
149 | return 1;
150 | }
151 |
152 | 1; # end
153 |
154 | __END__
155 |
156 | =head1 NAME
157 |
158 | Image::ExifTool::Rawzor - Read meta information from Rawzor compressed images
159 |
160 | =head1 SYNOPSIS
161 |
162 | This module is used by Image::ExifTool
163 |
164 | =head1 DESCRIPTION
165 |
166 | This module contains definitions required by Image::ExifTool to extract meta
167 | information from Rawzor compressed images.
168 |
169 | =head1 AUTHOR
170 |
171 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
172 |
173 | This library is free software; you can redistribute it and/or modify it
174 | under the same terms as Perl itself.
175 |
176 | =head1 REFERENCES
177 |
178 | =over 4
179 |
180 | =item L
181 |
182 | =back
183 |
184 | =head1 SEE ALSO
185 |
186 | L,
187 | L
188 |
189 | =cut
190 |
191 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/ITC.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: ITC.pm
3 | #
4 | # Description: Read iTunes Cover Flow meta information
5 | #
6 | # Revisions: 01/12/2008 - P. Harvey Created
7 | #
8 | # References: 1) http://www.waldoland.com/dev/Articles/ITCFileFormat.aspx
9 | # 2) http://www.falsecognate.org/2007/01/deciphering_the_itunes_itc_fil/
10 | #------------------------------------------------------------------------------
11 |
12 | package Image::ExifTool::ITC;
13 |
14 | use strict;
15 | use vars qw($VERSION);
16 | use Image::ExifTool qw(:DataAccess :Utils);
17 |
18 | $VERSION = '1.02';
19 |
20 | sub ProcessITC($$);
21 |
22 | # tags used in ITC files
23 | %Image::ExifTool::ITC::Main = (
24 | NOTES => 'This information is found in iTunes Cover Flow data files.',
25 | itch => { SubDirectory => { TagTable => 'Image::ExifTool::ITC::Header' } },
26 | item => { SubDirectory => { TagTable => 'Image::ExifTool::ITC::Item' } },
27 | data => {
28 | Name => 'ImageData',
29 | Notes => 'embedded JPEG or PNG image, depending on ImageType',
30 | },
31 | );
32 |
33 | # ITC header information
34 | %Image::ExifTool::ITC::Header = (
35 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
36 | GROUPS => { 2 => 'Image' },
37 | 0x10 => {
38 | Name => 'DataType',
39 | Format => 'undef[4]',
40 | PrintConv => { artw => 'Artwork' },
41 | },
42 | );
43 |
44 | # ITC item information
45 | %Image::ExifTool::ITC::Item = (
46 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
47 | GROUPS => { 2 => 'Image' },
48 | FORMAT => 'int32u',
49 | FIRST_ENTRY => 0,
50 | 0 => {
51 | Name => 'LibraryID',
52 | Format => 'undef[8]',
53 | ValueConv => 'uc unpack "H*", $val',
54 | },
55 | 2 => {
56 | Name => 'TrackID',
57 | Format => 'undef[8]',
58 | ValueConv => 'uc unpack "H*", $val',
59 | },
60 | 4 => {
61 | Name => 'DataLocation',
62 | Format => 'undef[4]',
63 | PrintConv => {
64 | down => 'Downloaded Separately',
65 | locl => 'Local Music File',
66 | },
67 | },
68 | 5 => {
69 | Name => 'ImageType',
70 | Format => 'undef[4]',
71 | ValueConv => { # (not PrintConv because the unconverted JPEG value is nasty)
72 | 'PNGf' => 'PNG',
73 | "\0\0\0\x0d" => 'JPEG',
74 | },
75 | },
76 | 7 => 'ImageWidth',
77 | 8 => 'ImageHeight',
78 | );
79 |
80 | #------------------------------------------------------------------------------
81 | # Process an iTunes Cover Flow (ITC) file
82 | # Inputs: 0) ExifTool object reference, 1) Directory information reference
83 | # Returns: 1 on success, 0 if this wasn't a valid ITC file
84 | sub ProcessITC($$)
85 | {
86 | my ($et, $dirInfo) = @_;
87 | my $raf = $$dirInfo{RAF};
88 | my $rtnVal = 0;
89 | my ($buff, $err, $pos, $tagTablePtr, %dirInfo);
90 |
91 | # loop through all blocks in this image
92 | for (;;) {
93 | # read the block header
94 | my $n = $raf->Read($buff, 8);
95 | unless ($n == 8) {
96 | # no error if we reached the EOF normally
97 | undef $err unless $n;
98 | last;
99 | }
100 | my ($size, $tag) = unpack('Na4', $buff);
101 | if ($rtnVal) {
102 | last unless $size >= 8 and $size < 0x80000000;
103 | } else {
104 | # check to be sure this is a valid ITC image
105 | # (first block must be 'itch')
106 | last unless $tag eq 'itch';
107 | last unless $size >= 0x1c and $size < 0x10000;
108 | $et->SetFileType();
109 | SetByteOrder('MM');
110 | $rtnVal = 1; # this is an ITC file
111 | $err = 1; # format error unless we read to EOF
112 | }
113 | if ($tag eq 'itch') {
114 | $pos = $raf->Tell();
115 | $size -= 8; # size of remaining data in block
116 | $raf->Read($buff,$size) == $size or last;
117 | # extract header information
118 | %dirInfo = (
119 | DirName => 'ITC Header',
120 | DataPt => \$buff,
121 | DataPos => $pos,
122 | );
123 | my $tagTablePtr = GetTagTable('Image::ExifTool::ITC::Header');
124 | $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
125 | } elsif ($tag eq 'item') {
126 | # don't want to read the entire item data (includes image)
127 | $size > 12 or last;
128 | $raf->Read($buff, 4) == 4 or last;
129 | my $len = unpack('N', $buff);
130 | $len >= 0xd0 and $len <= $size or last;
131 | $size -= $len; # size of data after item header
132 | $len -= 12; # length of remaining item header
133 | # read in 4-byte blocks until we find the null terminator
134 | # (this is just a guess about how to parse this variable-length part)
135 | while ($len >= 4) {
136 | $raf->Read($buff, 4) == 4 or last;
137 | $len -= 4;
138 | last if $buff eq "\0\0\0\0";
139 | }
140 | last if $len < 4;
141 | $pos = $raf->Tell();
142 | $raf->Read($buff, $len) == $len or last;
143 | unless ($len >= 0xb4 and substr($buff, 0xb0, 4) eq 'data') {
144 | $et->Warn('Parsing error. Please submit this ITC file for testing');
145 | last;
146 | }
147 | %dirInfo = (
148 | DirName => 'ITC Item',
149 | DataPt => \$buff,
150 | DataPos => $pos,
151 | );
152 | $tagTablePtr = GetTagTable('Image::ExifTool::ITC::Item');
153 | $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
154 | # extract embedded image
155 | $pos += $len;
156 | if ($size > 0) {
157 | $tagTablePtr = GetTagTable('Image::ExifTool::ITC::Main');
158 | my $tagInfo = $et->GetTagInfo($tagTablePtr, 'data');
159 | my $image = $et->ExtractBinary($pos, $size, $$tagInfo{Name});
160 | $et->FoundTag($tagInfo, \$image);
161 | # skip the rest of the block if necessary
162 | $raf->Seek($pos+$size, 0) or last
163 | } elsif ($size < 0) {
164 | last;
165 | }
166 | } else {
167 | $et->VPrint(0, "Unknown $tag block ($size bytes)\n");
168 | $raf->Seek($size-8, 1) or last;
169 | }
170 | }
171 | $err and $et->Warn('ITC file format error');
172 | return $rtnVal;
173 | }
174 |
175 | 1; # end
176 |
177 | __END__
178 |
179 | =head1 NAME
180 |
181 | Image::ExifTool::ITC - Read iTunes Cover Flow meta information
182 |
183 | =head1 SYNOPSIS
184 |
185 | This module is used by Image::ExifTool
186 |
187 | =head1 DESCRIPTION
188 |
189 | This module contains the routines required by Image::ExifTool to read meta
190 | information (including artwork images) from iTunes Cover Flow files.
191 |
192 | =head1 AUTHOR
193 |
194 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
195 |
196 | This library is free software; you can redistribute it and/or modify it
197 | under the same terms as Perl itself.
198 |
199 | =head1 REFERENCES
200 |
201 | =over 4
202 |
203 | =item L
204 |
205 | =item L
206 |
207 | =back
208 |
209 | =head1 SEE ALSO
210 |
211 | L,
212 | L
213 |
214 | =cut
215 |
216 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/DPX.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: DPX.pm
3 | #
4 | # Description: Read DPX meta information
5 | #
6 | # Revisions: 2013-09-19 - P. Harvey created
7 | #
8 | # References: 1) http://www.cineon.com/ff_draft.php
9 | #------------------------------------------------------------------------------
10 |
11 | package Image::ExifTool::DPX;
12 |
13 | use strict;
14 | use vars qw($VERSION);
15 | use Image::ExifTool qw(:DataAccess :Utils);
16 |
17 | $VERSION = '1.03';
18 |
19 | # DPX tags
20 | %Image::ExifTool::DPX::Main = (
21 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
22 | GROUPS => { 0 => 'File', 1 => 'File', 2 => 'Image' },
23 | NOTES => 'Tags extracted from DPX (Digital Picture Exchange) images.',
24 | 0 => { Name => 'ByteOrder', Format => 'undef[4]', PrintConv => { SDPX => 'Big-endian', XPDS => 'Little-endian' } },
25 | 8 => { Name => 'HeaderVersion', Format => 'string[8]' },
26 | # 24 => { Name => 'GenericHeaderSize', Format => 'int32u' }, # = 1664
27 | # 28 => { Name => 'IndustryStandardHeaderSize', Format => 'int32u' }, # = 384
28 | 16 => { Name => 'DPXFileSize', Format => 'int32u' },
29 | 20 => { Name => 'DittoKey', Format => 'int32u', PrintConv => { 0 => 'Same', 1 => 'New' } },
30 | 36 => { Name => 'ImageFileName', Format => 'string[100]' },
31 | 136 => {
32 | Name => 'CreateDate',
33 | Format => 'string[24]',
34 | Groups => { 2 => 'Time' },
35 | ValueConv => '$val =~ s/(\d{4}:\d{2}:\d{2}):/$1 /; $val',
36 | PrintConv => '$self->ConvertDateTime($val)',
37 | },
38 | 160 => { Name => 'Creator', Format => 'string[100]', Groups => { 2 => 'Author' } },
39 | 260 => { Name => 'Project', Format => 'string[200]' },
40 | 460 => { Name => 'Copyright', Format => 'string[200]', Groups => { 2 => 'Author' } },
41 | 660 => { Name => 'EncryptionKey', Format => 'int32u', PrintConv => 'sprintf("%.8x",$val)' },
42 | 768 => {
43 | Name => 'Orientation',
44 | Format => 'int16u',
45 | PrintConv => {
46 | 0 => 'Horizontal (normal)',
47 | 1 => 'Mirror vertical',
48 | 2 => 'Mirror horizontal',
49 | 3 => 'Rotate 180',
50 | 4 => 'Mirror horizontal and rotate 270 CW',
51 | 5 => 'Rotate 90 CW',
52 | 6 => 'Rotate 270 CW',
53 | 7 => 'Mirror horizontal and rotate 90 CW',
54 | },
55 | },
56 | 770 => { Name => 'ImageElements', Format => 'int16u' },
57 | 772 => { Name => 'ImageWidth', Format => 'int32u' },
58 | 776 => { Name => 'ImageHeight', Format => 'int32u' },
59 | 780 => { Name => 'DataSign', Format => 'int32u', PrintConv => { 0 => 'Unsigned', 1 => 'Signed' } },
60 | 800 => {
61 | Name => 'ComponentsConfiguration',
62 | Format => 'int8u',
63 | PrintConv => {
64 | 0 => 'User-defined single component',
65 | 1 => 'Red (R)',
66 | 2 => 'Green (G)',
67 | 3 => 'Blue (B)',
68 | 4 => 'Alpha (matte)',
69 | 6 => 'Luminance (Y)',
70 | 7 => 'Chrominance (Cb, Cr, subsampled by two)',
71 | 8 => 'Depth (Z)',
72 | 9 => 'Composite video',
73 | 50 => 'R, G, B',
74 | 51 => 'R, G, B, Alpha',
75 | 52 => 'Alpha, B, G, R',
76 | 100 => 'Cb, Y, Cr, Y (4:2:2)',
77 | 101 => 'Cb, Y, A, Cr, Y, A (4:2:2:4)',
78 | 102 => 'Cb, Y, Cr (4:4:4)',
79 | 103 => 'Cb, Y, Cr, A (4:4:4:4)',
80 | 150 => 'User-defined 2 component element',
81 | 151 => 'User-defined 3 component element',
82 | 152 => 'User-defined 4 component element',
83 | 153 => 'User-defined 5 component element',
84 | 154 => 'User-defined 6 component element',
85 | 155 => 'User-defined 7 component element',
86 | 156 => 'User-defined 8 component element',
87 | },
88 | },
89 | 803 => { Name => 'BitDepth', Format => 'int8u' },
90 | 820 => { Name => 'ImageDescription', Format => 'string[32]' },
91 | 892 => { Name => 'Image2Description', Format => 'string[32]', RawConv => '$val=~/[^\xff]/ ? $val : undef' },
92 | 964 => { Name => 'Image3Description', Format => 'string[32]', RawConv => '$val=~/[^\xff]/ ? $val : undef' },
93 | 1036=> { Name => 'Image4Description', Format => 'string[32]', RawConv => '$val=~/[^\xff]/ ? $val : undef' },
94 | 1108=> { Name => 'Image5Description', Format => 'string[32]', RawConv => '$val=~/[^\xff]/ ? $val : undef' },
95 | 1180=> { Name => 'Image6Description', Format => 'string[32]', RawConv => '$val=~/[^\xff]/ ? $val : undef' },
96 | 1252=> { Name => 'Image7Description', Format => 'string[32]', RawConv => '$val=~/[^\xff]/ ? $val : undef' },
97 | 1324=> { Name => 'Image8Description', Format => 'string[32]', RawConv => '$val=~/[^\xff]/ ? $val : undef' },
98 | # 1408=> { Name => 'XOffset', Format => 'int32u' },
99 | # 1412=> { Name => 'YOffset', Format => 'int32u' },
100 | # 1416=> { Name => 'XCenter', Format => 'float' },
101 | # 1420=> { Name => 'YCenter', Format => 'float' },
102 | # 1424=> { Name => 'XOriginalSize', Format => 'int32u' },
103 | # 1428=> { Name => 'YOriginalSize', Format => 'int32u' },
104 | 1432=> { Name => 'SourceFileName', Format => 'string[100]' },
105 | 1532=> { Name => 'SourceCreateDate', Format => 'string[24]' },
106 | 1556=> { Name => 'InputDeviceName', Format => 'string[32]' },
107 | 1588=> { Name => 'InputDeviceSerialNumber', Format => 'string[32]' },
108 | # 1620=> { Name => 'AspectRatio', Format => 'int32u' },
109 | 1724 => { Name => 'FrameRate', Format => 'float' },
110 | 1732 => { Name => 'FrameID', Format => 'string[32]' },
111 | 1764 => { Name => 'SlateInformation', Format => 'string[100]' },
112 | 1972 => { Name => 'Reserved5', Format => 'string[76]', Unknown => 1 },
113 | 2048 => { Name => 'UserID', Format => 'string[32]' },
114 | );
115 |
116 | #------------------------------------------------------------------------------
117 | # Extract EXIF information from a DPX image
118 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference
119 | # Returns: 1 on success, 0 if this wasn't a valid DPX file
120 | sub ProcessDPX($$)
121 | {
122 | my ($et, $dirInfo) = @_;
123 | my $raf = $$dirInfo{RAF};
124 | my $buff;
125 |
126 | # verify this is a valid DPX file
127 | return 0 unless $raf->Read($buff, 2080) == 2080;
128 | return 0 unless $buff =~ /^(SDPX|XPDS)/;
129 | SetByteOrder($1 eq 'SDPX' ? 'MM' : 'II');
130 | $et->SetFileType(); # set the FileType tag
131 | my $hdrLen = Get32u(\$buff,24) + Get32u(\$buff,28);
132 | $hdrLen == 2048 or $et->Warn("Unexpected DPX header length ($hdrLen)");
133 | my %dirInfo = (
134 | DataPt => \$buff,
135 | DirStart => 0,
136 | DirLen => length($buff),
137 | );
138 | my $tagTablePtr = GetTagTable('Image::ExifTool::DPX::Main');
139 | $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
140 |
141 | return 1;
142 | }
143 |
144 | 1; # end
145 |
146 | __END__
147 |
148 | =head1 NAME
149 |
150 | Image::ExifTool::DPX - Read DPX meta information
151 |
152 | =head1 SYNOPSIS
153 |
154 | This module is used by Image::ExifTool
155 |
156 | =head1 DESCRIPTION
157 |
158 | This module contains definitions required by Image::ExifTool to read
159 | metadata from DPX (Digital Picture Exchange) images.
160 |
161 | =head1 AUTHOR
162 |
163 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
164 |
165 | This library is free software; you can redistribute it and/or modify it
166 | under the same terms as Perl itself.
167 |
168 | =head1 REFERENCES
169 |
170 | =over 4
171 |
172 | =item L
173 |
174 | =back
175 |
176 | =head1 SEE ALSO
177 |
178 | L,
179 | L
180 |
181 | =cut
182 |
183 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Lytro.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Lytro.pm
3 | #
4 | # Description: Read Lytro LFP files
5 | #
6 | # Revisions: 2014-07-17 - P. Harvey Created
7 | #
8 | # References: 1) http://optics.miloush.net/lytro/TheFileFormat.aspx
9 | #------------------------------------------------------------------------------
10 |
11 | package Image::ExifTool::Lytro;
12 |
13 | use strict;
14 | use vars qw($VERSION);
15 | use Image::ExifTool qw(:DataAccess :Utils);
16 | use Image::ExifTool::Import;
17 |
18 | $VERSION = '1.03';
19 |
20 | sub ExtractTags($$$);
21 |
22 | # Lytro LFP tags (ref PH)
23 | %Image::ExifTool::Lytro::Main = (
24 | GROUPS => { 2 => 'Camera' },
25 | VARS => { NO_ID => 1 },
26 | NOTES => q{
27 | Tag definitions for Lytro Light Field Picture (LFP) files. ExifTool
28 | extracts the full JSON metadata blocks, as well as breaking them down into
29 | individual tags. All available tags are extracted from the JSON metadata,
30 | even if they don't appear in the table below.
31 | },
32 | JSONMetadata => {
33 | Notes => 'the full JSON-format metadata blocks',
34 | Binary => 1,
35 | List => 1,
36 | },
37 | EmbeddedImage => {
38 | Notes => 'JPEG image embedded in LFP files written by Lytro Desktop',
39 | Groups => { 2 => 'Preview' },
40 | Binary => 1,
41 | },
42 | Type => { Name => 'CameraType' },
43 | CameraMake => { Name => 'Make' },
44 | CameraModel => { Name => 'Model', Description => 'Camera Model Name' },
45 | CameraSerialNumber => { Name => 'SerialNumber'},
46 | CameraFirmware => { Name => 'FirmwareVersion'},
47 | DevicesAccelerometerSampleArrayTime => { Name => 'AccelerometerTime'},
48 | DevicesAccelerometerSampleArrayX => { Name => 'AccelerometerX'},
49 | DevicesAccelerometerSampleArrayY => { Name => 'AccelerometerY'},
50 | DevicesAccelerometerSampleArrayZ => { Name => 'AccelerometerZ'},
51 | DevicesClockZuluTime => {
52 | Name => 'DateTimeOriginal',
53 | Groups => { 2 => 'Time' },
54 | ValueConv => 'require Image::ExifTool::XMP; Image::ExifTool::XMP::ConvertXMPDate($val)',
55 | PrintConv => '$self->ConvertDateTime($val)',
56 | },
57 | DevicesLensFNumber => {
58 | Name => 'FNumber',
59 | PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
60 | },
61 | DevicesLensFocalLength => {
62 | Name => 'FocalLength',
63 | ValueConv => '$val * 1000', # convert from metres to mm
64 | PrintConv => 'sprintf("%.1f mm",$val)',
65 | },
66 | DevicesLensTemperature => {
67 | Name => 'LensTemperature',
68 | PrintConv => 'sprintf("%.1f C",$val)',
69 | },
70 | DevicesSocTemperature => {
71 | Name => 'SocTemperature',
72 | PrintConv => 'sprintf("%.1f C",$val)',
73 | },
74 | DevicesShutterFrameExposureDuration => {
75 | Name => 'FrameExposureTime',
76 | PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
77 | },
78 | DevicesShutterPixelExposureDuration => {
79 | Name => 'ExposureTime',
80 | PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
81 | },
82 | DevicesSensorPixelPitch => {
83 | Name => 'FocalPlaneXResolution',
84 | Notes => 'Y resolution is the same as X resolution',
85 | ValueConv => '25.4 / $val / 1000', # convert from metres to pixels/inch
86 | },
87 | DevicesSensorSensorSerial => { Name => 'SensorSerialNumber'},
88 | DevicesSensorIso => { Name => 'ISO' },
89 | ImageLimitExposureBias => { Groups => { 2 => 'Image' }, PrintConv => 'sprintf("%+.1f", $val)' },
90 | ImageModulationExposureBias => { Groups => { 2 => 'Image' }, PrintConv => 'sprintf("%+.1f", $val)' },
91 | ImageOrientation => {
92 | Name => 'Orientation',
93 | Groups => { 2 => 'Image' },
94 | PrintConv => {
95 | 1 => 'Horizontal (normal)',
96 | },
97 | },
98 | );
99 |
100 | #------------------------------------------------------------------------------
101 | # Extract tags from a parsed JSON hash
102 | # Inputs: 0) ExifTool ref, 1) tag hash ref, 2) base tag name
103 | sub ExtractTags($$$)
104 | {
105 | my ($et, $meta, $parent) = @_;
106 | ref $meta eq 'HASH' or $et->Warn('Invalid LFP metadata'), return;
107 | my ($key, $val, $name, $tagTablePtr);
108 | foreach $key (sort keys %$meta) {
109 | my $tag = $parent . ucfirst($key);
110 | foreach $val (ref $$meta{$key} eq 'ARRAY' ? @{$$meta{$key}} : $$meta{$key}) {
111 | ref $val eq 'HASH' and ExtractTags($et, $val, $tag), next;
112 | $tagTablePtr or $tagTablePtr = GetTagTable('Image::ExifTool::Lytro::Main');
113 | unless ($$tagTablePtr{$tag}) {
114 | ($name = $tag) =~ s/[^-_a-zA-Z0-9](.?)/\U$1/g;
115 | $name =~ s/ParametersVendorContentComLytroTags//;
116 | my %tagInfo;
117 | $tagInfo{Groups} = { 2 => 'Image' } unless $name =~ s/^Devices//;
118 | $tagInfo{List} = 1 if ref $$meta{$key} eq 'ARRAY';
119 | $tagInfo{Name} = $name;
120 | my $str = $tag eq $name ? '' : " as $name";
121 | $et->VPrint(0, " [adding $tag$str]\n");
122 | AddTagToTable($tagTablePtr, $tag, \%tagInfo);
123 | }
124 | $et->HandleTag($tagTablePtr, $tag, $val);
125 | }
126 | }
127 | }
128 |
129 | #------------------------------------------------------------------------------
130 | # Process segments from a Lytro LFP image
131 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference
132 | # Returns: 1 on success, 0 if this wasn't a valid Lytro image
133 | sub ProcessLFP($$)
134 | {
135 | my ($et, $dirInfo) = @_;
136 | my $raf = $$dirInfo{RAF};
137 | my $verbose = $et->Options('Verbose');
138 | my ($buff, $id);
139 |
140 | # validate the Lytro file header
141 | return 0 unless $raf->Read($buff, 16) == 16 and $buff =~ /^\x89LFP\x0d\x0a\x1a\x0a/;
142 | $et->SetFileType(); # set the FileType tag
143 | SetByteOrder('MM');
144 | my $tagTablePtr = GetTagTable('Image::ExifTool::Lytro::Main');
145 | while ($raf->Read($buff, 16) == 16) {
146 | $buff =~ /^\x89LF/ or $et->Warn('LFP format error'), last;
147 | my $size = Get32u(\$buff, 12);
148 | $size & 0x80000000 and $et->Warn('Invalid LFP segment size'), last;
149 | $raf->Read($id, 80) == 80 or $et->Warn('Truncated LFP segment'), last; # ignore the sha1
150 | if ($verbose) {
151 | $id =~ s/\0.*//s;
152 | $et->VPrint(0, substr($buff,1,3), " segment ($size bytes, $id)\n");
153 | }
154 | if ($size > 20000000) {
155 | $raf->Seek($size, 1) or $et->Warn('Seek error in LFP file'), last;
156 | } else {
157 | $raf->Read($buff,$size) == $size or $et->Warn('Truncated LFP data'), last;
158 | $et->VerboseDump(\$buff, Addr=>$raf->Tell()-$size);
159 | if ($buff =~ /^\{\s+"/) { # JSON metadata?
160 | pos($buff) = 0;
161 | $et->HandleTag($tagTablePtr, 'JSONMetadata', $buff);
162 | my $meta = Image::ExifTool::Import::ReadJSONObject(undef, \$buff);
163 | ExtractTags($et, $meta, '');
164 | } elsif ($buff =~ /^\xff\xd8\xff/) { # embedded JPEG image?
165 | $et->HandleTag($tagTablePtr, 'EmbeddedImage', $buff);
166 | }
167 | }
168 | # skip padding if necessary
169 | my $pad = 16 - ($size % 16);
170 | $raf->Seek($pad, 1) if $pad != 16;
171 | }
172 | return 1;
173 | }
174 |
175 | 1; # end
176 |
177 | __END__
178 |
179 | =head1 NAME
180 |
181 | Image::ExifTool::Lytro - Read Lytro LFP files
182 |
183 | =head1 SYNOPSIS
184 |
185 | This module is used by Image::ExifTool
186 |
187 | =head1 DESCRIPTION
188 |
189 | This module contains routines required by Image::ExifTool to read metadata
190 | from Lytro Light Field Picture (LFP) files.
191 |
192 | =head1 AUTHOR
193 |
194 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
195 |
196 | This library is free software; you can redistribute it and/or modify it
197 | under the same terms as Perl itself.
198 |
199 | =head1 REFERENCES
200 |
201 | =over 4
202 |
203 | =item L
204 |
205 | =back
206 |
207 | =head1 SEE ALSO
208 |
209 | L,
210 | L
211 |
212 | =cut
213 |
214 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/iWork.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: iWork.pm
3 | #
4 | # Description: Read Apple iWork '09 XML+ZIP files
5 | #
6 | # Revisions: 2009/11/11 - P. Harvey Created
7 | #------------------------------------------------------------------------------
8 |
9 | package Image::ExifTool::iWork;
10 |
11 | use strict;
12 | use vars qw($VERSION);
13 | use Image::ExifTool qw(:DataAccess :Utils);
14 | use Image::ExifTool::XMP;
15 | use Image::ExifTool::ZIP;
16 |
17 | $VERSION = '1.05';
18 |
19 | # test for recognized iWork document extensions and outer XML elements
20 | my %iWorkType = (
21 | # file extensions
22 | NUMBERS => 'NUMBERS',
23 | PAGES => 'PAGES',
24 | KEY => 'KEY',
25 | KTH => 'KTH',
26 | NMBTEMPLATE => 'NMBTEMPLATE',
27 | # we don't support double extensions --
28 | # "PAGES.TEMPLATE" => 'Apple Pages Template',
29 | # outer XML elements
30 | 'ls:document' => 'NUMBERS',
31 | 'sl:document' => 'PAGES',
32 | 'key:presentation' => 'KEY',
33 | );
34 |
35 | # MIME types for iWork files (Apple has not registered these yet, but these
36 | # are my best guess after doing some googling. I'm not 100% sure what "sff"
37 | # indicates, but I think it refers to the new "flattened" package format)
38 | my %mimeType = (
39 | 'NUMBERS' => 'application/x-iwork-numbers-sffnumbers',
40 | 'PAGES' => 'application/x-iwork-pages-sffpages',
41 | 'KEY' => 'application/x-iWork-keynote-sffkey',
42 | 'NMBTEMPLATE' => 'application/x-iwork-numbers-sfftemplate',
43 | 'PAGES.TEMPLATE'=> 'application/x-iwork-pages-sfftemplate',
44 | 'KTH' => 'application/x-iWork-keynote-sffkth',
45 | );
46 |
47 | # iWork tags
48 | %Image::ExifTool::iWork::Main = (
49 | GROUPS => { 0 => 'XML', 1 => 'XML', 2 => 'Document' },
50 | PROCESS_PROC => \&Image::ExifTool::XMP::ProcessXMP,
51 | VARS => { NO_ID => 1 },
52 | NOTES => q{
53 | The Apple iWork '09 file format is a ZIP archive containing XML files
54 | similar to the Office Open XML (OOXML) format. Metadata tags in iWork
55 | files are extracted even if they don't appear below.
56 | },
57 | authors => { Name => 'Author', Groups => { 2 => 'Author' } },
58 | comment => { },
59 | copyright => { Groups => { 2 => 'Author' } },
60 | keywords => { },
61 | projects => { List => 1 },
62 | title => { },
63 | );
64 |
65 | #------------------------------------------------------------------------------
66 | # Generate a tag ID for this XML tag
67 | # Inputs: 0) tag property name list ref
68 | # Returns: tagID
69 | sub GetTagID($)
70 | {
71 | my $props = shift;
72 | return 0 if $$props[-1] =~ /^\w+:ID$/; # ignore ID tags
73 | return ($$props[0] =~ /^.*?:(.*)/) ? $1 : $$props[0];
74 | }
75 |
76 | #------------------------------------------------------------------------------
77 | # We found an XMP property name/value
78 | # Inputs: 0) ExifTool object ref, 1) tag table ref
79 | # 2) reference to array of XMP property names (last is current property)
80 | # 3) property value, 4) attribute hash ref (not used here)
81 | # Returns: 1 if valid tag was found
82 | sub FoundTag($$$$;$)
83 | {
84 | my ($et, $tagTablePtr, $props, $val, $attrs) = @_;
85 | return 0 unless @$props;
86 | my $verbose = $et->Options('Verbose');
87 |
88 | $et->VPrint(0, " | - Tag '", join('/',@$props), "'\n") if $verbose > 1;
89 |
90 | # un-escape XML character entities
91 | $val = Image::ExifTool::XMP::UnescapeXML($val);
92 | # convert from UTF8 to ExifTool Charset
93 | $val = $et->Decode($val, 'UTF8');
94 | my $tag = GetTagID($props) or return 0;
95 |
96 | # add any unknown tags to table
97 | unless ($$tagTablePtr{$tag}) {
98 | $et->VPrint(0, " [adding $tag]\n") if $verbose;
99 | AddTagToTable($tagTablePtr, $tag, { Name => ucfirst $tag });
100 | }
101 | # save the tag
102 | $et->HandleTag($tagTablePtr, $tag, $val);
103 |
104 | return 1;
105 | }
106 |
107 | #------------------------------------------------------------------------------
108 | # Extract information from an iWork file
109 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference
110 | # Returns: 1
111 | # Notes: Upon entry to this routine, the file type has already been verified
112 | # as ZIP and the dirInfo hash contains a 'ZIP' Archive::Zip object reference
113 | sub Process_iWork($$)
114 | {
115 | my ($et, $dirInfo) = @_;
116 | my $zip = $$dirInfo{ZIP};
117 | my ($type, $index, $indexFile, $status);
118 |
119 | # try to determine the file type
120 | local $SIG{'__WARN__'} = \&Image::ExifTool::ZIP::WarnProc;
121 | # trust type given by file extension if available
122 | $type = $iWorkType{$$et{FILE_EXT}} if $$et{FILE_EXT};
123 | unless ($type) {
124 | # read the index file
125 | my @members = $zip->membersMatching('^index\.(xml|apxl)$');
126 | if (@members) {
127 | ($index, $status) = $zip->contents($members[0]);
128 | unless ($status) {
129 | $indexFile = $members[0]->fileName();
130 | if ($index =~ /^\s*<\?xml version=[^<]+<(\w+:\w+)/s) {
131 | $type = $iWorkType{$1} if $iWorkType{$1};
132 | }
133 | }
134 | } else {
135 | @members = $zip->membersMatching('(?i)^.*\.(pages|numbers|key)/Index.*');
136 | if (@members) {
137 | my $tmp = $members[0]->fileName();
138 | $type = $iWorkType{uc $1} if $tmp =~ /\.(pages|numbers|key)/i;
139 | }
140 | }
141 | $type or $type = 'ZIP'; # assume ZIP by default
142 | }
143 | $et->SetFileType($type, $mimeType{$type});
144 |
145 | my @members = $zip->members();
146 | my $docNum = 0;
147 | my $member;
148 | foreach $member (@members) {
149 | # get filename of this ZIP member
150 | my $file = $member->fileName();
151 | next unless defined $file;
152 | $et->VPrint(0, "File: $file\n");
153 | # set the document number and extract ZIP tags
154 | $$et{DOC_NUM} = ++$docNum;
155 | Image::ExifTool::ZIP::HandleMember($et, $member);
156 |
157 | # process only the index XML and JPEG thumbnail/preview files
158 | next unless $file =~ m{^(index\.(xml|apxl)|QuickLook/Thumbnail\.jpg|[^/]+/preview.jpg)$}i;
159 | # get the file contents if necessary
160 | # (CAREFUL! $buff MUST be local since we hand off a value ref to PreviewImage)
161 | my ($buff, $buffPt);
162 | if ($indexFile and $indexFile eq $file) {
163 | # use the index file we already loaded
164 | $buffPt = \$index;
165 | } else {
166 | ($buff, $status) = $zip->contents($member);
167 | $status and $et->Warn("Error extracting $file"), next;
168 | $buffPt = \$buff;
169 | }
170 | # extract JPEG as PreviewImage (should only be QuickLook/Thumbnail.jpg)
171 | if ($file =~ /\.jpg$/) {
172 | $et->FoundTag('PreviewImage', $buffPt);
173 | next;
174 | }
175 | # process "metadata" section of XML index file
176 | next unless $$buffPt =~ /<(\w+):metadata>/g;
177 | my $ns = $1;
178 | my $p1 = pos $$buffPt;
179 | next unless $$buffPt =~ m{${ns}:metadata>}g;
180 | # construct XML data from "metadata" section only
181 | $$buffPt = '' . substr($$buffPt, $p1, pos($$buffPt)-$p1);
182 | my %dirInfo = (
183 | DataPt => $buffPt,
184 | DirLen => length $$buffPt,
185 | DataLen => length $$buffPt,
186 | XMPParseOpts => {
187 | FoundProc => \&FoundTag,
188 | },
189 | );
190 | my $tagTablePtr = GetTagTable('Image::ExifTool::iWork::Main');
191 | $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
192 | undef $$buffPt; # (free memory now)
193 | }
194 | delete $$et{DOC_NUM};
195 | return 1;
196 | }
197 |
198 | 1; # end
199 |
200 | __END__
201 |
202 | =head1 NAME
203 |
204 | Image::ExifTool::iWork - Read Apple iWork '09 XML+ZIP files
205 |
206 | =head1 SYNOPSIS
207 |
208 | This module is used by Image::ExifTool
209 |
210 | =head1 DESCRIPTION
211 |
212 | This module contains definitions required by Image::ExifTool to extract meta
213 | information from Apple iWork '09 XML+ZIP files.
214 |
215 | =head1 AUTHOR
216 |
217 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
218 |
219 | This library is free software; you can redistribute it and/or modify it
220 | under the same terms as Perl itself.
221 |
222 | =head1 SEE ALSO
223 |
224 | L,
225 | L,
226 | L
227 |
228 | =cut
229 |
230 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/CaptureOne.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: CaptureOne.pm
3 | #
4 | # Description: Read Capture One EIP and COS files
5 | #
6 | # Revisions: 2009/11/01 - P. Harvey Created
7 | #
8 | # Notes: The EIP format is a ZIP file containing an image (IIQ or TIFF)
9 | # and some settings files (COS). COS files are XML based.
10 | #------------------------------------------------------------------------------
11 |
12 | package Image::ExifTool::CaptureOne;
13 |
14 | use strict;
15 | use vars qw($VERSION);
16 | use Image::ExifTool qw(:DataAccess :Utils);
17 | use Image::ExifTool::XMP;
18 | use Image::ExifTool::ZIP;
19 |
20 | $VERSION = '1.04';
21 |
22 | # CaptureOne COS XML tags
23 | # - tags are added dynamically when encountered
24 | # - this table is not listed in tag name docs
25 | %Image::ExifTool::CaptureOne::Main = (
26 | GROUPS => { 0 => 'XML', 1 => 'XML', 2 => 'Image' },
27 | PROCESS_PROC => \&Image::ExifTool::XMP::ProcessXMP,
28 | VARS => { NO_ID => 1 },
29 | ColorCorrections => { ValueConv => '\$val' }, # (long list of floating point numbers)
30 | );
31 |
32 | #------------------------------------------------------------------------------
33 | # We found an XMP property name/value
34 | # Inputs: 0) attribute list ref, 1) attr hash ref,
35 | # 2) property name ref, 3) property value ref
36 | # Returns: true if value was changed
37 | sub HandleCOSAttrs($$$$)
38 | {
39 | my ($attrList, $attrs, $prop, $valPt) = @_;
40 | my $changed;
41 | if (not length $$valPt and defined $$attrs{K} and defined $$attrs{V}) {
42 | $$prop = $$attrs{K};
43 | $$valPt = $$attrs{V};
44 | # remove these attributes from the list
45 | my @attrs = @$attrList;
46 | @$attrList = ( );
47 | my $a;
48 | foreach $a (@attrs) {
49 | if ($a eq 'K' or $a eq 'V') {
50 | delete $$attrs{$a};
51 | } else {
52 | push @$attrList, $a;
53 | }
54 | }
55 | $changed = 1;
56 | }
57 | return $changed;
58 | }
59 |
60 | #------------------------------------------------------------------------------
61 | # We found a COS property name/value
62 | # Inputs: 0) ExifTool object ref, 1) tag table ref
63 | # 2) reference to array of XMP property names (last is current property)
64 | # 3) property value, 4) attribute hash ref (not used here)
65 | # Returns: 1 if valid tag was found
66 | sub FoundCOS($$$$;$)
67 | {
68 | my ($et, $tagTablePtr, $props, $val, $attrs) = @_;
69 |
70 | my $tag = $$props[-1];
71 | unless ($$tagTablePtr{$tag}) {
72 | $et->VPrint(0, " | [adding $tag]\n");
73 | my $name = ucfirst $tag;
74 | $name =~ tr/-_a-zA-Z0-9//dc;
75 | return 0 unless length $tag;
76 | my %tagInfo = ( Name => $tag );
77 | # try formatting any tag with "Date" in the name as a date
78 | # (shouldn't affect non-date tags)
79 | if ($name =~ /Date(?![a-z])/) {
80 | $tagInfo{Groups} = { 2 => 'Time' };
81 | $tagInfo{ValueConv} = 'Image::ExifTool::XMP::ConvertXMPDate($val,1)';
82 | $tagInfo{PrintConv} = '$self->ConvertDateTime($val)';
83 | }
84 | AddTagToTable($tagTablePtr, $tag, \%tagInfo);
85 | }
86 | # convert from UTF8 to ExifTool Charset
87 | $val = $et->Decode($val, "UTF8");
88 | # un-escape XML character entities
89 | $val = Image::ExifTool::XMP::UnescapeXML($val);
90 | $et->HandleTag($tagTablePtr, $tag, $val);
91 | return 0;
92 | }
93 |
94 | #------------------------------------------------------------------------------
95 | # Extract information from a COS file
96 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference
97 | # Returns: 1 on success, 0 if this wasn't a valid XML file
98 | sub ProcessCOS($$)
99 | {
100 | my ($et, $dirInfo) = @_;
101 |
102 | # process using XMP module, but override handling of attributes and tags
103 | $$dirInfo{XMPParseOpts} = {
104 | AttrProc => \&HandleCOSAttrs,
105 | FoundProc => \&FoundCOS,
106 | };
107 | my $tagTablePtr = GetTagTable('Image::ExifTool::CaptureOne::Main');
108 | my $success = $et->ProcessDirectory($dirInfo, $tagTablePtr);
109 | delete $$dirInfo{XMLParseArgs};
110 | return $success;
111 | }
112 |
113 | #------------------------------------------------------------------------------
114 | # Extract information from a CaptureOne EIP file
115 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference
116 | # Returns: 1
117 | # Notes: Upon entry to this routine, the file type has already been verified
118 | # and the dirInfo hash contains a ZIP element unique to this process proc:
119 | # ZIP - reference to Archive::Zip object for this file
120 | sub ProcessEIP($$)
121 | {
122 | my ($et, $dirInfo) = @_;
123 | my $zip = $$dirInfo{ZIP};
124 | my ($file, $buff, $status, $member, %parseFile);
125 |
126 | $et->SetFileType('EIP');
127 |
128 | # must catch all Archive::Zip warnings
129 | local $SIG{'__WARN__'} = \&Image::ExifTool::ZIP::WarnProc;
130 | # find all manifest files
131 | my @members = $zip->membersMatching('^manifest\d*.xml$');
132 | # and choose the one with the highest version number (any better ideas?)
133 | while (@members) {
134 | my $m = shift @members;
135 | my $f = $m->fileName();
136 | next if $file and $file gt $f;
137 | $member = $m;
138 | $file = $f;
139 | }
140 | # get file names from our chosen manifest file
141 | if ($member) {
142 | ($buff, $status) = $zip->contents($member);
143 | if (not $status) {
144 | my $foundImage;
145 | while ($buff =~ m{<(RawPath|SettingsPath)>(.*?)\1>}sg) {
146 | $file = $2;
147 | next unless $file =~ /\.(cos|iiq|jpe?g|tiff?)$/i;
148 | $parseFile{$file} = 1; # set flag to parse this file
149 | $foundImage = 1 unless $file =~ /\.cos$/i;
150 | }
151 | # ignore manifest unless it contained a valid image
152 | undef %parseFile unless $foundImage;
153 | }
154 | }
155 | # extract meta information from embedded files
156 | my $docNum = 0;
157 | @members = $zip->members(); # get all members
158 | foreach $member (@members) {
159 | # get filename of this ZIP member
160 | $file = $member->fileName();
161 | next unless defined $file;
162 | $et->VPrint(0, "File: $file\n");
163 | # set the document number and extract ZIP tags
164 | $$et{DOC_NUM} = ++$docNum;
165 | Image::ExifTool::ZIP::HandleMember($et, $member);
166 | if (%parseFile) {
167 | next unless $parseFile{$file};
168 | } else {
169 | # reading the manifest didn't work, so look for image files in the
170 | # root directory and .cos files in the CaptureOne directory
171 | next unless $file =~ m{^([^/]+\.(iiq|jpe?g|tiff?)|CaptureOne/.*\.cos)$}i;
172 | }
173 | # extract the contents of the file
174 | # Note: this could use a LOT of memory here for RAW images...
175 | ($buff, $status) = $zip->contents($member);
176 | $status and $et->Warn("Error extracting $file"), next;
177 | if ($file =~ /\.cos$/i) {
178 | # process Capture One Settings files
179 | my %dirInfo = (
180 | DataPt => \$buff,
181 | DirLen => length $buff,
182 | DataLen => length $buff,
183 | );
184 | ProcessCOS($et, \%dirInfo);
185 | } else {
186 | # set HtmlDump error if necessary because it doesn't work with embedded files
187 | if ($$et{HTML_DUMP}) {
188 | $$et{HTML_DUMP}{Error} = "Sorry, can't dump images embedded in ZIP files";
189 | }
190 | # process IIQ, JPEG and TIFF images
191 | $et->ExtractInfo(\$buff, { ReEntry => 1 });
192 | }
193 | undef $buff; # (free memory now)
194 | }
195 | delete $$et{DOC_NUM};
196 | return 1;
197 | }
198 |
199 | 1; # end
200 |
201 | __END__
202 |
203 | =head1 NAME
204 |
205 | Image::ExifTool::CaptureOne - Read Capture One EIP and COS files
206 |
207 | =head1 SYNOPSIS
208 |
209 | This module is used by Image::ExifTool
210 |
211 | =head1 DESCRIPTION
212 |
213 | This module contains definitions required by Image::ExifTool to extract meta
214 | information from Capture One EIP (Enhanced Image Package) and COS (Capture
215 | One Settings) files.
216 |
217 | =head1 NOTES
218 |
219 | The EIP format is a ZIP file containing an image (IIQ or TIFF) and some
220 | settings files (COS).
221 |
222 | =head1 AUTHOR
223 |
224 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
225 |
226 | This library is free software; you can redistribute it and/or modify it
227 | under the same terms as Perl itself.
228 |
229 | =head1 SEE ALSO
230 |
231 | L,
232 | L
233 |
234 | =cut
235 |
236 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/FotoStation.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: FotoStation.pm
3 | #
4 | # Description: Read/write FotoWare FotoStation trailer
5 | #
6 | # Revisions: 10/28/2006 - P. Harvey Created
7 | #------------------------------------------------------------------------------
8 |
9 | package Image::ExifTool::FotoStation;
10 |
11 | use strict;
12 | use vars qw($VERSION);
13 | use Image::ExifTool qw(:DataAccess :Utils);
14 |
15 | $VERSION = '1.04';
16 |
17 | sub ProcessFotoStation($$);
18 |
19 | %Image::ExifTool::FotoStation::Main = (
20 | PROCESS_PROC => \&ProcessFotoStation,
21 | WRITE_PROC => \&ProcessFotoStation,
22 | GROUPS => { 2 => 'Image' },
23 | NOTES => q{
24 | The following tables define information found in the FotoWare FotoStation
25 | trailer.
26 | },
27 | 0x01 => {
28 | Name => 'IPTC',
29 | SubDirectory => {
30 | TagTable => 'Image::ExifTool::IPTC::Main',
31 | },
32 | },
33 | 0x02 => {
34 | Name => 'SoftEdit',
35 | SubDirectory => {
36 | TagTable => 'Image::ExifTool::FotoStation::SoftEdit',
37 | },
38 | },
39 | 0x03 => {
40 | Name => 'ThumbnailImage',
41 | Groups => { 2 => 'Preview' },
42 | Writable => 1,
43 | RawConv => '$self->ValidateImage(\$val,$tag)',
44 | },
45 | 0x04 => {
46 | Name => 'PreviewImage',
47 | Groups => { 2 => 'Preview' },
48 | Writable => 1,
49 | RawConv => '$self->ValidateImage(\$val,$tag)',
50 | },
51 | );
52 |
53 | # crop coordinate conversions
54 | my %cropConv = (
55 | ValueConv => '$val / 1000',
56 | ValueConvInv => '$val * 1000',
57 | PrintConv => '"$val%"',
58 | PrintConvInv => '$val=~tr/ %//d; $val',
59 | );
60 |
61 | # soft crop record
62 | %Image::ExifTool::FotoStation::SoftEdit = (
63 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
64 | WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
65 | CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
66 | WRITABLE => 1,
67 | FORMAT => 'int32s',
68 | FIRST_ENTRY => 0,
69 | GROUPS => { 2 => 'Image' },
70 | 0 => {
71 | Name => 'OriginalImageWidth',
72 | },
73 | 1 => 'OriginalImageHeight',
74 | 2 => 'ColorPlanes',
75 | 3 => {
76 | Name => 'XYResolution',
77 | ValueConv => '$val / 1000',
78 | ValueConvInv => '$val * 1000',
79 | },
80 | 4 => {
81 | Name => 'Rotation',
82 | Notes => q{
83 | rotations are stored as degrees CCW * 100, but converted to degrees CW by
84 | ExifTool
85 | },
86 | # raw value is 0, 9000, 18000 or 27000
87 | ValueConv => '$val ? 360 - $val / 100 : 0',
88 | ValueConvInv => '$val ? (360 - $val) * 100 : 0',
89 | },
90 | # 5 Validity Check (0x11222211)
91 | 6 => {
92 | Name => 'CropLeft',
93 | %cropConv,
94 | },
95 | 7 => {
96 | Name => 'CropTop',
97 | %cropConv,
98 | },
99 | 8 => {
100 | Name => 'CropRight',
101 | %cropConv,
102 | },
103 | 9 => {
104 | Name => 'CropBottom',
105 | %cropConv,
106 | },
107 | 11 => {
108 | Name => 'CropRotation',
109 | # raw value in the range -4500 to 4500
110 | ValueConv => '-$val / 100',
111 | ValueConvInv => '-$val * 100',
112 | },
113 | );
114 |
115 | #------------------------------------------------------------------------------
116 | # Read/write FotoStation information in a file
117 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference
118 | # Returns: 1 on success, 0 if this file didn't contain FotoStation information
119 | # - updates DataPos to point to start of FotoStation information
120 | # - updates DirLen to trailer length
121 | sub ProcessFotoStation($$)
122 | {
123 | my ($et, $dirInfo) = @_;
124 | $et or return 1; # allow dummy access to autoload this package
125 | my ($buff, $footer, $dirBuff, $tagTablePtr);
126 | my $raf = $$dirInfo{RAF};
127 | my $outfile = $$dirInfo{OutFile};
128 | my $offset = $$dirInfo{Offset} || 0;
129 | my $verbose = $et->Options('Verbose');
130 | my $out = $et->Options('TextOut');
131 | my $rtnVal = 0;
132 |
133 | $$dirInfo{DirLen} = 0; # initialize returned trailer length
134 | $raf->Seek(-$offset, 2); # seek to specified offset from end of file
135 |
136 | # loop through FotoStation records
137 | for (;;) {
138 | # look for trailer signature
139 | last unless $raf->Seek(-10, 1) and $raf->Read($footer, 10) == 10;
140 | my ($tag, $size, $sig) = unpack('nNN', $footer);
141 | last unless $sig == 0xa1b2c3d4 and $size >= 10 and $raf->Seek(-$size, 1);
142 | $size -= 10; # size of data only
143 | last unless $raf->Read($buff, $size) == $size;
144 | $raf->Seek(-$size, 1);
145 | # set variables returned in dirInfo hash
146 | $$dirInfo{DataPos} = $raf->Tell();
147 | $$dirInfo{DirLen} += $size + 10;
148 |
149 | unless ($tagTablePtr) {
150 | $tagTablePtr = GetTagTable('Image::ExifTool::FotoStation::Main');
151 | SetByteOrder('MM'); # necessary for the binary data
152 | $rtnVal = 1; # we found a valid FotoStation trailer
153 | }
154 | unless ($outfile) {
155 | # print verbose trailer information
156 | if ($verbose or $$et{HTML_DUMP}) {
157 | $et->DumpTrailer({
158 | RAF => $raf,
159 | DataPos => $$dirInfo{DataPos},
160 | DirLen => $size + 10,
161 | DirName => "FotoStation_$tag",
162 | });
163 | }
164 | # extract information for this tag
165 | $et->HandleTag($tagTablePtr, $tag, $buff,
166 | DataPt => \$buff,
167 | Start => 0,
168 | Size => $size,
169 | DataPos => $$dirInfo{DataPos},
170 | );
171 | next;
172 | }
173 | if ($$et{DEL_GROUP}{FotoStation}) {
174 | $verbose and print $out " Deleting FotoStation trailer\n";
175 | $verbose = 0; # no more verbose messages after this
176 | ++$$et{CHANGED};
177 | next;
178 | }
179 | # rewrite this information
180 | my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag);
181 | if ($tagInfo) {
182 | my $newVal;
183 | my $tagName = $$tagInfo{Name};
184 | if ($$tagInfo{SubDirectory}) {
185 | my %subdirInfo = (
186 | DataPt => \$buff,
187 | DirStart => 0,
188 | DirLen => $size,
189 | DataPos => $$dirInfo{DataPos},
190 | DirName => $tagName,
191 | Parent => 'FotoStation',
192 | );
193 | my $subTable = GetTagTable($tagInfo->{SubDirectory}->{TagTable});
194 | $newVal = $et->WriteDirectory(\%subdirInfo, $subTable);
195 | } else {
196 | my $nvHash = $et->GetNewValueHash($tagInfo);
197 | if ($et->IsOverwriting($nvHash) > 0) {
198 | $newVal = $et->GetNewValue($nvHash);
199 | $newVal = '' unless defined $newVal;
200 | if ($verbose > 1) {
201 | my $n = length $newVal;
202 | print $out " - FotoStation:$tagName ($size bytes)\n" if $size;
203 | print $out " + FotoStation:$tagName ($n bytes)\n" if $n;
204 | }
205 | ++$$et{CHANGED};
206 | }
207 | }
208 | if (defined $newVal) {
209 | # note: length may be 0 here, but we write the empty record anyway
210 | $buff = $newVal;
211 | $size = length($newVal) + 10;
212 | $footer = pack('nNN', $tag, $size, $sig);
213 | }
214 | }
215 | if (defined $dirBuff) {
216 | # maintain original record order
217 | $dirBuff = $buff . $footer . $dirBuff;
218 | } else {
219 | $dirBuff = $buff . $footer;
220 | }
221 | }
222 | # write the modified FotoStation trailer
223 | Write($outfile, $dirBuff) or $rtnVal = -1 if $dirBuff;
224 | return $rtnVal;
225 | }
226 |
227 | 1; # end
228 |
229 | __END__
230 |
231 | =head1 NAME
232 |
233 | Image::ExifTool::FotoStation - Read/write FotoWare FotoStation trailer
234 |
235 | =head1 SYNOPSIS
236 |
237 | This module is used by Image::ExifTool
238 |
239 | =head1 DESCRIPTION
240 |
241 | This module contains definitions required by Image::ExifTool to read and
242 | write information from the FotoWare FotoStation trailer.
243 |
244 | =head1 AUTHOR
245 |
246 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
247 |
248 | This library is free software; you can redistribute it and/or modify it
249 | under the same terms as Perl itself.
250 |
251 | =head1 ACKNOWLEDGEMENTS
252 |
253 | Thanks to Mark Tate for information about the FotoStation data format.
254 |
255 | =head1 SEE ALSO
256 |
257 | L,
258 | L
259 |
260 | =cut
261 |
262 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/HP.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: HP.pm
3 | #
4 | # Description: Hewlett-Packard maker notes tags
5 | #
6 | # Revisions: 2007-05-03 - P. Harvey Created
7 | #------------------------------------------------------------------------------
8 |
9 | package Image::ExifTool::HP;
10 |
11 | use strict;
12 | use vars qw($VERSION);
13 | use Image::ExifTool qw(:DataAccess :Utils);
14 |
15 | $VERSION = '1.04';
16 |
17 | sub ProcessHP($$$);
18 | sub ProcessTDHD($$$);
19 |
20 | # HP EXIF-format maker notes (or is it Vivitar?)
21 | %Image::ExifTool::HP::Main = (
22 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
23 | NOTES => q{
24 | These tables list tags found in the maker notes of some Hewlett-Packard
25 | camera models.
26 |
27 | The first table lists tags found in the EXIF-format maker notes of the
28 | PhotoSmart 720 (also used by the Vivitar ViviCam 3705, 3705B and 3715).
29 | },
30 | 0x0e00 => {
31 | Name => 'PrintIM',
32 | Description => 'Print Image Matching',
33 | SubDirectory => {
34 | TagTable => 'Image::ExifTool::PrintIM::Main',
35 | },
36 | },
37 | );
38 |
39 | # other types of HP maker notes
40 | %Image::ExifTool::HP::Type2 = (
41 | PROCESS_PROC => \&ProcessHP,
42 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
43 | NOTES => 'These tags are used by the PhotoSmart E427.',
44 | 'PreviewImage' => {
45 | Name => 'PreviewImage',
46 | Groups => { 2 => 'Preview' },
47 | RawConv => '$self->ValidateImage(\$val,$tag)',
48 | },
49 | 'Serial Number' => 'SerialNumber',
50 | 'Lens Shading' => 'LensShading',
51 | );
52 |
53 | %Image::ExifTool::HP::Type4 = (
54 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
55 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
56 | NOTES => 'These tags are used by the PhotoSmart M627.',
57 | 0x0c => {
58 | Name => 'MaxAperture',
59 | Format => 'int16u',
60 | ValueConv => '$val / 10',
61 | },
62 | 0x10 => {
63 | Name => 'ExposureTime',
64 | Format => 'int32u',
65 | ValueConv => '$val / 1e6',
66 | PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
67 | },
68 | 0x14 => {
69 | Name => 'CameraDateTime',
70 | Groups => { 2 => 'Time' },
71 | Format => 'string[20]',
72 | },
73 | 0x34 => {
74 | Name => 'ISO',
75 | Format => 'int16u',
76 | },
77 | 0x5c => {
78 | Name => 'SerialNumber',
79 | Format => 'string[26]',
80 | RawConv => '$val =~ s/^SERIAL NUMBER:// ? $val : undef',
81 | },
82 | );
83 |
84 | %Image::ExifTool::HP::Type6 = (
85 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
86 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
87 | NOTES => 'These tags are used by the PhotoSmart M425, M525 and M527.',
88 | 0x0c => {
89 | Name => 'FNumber',
90 | Format => 'int16u',
91 | ValueConv => '$val / 10',
92 | },
93 | 0x10 => {
94 | Name => 'ExposureTime',
95 | Format => 'int32u',
96 | ValueConv => '$val / 1e6',
97 | PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
98 | },
99 | 0x14 => {
100 | Name => 'CameraDateTime',
101 | Groups => { 2 => 'Time' },
102 | Format => 'string[20]',
103 | },
104 | 0x34 => {
105 | Name => 'ISO',
106 | Format => 'int16u',
107 | },
108 | 0x58 => {
109 | Name => 'SerialNumber',
110 | Format => 'string[26]',
111 | RawConv => '$val =~ s/^SERIAL NUMBER:// ? $val : undef',
112 | },
113 | );
114 |
115 | # proprietary format TDHD data written by Photosmart R837 (ref PH)
116 | %Image::ExifTool::HP::TDHD = (
117 | PROCESS_PROC => \&ProcessTDHD,
118 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
119 | NOTES => q{
120 | These tags are extracted from the APP6 "TDHD" segment of Photosmart R837
121 | JPEG images. Many other unknown tags exist in is data, and can be seen with
122 | the Unknown (-u) option.
123 | },
124 | # (all subdirectories except TDHD and LSLV are automatically recognized
125 | # by their "type" word of 0x10001)
126 | TDHD => {
127 | Name => 'TDHD',
128 | SubDirectory => { TagTable => 'Image::ExifTool::HP::TDHD' },
129 | },
130 | LSLV => {
131 | Name => 'LSLV',
132 | SubDirectory => { TagTable => 'Image::ExifTool::HP::TDHD' },
133 | },
134 | FWRV => 'FirmwareVersion',
135 | CMSN => 'SerialNumber', # (unverified)
136 | # LTEM - some temperature?
137 | );
138 |
139 | #------------------------------------------------------------------------------
140 | # Process HP APP6 TDHD metadata (ref PH)
141 | # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
142 | # Returns: 1 on success
143 | sub ProcessTDHD($$$)
144 | {
145 | my ($et, $dirInfo, $tagTablePtr) = @_;
146 | my $dataPt = $$dirInfo{DataPt};
147 | my $dataPos = $$dirInfo{DataPos};
148 | my $pos = $$dirInfo{DirStart};
149 | my $dirEnd = $pos + $$dirInfo{DirLen};
150 | my $unknown = $et->Options('Unknown') || $et->Options('Verbose');
151 | $et->VerboseDir('TDHD', undef, $$dirInfo{DirLen});
152 | SetByteOrder('II');
153 | while ($pos + 12 < $dirEnd) {
154 | my $tag = substr($$dataPt, $pos, 4);
155 | my $type = Get32u($dataPt, $pos + 4);
156 | my $size = Get32u($dataPt, $pos + 8);
157 | $pos += 12;
158 | last if $size < 0 or $pos + $size > $dirEnd;
159 | if ($type == 0x10001) {
160 | # this is a subdirectory containing more tags
161 | my %dirInfo = (
162 | DataPt => $dataPt,
163 | DataPos => $dataPos,
164 | DirStart => $pos,
165 | DirLen => $size,
166 | );
167 | $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
168 | } else {
169 | if (not $$tagTablePtr{$tag} and $unknown) {
170 | my $name = $tag;
171 | $name =~ tr/-_A-Za-z0-9//dc; # remove invalid characters
172 | my %tagInfo = (
173 | Name => "HP_TDHD_$name",
174 | Unknown => 1,
175 | );
176 | # guess format based on data size
177 | if ($size == 1) {
178 | $tagInfo{Format} = 'int8u';
179 | } elsif ($size == 2) {
180 | $tagInfo{Format} = 'int16u';
181 | } elsif ($size == 4) {
182 | $tagInfo{Format} = 'int32s';
183 | } elsif ($size > 80) {
184 | $tagInfo{Binary} = 1;
185 | }
186 | AddTagToTable($tagTablePtr, $tag, \%tagInfo);
187 | }
188 | $et->HandleTag($tagTablePtr, $tag, undef,
189 | DataPt => $dataPt,
190 | DataPos => $dataPos,
191 | Start => $pos,
192 | Size => $size,
193 | );
194 | }
195 | $pos += $size;
196 | }
197 | return 1;
198 | }
199 |
200 | #------------------------------------------------------------------------------
201 | # Process HP maker notes
202 | # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
203 | # Returns: 1 on success, otherwise returns 0 and sets a Warning
204 | sub ProcessHP($$$)
205 | {
206 | my ($et, $dirInfo, $tagTablePtr) = @_;
207 | my $dataPt = $$dirInfo{DataPt};
208 | my $dataLen = $$dirInfo{DataLen};
209 | my $dirStart = $$dirInfo{DirStart} || 0;
210 | my $dirLen = $$dirInfo{DirLen} || $dataLen - $dirStart;
211 |
212 | # look for known text-type tags
213 | if ($dirStart or $dirLen != length($$dataPt)) {
214 | my $buff = substr($$dataPt, $dirStart, $dirLen);
215 | $dataPt = \$buff;
216 | }
217 | my $tagID;
218 | # brute-force scan for PreviewImage
219 | if ($$tagTablePtr{PreviewImage} and $$dataPt =~ /(\xff\xd8\xff\xdb.*\xff\xd9)/gs) {
220 | $et->HandleTag($tagTablePtr, 'PreviewImage', $1);
221 | # truncate preview to speed subsequent tag scans
222 | my $buff = substr($$dataPt, 0, pos($$dataPt)-length($1));
223 | $dataPt = \$buff;
224 | }
225 | # scan for other tag ID's
226 | foreach $tagID (sort(TagTableKeys($tagTablePtr))) {
227 | next if $tagID eq 'PreviewImage';
228 | next unless $$dataPt =~ /$tagID:\s*([\x20-\x7f]+)/i;
229 | $et->HandleTag($tagTablePtr, $tagID, $1);
230 | }
231 | return 1;
232 | }
233 |
234 | 1; # end
235 |
236 | __END__
237 |
238 | =head1 NAME
239 |
240 | Image::ExifTool::HP - Hewlett-Packard maker notes tags
241 |
242 | =head1 SYNOPSIS
243 |
244 | This module is loaded automatically by Image::ExifTool when required.
245 |
246 | =head1 DESCRIPTION
247 |
248 | This module contains definitions required by Image::ExifTool to interpret
249 | Hewlett-Packard maker notes.
250 |
251 | =head1 AUTHOR
252 |
253 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
254 |
255 | This library is free software; you can redistribute it and/or modify it
256 | under the same terms as Perl itself.
257 |
258 | =head1 SEE ALSO
259 |
260 | L,
261 | L
262 |
263 | =cut
264 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/PhotoMechanic.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: PhotoMechanic.pm
3 | #
4 | # Description: Read/write Camera Bits Photo Mechanic information
5 | #
6 | # Revisions: 10/28/2006 - P. Harvey Created
7 | #------------------------------------------------------------------------------
8 |
9 | package Image::ExifTool::PhotoMechanic;
10 |
11 | use strict;
12 | use vars qw($VERSION);
13 | use Image::ExifTool qw(:DataAccess :Utils);
14 | use Image::ExifTool::Exif;
15 | use Image::ExifTool::IPTC;
16 | use Image::ExifTool::XMP;
17 |
18 | $VERSION = '1.05';
19 |
20 | sub ProcessPhotoMechanic($$);
21 |
22 | # color class names
23 | my %colorClasses = (
24 | 0 => '0 (None)',
25 | 1 => '1 (Winner)',
26 | 2 => '2 (Winner alt)',
27 | 3 => '3 (Superior)',
28 | 4 => '4 (Superior alt)',
29 | 5 => '5 (Typical)',
30 | 6 => '6 (Typical alt)',
31 | 7 => '7 (Extras)',
32 | 8 => '8 (Trash)',
33 | );
34 |
35 | # main tag table IPTC-format records in PhotoMechanic trailer
36 | %Image::ExifTool::PhotoMechanic::Main = (
37 | GROUPS => { 2 => 'Image' },
38 | PROCESS_PROC => \&Image::ExifTool::IPTC::ProcessIPTC,
39 | WRITE_PROC => \&Image::ExifTool::IPTC::WriteIPTC,
40 | NOTES => q{
41 | The Photo Mechanic trailer contains data in an IPTC-format structure, with
42 | soft edit information stored under record number 2.
43 | },
44 | 2 => {
45 | Name => 'SoftEdit',
46 | SubDirectory => {
47 | TagTable => 'Image::ExifTool::PhotoMechanic::SoftEdit',
48 | },
49 | },
50 | );
51 |
52 | # raw/preview crop coordinate conversions
53 | my %rawCropConv = (
54 | ValueConv => '$val / 655.36',
55 | ValueConvInv => 'int($val * 655.36 + 0.5)',
56 | PrintConv => 'sprintf("%.3f%%",$val)',
57 | PrintConvInv => '$val=~tr/ %//d; $val',
58 | );
59 |
60 | # Record 2 -- PhotoMechanic soft edit information
61 | %Image::ExifTool::PhotoMechanic::SoftEdit = (
62 | GROUPS => { 2 => 'Image' },
63 | WRITE_PROC => \&Image::ExifTool::IPTC::WriteIPTC,
64 | CHECK_PROC => \&Image::ExifTool::IPTC::CheckIPTC,
65 | WRITABLE => 1,
66 | FORMAT => 'int32s',
67 | 209 => { Name => 'RawCropLeft', %rawCropConv },
68 | 210 => { Name => 'RawCropTop', %rawCropConv },
69 | 211 => { Name => 'RawCropRight', %rawCropConv },
70 | 212 => { Name => 'RawCropBottom', %rawCropConv },
71 | 213 => 'ConstrainedCropWidth',
72 | 214 => 'ConstrainedCropHeight',
73 | 215 => 'FrameNum',
74 | 216 => {
75 | Name => 'Rotation',
76 | PrintConv => {
77 | 0 => '0',
78 | 1 => '90',
79 | 2 => '180',
80 | 3 => '270',
81 | },
82 | },
83 | 217 => 'CropLeft',
84 | 218 => 'CropTop',
85 | 219 => 'CropRight',
86 | 220 => 'CropBottom',
87 | 221 => {
88 | Name => 'Tagged',
89 | PrintConv => { 0 => 'No', 1 => 'Yes' },
90 | },
91 | 222 => {
92 | Name => 'ColorClass',
93 | PrintConv => \%colorClasses,
94 | },
95 | 223 => 'Rating',
96 | 236 => { Name => 'PreviewCropLeft', %rawCropConv },
97 | 237 => { Name => 'PreviewCropTop', %rawCropConv },
98 | 238 => { Name => 'PreviewCropRight', %rawCropConv },
99 | 239 => { Name => 'PreviewCropBottom', %rawCropConv },
100 | );
101 |
102 | # PhotoMechanic XMP properties
103 | %Image::ExifTool::PhotoMechanic::XMP = (
104 | GROUPS => { 0 => 'XMP', 1 => 'XMP-photomech', 2 => 'Image' },
105 | NAMESPACE => { photomechanic => 'http://ns.camerabits.com/photomechanic/1.0/' },
106 | WRITE_PROC => \&Image::ExifTool::XMP::WriteXMP,
107 | WRITABLE => 'string',
108 | NOTES => q{
109 | Below is a list of the observed PhotoMechanic XMP tags. The actual
110 | namespace prefix is "photomechanic" but ExifTool shortens this in
111 | the family 1 group name.
112 | },
113 | ColorClass => {
114 | Writable => 'integer',
115 | PrintConv => \%colorClasses,
116 | },
117 | CountryCode => { Avoid => 1, Groups => { 2 => 'Location' } },
118 | EditStatus => { },
119 | PMVersion => { },
120 | Prefs => {
121 | Notes => 'format is "Tagged:0, ColorClass:1, Rating:2, FrameNum:3"',
122 | PrintConv => q{
123 | $val =~ s[\s*(\d+):\s*(\d+):\s*(\d+):\s*(\S*)]
124 | [Tagged:$1, ColorClass:$2, Rating:$3, FrameNum:$4];
125 | return $val;
126 | },
127 | PrintConvInv => q{
128 | $val =~ s[Tagged:\s*(\d+).*ColorClass:\s*(\d+).*Rating:\s*(\d+).*FrameNum:\s*(\S*)]
129 | [$1:$2:$3:$4]is;
130 | return $val;
131 | },
132 | },
133 | Tagged => { Writable => 'boolean', PrintConv => { False => 'No', True => 'Yes' } },
134 | TimeCreated => {
135 | Avoid => 1,
136 | Groups => { 2 => 'Time' },
137 | Shift => 'Time',
138 | ValueConv => 'Image::ExifTool::Exif::ExifTime($val)',
139 | ValueConvInv => 'Image::ExifTool::IPTC::IptcTime($val)',
140 | },
141 | );
142 |
143 | #------------------------------------------------------------------------------
144 | # Read/write PhotoMechanic information in a file
145 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference
146 | # Returns: 1 on success, 0 if this file didn't contain PhotoMechanic information
147 | # - updates DataPos to point to start of PhotoMechanic information
148 | # - updates DirLen to trailer length
149 | sub ProcessPhotoMechanic($$)
150 | {
151 | my ($et, $dirInfo) = @_;
152 | my $raf = $$dirInfo{RAF};
153 | my $offset = $$dirInfo{Offset} || 0;
154 | my $outfile = $$dirInfo{OutFile};
155 | my $verbose = $et->Options('Verbose');
156 | my $out = $et->Options('TextOut');
157 | my $rtnVal = 0;
158 | my ($buff, $footer);
159 |
160 | for (;;) {
161 | # read and validate trailer footer (last 12 bytes)
162 | last unless $raf->Seek(-12-$offset, 2) and $raf->Read($footer, 12) == 12;
163 | last unless $footer =~ /cbipcbbl$/;
164 | my $size = unpack('N', $footer);
165 |
166 | if ($size & 0x80000000 or not $raf->Seek(-$size-12, 1)) {
167 | $et->Warn('Bad PhotoMechanic trailer');
168 | last;
169 | }
170 | unless ($raf->Read($buff, $size) == $size) {
171 | $et->Warn('Error reading PhotoMechanic trailer');
172 | last;
173 | }
174 | $rtnVal = 1; # we read the trailer successfully
175 |
176 | # set variables returned in dirInfo hash
177 | $$dirInfo{DataPos} = $raf->Tell() - $size;
178 | $$dirInfo{DirLen} = $size + 12;
179 |
180 | my %dirInfo = (
181 | DataPt => \$buff,
182 | DataPos => $$dirInfo{DataPos},
183 | DirStart => 0,
184 | DirLen => $size,
185 | Parent => 'PhotoMechanic',
186 | );
187 | my $tagTablePtr = GetTagTable('Image::ExifTool::PhotoMechanic::Main');
188 | if (not $outfile) {
189 | # extract trailer information
190 | $et->DumpTrailer($dirInfo) if $verbose or $$et{HTML_DUMP};
191 | $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
192 | } elsif ($$et{DEL_GROUP}{PhotoMechanic}) {
193 | # delete the trailer
194 | $verbose and print $out " Deleting PhotoMechanic trailer\n";
195 | ++$$et{CHANGED};
196 | } else {
197 | # rewrite the trailer
198 | my $newPt;
199 | my $newBuff = $et->WriteDirectory(\%dirInfo, $tagTablePtr);
200 | if (defined $newBuff) {
201 | $newPt = \$newBuff; # write out the modified trailer
202 | my $pad = 0x800 - length($newBuff);
203 | if ($pad > 0 and not $et->Options('Compact')) {
204 | # pad out to 2kB like PhotoMechanic does
205 | $newBuff .= "\0" x $pad;
206 | }
207 | # generate new footer
208 | $footer = pack('N', length($$newPt)) . 'cbipcbbl';
209 | } else {
210 | $newPt = \$buff; # just copy existing trailer
211 | }
212 | # write out the trailer
213 | Write($outfile, $$newPt, $footer) or $rtnVal = -1;
214 | }
215 | last;
216 | }
217 | return $rtnVal;
218 | }
219 |
220 | 1; # end
221 |
222 | __END__
223 |
224 | =head1 NAME
225 |
226 | Image::ExifTool::PhotoMechanic - Read/write Photo Mechanic information
227 |
228 | =head1 SYNOPSIS
229 |
230 | This module is used by Image::ExifTool
231 |
232 | =head1 DESCRIPTION
233 |
234 | This module contains definitions required by Image::ExifTool to read and
235 | write information written by the Camera Bits Photo Mechanic software.
236 |
237 | =head1 AUTHOR
238 |
239 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
240 |
241 | This library is free software; you can redistribute it and/or modify it
242 | under the same terms as Perl itself.
243 |
244 | =head1 ACKNOWLEDGEMENTS
245 |
246 | Many thanks to the great support provided by Camera Bits, and in particular
247 | for the valuable exchanges with Kirk Baker. Based on this experience, I can
248 | say that the technical support offered by Camera Bits is second to none.
249 |
250 | =head1 SEE ALSO
251 |
252 | L,
253 | L
254 |
255 | =cut
256 |
257 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/Vorbis.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: Vorbis.pm
3 | #
4 | # Description: Read Ogg Vorbis audio meta information
5 | #
6 | # Revisions: 2006/11/10 - P. Harvey Created
7 | # 2011/07/12 - PH Moved Ogg to a separate module and added Theora
8 | #
9 | # References: 1) http://www.xiph.org/vorbis/doc/
10 | # 2) http://flac.sourceforge.net/ogg_mapping.html
11 | # 3) http://www.theora.org/doc/Theora.pdf
12 | #------------------------------------------------------------------------------
13 |
14 | package Image::ExifTool::Vorbis;
15 |
16 | use strict;
17 | use vars qw($VERSION);
18 | use Image::ExifTool qw(:DataAccess :Utils);
19 |
20 | $VERSION = '1.08';
21 |
22 | sub ProcessComments($$$);
23 |
24 | # Vorbis header types
25 | %Image::ExifTool::Vorbis::Main = (
26 | NOTES => q{
27 | Information extracted from Ogg Vorbis files. See
28 | L for the Vorbis specification.
29 | },
30 | 1 => {
31 | Name => 'Identification',
32 | SubDirectory => { TagTable => 'Image::ExifTool::Vorbis::Identification' },
33 | },
34 | 3 => {
35 | Name => 'Comments',
36 | SubDirectory => { TagTable => 'Image::ExifTool::Vorbis::Comments' },
37 | },
38 | );
39 |
40 | %Image::ExifTool::Vorbis::Identification = (
41 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
42 | GROUPS => { 2 => 'Audio' },
43 | 0 => {
44 | Name => 'VorbisVersion',
45 | Format => 'int32u',
46 | },
47 | 4 => 'AudioChannels',
48 | 5 => {
49 | Name => 'SampleRate',
50 | Format => 'int32u',
51 | },
52 | 9 => {
53 | Name => 'MaximumBitrate',
54 | Format => 'int32u',
55 | RawConv => '$val || undef',
56 | PrintConv => 'ConvertBitrate($val)',
57 | },
58 | 13 => {
59 | Name => 'NominalBitrate',
60 | Format => 'int32u',
61 | RawConv => '$val || undef',
62 | PrintConv => 'ConvertBitrate($val)',
63 | },
64 | 17 => {
65 | Name => 'MinimumBitrate',
66 | Format => 'int32u',
67 | RawConv => '$val || undef',
68 | PrintConv => 'ConvertBitrate($val)',
69 | },
70 | );
71 |
72 | %Image::ExifTool::Vorbis::Comments = (
73 | PROCESS_PROC => \&ProcessComments,
74 | GROUPS => { 2 => 'Audio' },
75 | NOTES => q{
76 | The tags below are only some common tags found in the Vorbis comments of Ogg
77 | Vorbis and Ogg FLAC audio files, however ExifTool will extract values from
78 | any tag found, even if not listed here.
79 | },
80 | vendor => { Notes => 'from comment header' },
81 | TITLE => { Name => 'Title' },
82 | VERSION => { Name => 'Version' },
83 | ALBUM => { Name => 'Album' },
84 | TRACKNUMBER=>{ Name => 'TrackNumber' },
85 | ARTIST => { Name => 'Artist', Groups => { 2 => 'Author' }, List => 1 },
86 | PERFORMER => { Name => 'Performer', Groups => { 2 => 'Author' }, List => 1 },
87 | COPYRIGHT => { Name => 'Copyright', Groups => { 2 => 'Author' } },
88 | LICENSE => { Name => 'License', Groups => { 2 => 'Author' } },
89 | ORGANIZATION=>{Name => 'Organization', Groups => { 2 => 'Author' } },
90 | DESCRIPTION=>{ Name => 'Description' },
91 | GENRE => { Name => 'Genre' },
92 | DATE => { Name => 'Date', Groups => { 2 => 'Time' } },
93 | LOCATION => { Name => 'Location', Groups => { 2 => 'Location' } },
94 | CONTACT => { Name => 'Contact', Groups => { 2 => 'Author' }, List => 1 },
95 | ISRC => { Name => 'ISRCNumber' },
96 | COVERARTMIME => { Name => 'CoverArtMIMEType' },
97 | COVERART => {
98 | Name => 'CoverArt',
99 | Groups => { 2 => 'Preview' },
100 | Notes => 'base64-encoded image',
101 | ValueConv => q{
102 | require Image::ExifTool::XMP;
103 | Image::ExifTool::XMP::DecodeBase64($val);
104 | },
105 | },
106 | REPLAYGAIN_TRACK_PEAK => { Name => 'ReplayGainTrackPeak' },
107 | REPLAYGAIN_TRACK_GAIN => { Name => 'ReplayGainTrackGain' },
108 | REPLAYGAIN_ALBUM_PEAK => { Name => 'ReplayGainAlbumPeak' },
109 | REPLAYGAIN_ALBUM_GAIN => { Name => 'ReplayGainAlbumGain' },
110 | # observed in "Xiph.Org libVorbis I 20020717" ogg:
111 | ENCODED_USING => { Name => 'EncodedUsing' },
112 | ENCODED_BY => { Name => 'EncodedBy' },
113 | COMMENT => { Name => 'Comment' },
114 | # in Theora documentation (ref 3)
115 | DIRECTOR => { Name => 'Director' },
116 | PRODUCER => { Name => 'Producer' },
117 | COMPOSER => { Name => 'Composer' },
118 | ACTOR => { Name => 'Actor' },
119 | # Opus tags
120 | ENCODER => { Name => 'Encoder' },
121 | ENCODER_OPTIONS => { Name => 'EncoderOptions' },
122 | METADATA_BLOCK_PICTURE => {
123 | Name => 'Picture',
124 | Binary => 1,
125 | # ref https://wiki.xiph.org/VorbisComment#METADATA_BLOCK_PICTURE
126 | RawConv => q{
127 | require Image::ExifTool::XMP;
128 | Image::ExifTool::XMP::DecodeBase64($val);
129 | },
130 | SubDirectory => {
131 | TagTable => 'Image::ExifTool::FLAC::Picture',
132 | ByteOrder => 'BigEndian',
133 | },
134 | },
135 | );
136 |
137 | # Vorbis composite tags
138 | %Image::ExifTool::Vorbis::Composite = (
139 | Duration => {
140 | Require => {
141 | 0 => 'Vorbis:NominalBitrate',
142 | 1 => 'FileSize',
143 | },
144 | RawConv => '$val[0] ? $val[1] * 8 / $val[0] : undef',
145 | PrintConv => 'ConvertDuration($val) . " (approx)"', # (only approximate)
146 | },
147 | );
148 |
149 | # add our composite tags
150 | Image::ExifTool::AddCompositeTags('Image::ExifTool::Vorbis');
151 |
152 |
153 | #------------------------------------------------------------------------------
154 | # Process Vorbis Comments
155 | # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
156 | # Returns: 1 on success, otherwise returns 0 and sets a Warning
157 | sub ProcessComments($$$)
158 | {
159 | my ($et, $dirInfo, $tagTablePtr) = @_;
160 | my $dataPt = $$dirInfo{DataPt};
161 | my $dataPos = $$dirInfo{DataPos};
162 | my $pos = $$dirInfo{DirStart} || 0;
163 | my $end = $$dirInfo{DirLen} ? $pos + $$dirInfo{DirLen} : length $$dataPt;
164 | my ($num, $index);
165 |
166 | SetByteOrder('II');
167 | for (;;) {
168 | last if $pos + 4 > $end;
169 | my $len = Get32u($dataPt, $pos);
170 | last if $pos + 4 + $len > $end;
171 | my $start = $pos + 4;
172 | my $buff = substr($$dataPt, $start, $len);
173 | $pos = $start + $len;
174 | my ($tag, $val);
175 | if (defined $num) {
176 | $buff =~ /(.*?)=(.*)/s or last;
177 | ($tag, $val) = (uc $1, $2);
178 | # Vorbis tag ID's are all capitals, so they may conflict with our internal tags
179 | # --> protect against this by adding a trailing underline if necessary
180 | $tag .= '_' if $Image::ExifTool::specialTags{$tag};
181 | } else {
182 | $tag = 'vendor';
183 | $val = $buff;
184 | $num = ($pos + 4 < $end) ? Get32u($dataPt, $pos) : 0;
185 | $et->VPrint(0, " + [Vorbis comments with $num entries]\n");
186 | $pos += 4;
187 | }
188 | # add tag to table unless it exists already
189 | unless ($$tagTablePtr{$tag}) {
190 | my $name = ucfirst(lc($tag));
191 | # remove invalid characters in tag name and capitalize following letters
192 | $name =~ s/[^\w-]+(.?)/\U$1/sg;
193 | $name =~ s/([a-z0-9])_([a-z])/$1\U$2/g;
194 | $et->VPrint(0, " | [adding $tag]\n");
195 | AddTagToTable($tagTablePtr, $tag, { Name => $name });
196 | }
197 | $et->HandleTag($tagTablePtr, $tag, $et->Decode($val, 'UTF8'),
198 | Index => $index,
199 | DataPt => $dataPt,
200 | DataPos => $dataPos,
201 | Start => $start,
202 | Size => $len,
203 | );
204 | # all done if this was our last tag
205 | $num-- or return 1;
206 | $index = (defined $index) ? $index + 1 : 0;
207 | }
208 | $et->Warn('Format error in Vorbis comments');
209 | return 0;
210 | }
211 |
212 | 1; # end
213 |
214 | __END__
215 |
216 | =head1 NAME
217 |
218 | Image::ExifTool::Vorbis - Read Ogg Vorbis audio meta information
219 |
220 | =head1 SYNOPSIS
221 |
222 | This module is used by Image::ExifTool
223 |
224 | =head1 DESCRIPTION
225 |
226 | This module contains definitions required by Image::ExifTool to extract meta
227 | information from Ogg Vorbis audio headers.
228 |
229 | =head1 AUTHOR
230 |
231 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
232 |
233 | This library is free software; you can redistribute it and/or modify it
234 | under the same terms as Perl itself.
235 |
236 | =head1 REFERENCES
237 |
238 | =over 4
239 |
240 | =item L
241 |
242 | =item L
243 |
244 | =item L
245 |
246 | =back
247 |
248 | =head1 SEE ALSO
249 |
250 | L,
251 | L,
252 | L
253 |
254 | =cut
255 |
256 |
--------------------------------------------------------------------------------
/src/Image-ExifTool/lib/Image/ExifTool/GIMP.pm:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | # File: GIMP.pm
3 | #
4 | # Description: Read meta information from GIMP XCF images
5 | #
6 | # Revisions: 2010/10/05 - P. Harvey Created
7 | # 2018/08/21 - PH Updated to current XCF specification (v013)
8 | #
9 | # References: 1) GIMP source code
10 | # 2) https://gitlab.gnome.org/GNOME/gimp/blob/master/devel-docs/xcf.txt
11 | #------------------------------------------------------------------------------
12 |
13 | package Image::ExifTool::GIMP;
14 |
15 | use strict;
16 | use vars qw($VERSION);
17 | use Image::ExifTool qw(:DataAccess :Utils);
18 |
19 | $VERSION = '1.03';
20 |
21 | sub ProcessParasites($$$);
22 |
23 | # GIMP XCF properties (ref 2)
24 | %Image::ExifTool::GIMP::Main = (
25 | GROUPS => { 2 => 'Image' },
26 | VARS => { ALPHA_FIRST => 1 },
27 | NOTES => q{
28 | The GNU Image Manipulation Program (GIMP) writes these tags in its native
29 | XCF (eXperimental Computing Facilty) images.
30 | },
31 | header => { SubDirectory => { TagTable => 'Image::ExifTool::GIMP::Header' } },
32 | # recognized properties
33 | # 1 - ColorMap
34 | # 17 - SamplePoints? (doc says 17 is also "PROP_SAMPLE_POINTS"??)
35 | 17 => {
36 | Name => 'Compression',
37 | Format => 'int8u',
38 | PrintConv => {
39 | 0 => 'None',
40 | 1 => 'RLE Encoding',
41 | 2 => 'Zlib',
42 | 3 => 'Fractal',
43 | },
44 | },
45 | # 18 - Guides
46 | 19 => {
47 | Name => 'Resolution',
48 | SubDirectory => { TagTable => 'Image::ExifTool::GIMP::Resolution' },
49 | },
50 | 20 => {
51 | Name => 'Tattoo',
52 | Format => 'int32u',
53 | },
54 | 21 => {
55 | Name => 'Parasites',
56 | SubDirectory => { TagTable => 'Image::ExifTool::GIMP::Parasite' },
57 | },
58 | 22 => {
59 | Name => 'Units',
60 | Format => 'int32u',
61 | PrintConv => {
62 | 1 => 'Inches',
63 | 2 => 'mm',
64 | 3 => 'Points',
65 | 4 => 'Picas',
66 | },
67 | },
68 | # 23 Paths
69 | # 24 UserUnit
70 | # 25 Vectors
71 | );
72 |
73 | # information extracted from the XCF file header (ref 2)
74 | %Image::ExifTool::GIMP::Header = (
75 | GROUPS => { 2 => 'Image' },
76 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
77 | 9 => {
78 | Name => 'XCFVersion',
79 | Format => 'string[5]',
80 | DataMember => 'XCFVersion',
81 | RawConv => '$$self{XCFVersion} = $val',
82 | PrintConv => {
83 | 'file' => '0',
84 | 'v001' => '1',
85 | 'v002' => '2',
86 | OTHER => sub { my $val = shift; $val =~ s/^v0*//; return $val },
87 | },
88 | },
89 | 14 => { Name => 'ImageWidth', Format => 'int32u' },
90 | 18 => { Name => 'ImageHeight', Format => 'int32u' },
91 | 22 => {
92 | Name => 'ColorMode',
93 | Format => 'int32u',
94 | PrintConv => {
95 | 0 => 'RGB Color',
96 | 1 => 'Grayscale',
97 | 2 => 'Indexed Color',
98 | },
99 | },
100 | # 26 - [XCF 4 or later] Precision
101 | );
102 |
103 | # XCF resolution data (property type 19) (ref 2)
104 | %Image::ExifTool::GIMP::Resolution = (
105 | GROUPS => { 2 => 'Image' },
106 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
107 | FORMAT => 'float',
108 | 0 => 'XResolution',
109 | 1 => 'YResolution',
110 | );
111 |
112 | # XCF "Parasite" data (property type 21) (ref 1/PH)
113 | %Image::ExifTool::GIMP::Parasite = (
114 | GROUPS => { 2 => 'Image' },
115 | PROCESS_PROC => \&ProcessParasites,
116 | 'gimp-comment' => {
117 | Name => 'Comment',
118 | Format => 'string',
119 | },
120 | 'exif-data' => {
121 | Name => 'ExifData',
122 | SubDirectory => {
123 | TagTable => 'Image::ExifTool::Exif::Main',
124 | ProcessProc => \&Image::ExifTool::ProcessTIFF,
125 | Start => 6, # starts after "Exif\0\0" header
126 | },
127 | },
128 | 'jpeg-exif-data' => { # (deprecated, untested)
129 | Name => 'JPEGExifData',
130 | SubDirectory => {
131 | TagTable => 'Image::ExifTool::Exif::Main',
132 | ProcessProc => \&Image::ExifTool::ProcessTIFF,
133 | Start => 6,
134 | },
135 | },
136 | 'iptc-data' => { # (untested)
137 | Name => 'IPTCData',
138 | SubDirectory => { TagTable => 'Image::ExifTool::IPTC::Main' },
139 | },
140 | 'icc-profile' => {
141 | Name => 'ICC_Profile',
142 | SubDirectory => { TagTable => 'Image::ExifTool::ICC_Profile::Main' },
143 | },
144 | 'icc-profile-name' => {
145 | Name => 'ICCProfileName',
146 | Format => 'string',
147 | },
148 | 'gimp-metadata' => {
149 | Name => 'XMP',
150 | SubDirectory => {
151 | TagTable => 'Image::ExifTool::XMP::Main',
152 | Start => 10, # starts after "GIMP_XMP_1" header
153 | },
154 | },
155 | 'gimp-image-metadata' => {
156 | Name => 'XML',
157 | SubDirectory => { TagTable => 'Image::ExifTool::XMP::XML' },
158 | },
159 | # Seen, but not yet decoded:
160 | # gimp-image-grid
161 | # jpeg-settings
162 | );
163 |
164 | #------------------------------------------------------------------------------
165 | # Read information in a GIMP XCF parasite data (ref PH)
166 | # Inputs: 0) ExifTool ref, 1) dirInfo ref, 2) tag table ref
167 | # Returns: 1 on success
168 | sub ProcessParasites($$$)
169 | {
170 | my ($et, $dirInfo, $tagTablePtr) = @_;
171 | my $unknown = $et->Options('Unknown') || $et->Options('Verbose');
172 | my $dataPt = $$dirInfo{DataPt};
173 | my $pos = $$dirInfo{DirStart} || 0;
174 | my $end = length $$dataPt;
175 | $et->VerboseDir('Parasites', undef, $end);
176 | for (;;) {
177 | last if $pos + 4 > $end;
178 | my $size = Get32u($dataPt, $pos); # length of tag string
179 | $pos += 4;
180 | last if $pos + $size + 8 > $end;
181 | my $tag = substr($$dataPt, $pos, $size);
182 | $pos += $size;
183 | $tag =~ s/\0.*//s; # trim at null terminator
184 | # my $flags = Get32u($dataPt, $pos); (ignore flags)
185 | $size = Get32u($dataPt, $pos + 4); # length of data
186 | $pos += 8;
187 | last if $pos + $size > $end;
188 | if (not $$tagTablePtr{$tag} and $unknown) {
189 | my $name = $tag;
190 | $name =~ tr/-_A-Za-z0-9//dc;
191 | $name =~ s/^gimp-//;
192 | next unless length $name;
193 | $name = ucfirst $name;
194 | $name =~ s/([a-z])-([a-z])/$1\u$2/g;
195 | $name = "GIMP-$name" unless length($name) > 1;
196 | AddTagToTable($tagTablePtr, $tag, { Name => $name, Unknown => 1 });
197 | }
198 | $et->HandleTag($tagTablePtr, $tag, undef,
199 | DataPt => $dataPt,
200 | Start => $pos,
201 | Size => $size,
202 | );
203 | $pos += $size;
204 | }
205 | return 1;
206 | }
207 |
208 | #------------------------------------------------------------------------------
209 | # Read information in a GIMP XCF document
210 | # Inputs: 0) ExifTool ref, 1) dirInfo ref
211 | # Returns: 1 on success, 0 if this wasn't a valid XCF file
212 | sub ProcessXCF($$)
213 | {
214 | my ($et, $dirInfo) = @_;
215 | my $raf = $$dirInfo{RAF};
216 | my $buff;
217 |
218 | return 0 unless $raf->Read($buff, 26) == 26;
219 | return 0 unless $buff =~ /^gimp xcf /;
220 |
221 | my $tagTablePtr = GetTagTable('Image::ExifTool::GIMP::Main');
222 | my $verbose = $et->Options('Verbose');
223 | $et->SetFileType();
224 | SetByteOrder('MM');
225 |
226 | # process the XCF header
227 | $et->HandleTag($tagTablePtr, 'header', $buff);
228 |
229 | # skip over precision for XCV version 4 or later
230 | $raf->Seek(4, 1) if $$et{XCFVersion} =~ /^v0*(\d+)/ and $1 >= 4;
231 |
232 | # loop through image properties
233 | for (;;) {
234 | $raf->Read($buff, 8) == 8 or last;
235 | my $tag = Get32u(\$buff, 0) or last;
236 | my $size = Get32u(\$buff, 4);
237 | $verbose and $et->VPrint(0, "XCF property $tag ($size bytes):\n");
238 | unless ($$tagTablePtr{$tag}) {
239 | $raf->Seek($size, 1);
240 | next;
241 | }
242 | $raf->Read($buff, $size) == $size or last;
243 | $et->HandleTag($tagTablePtr, $tag, undef,
244 | DataPt => \$buff,
245 | DataPos => $raf->Tell() - $size,
246 | Size => $size,
247 | );
248 | }
249 | return 1;
250 | }
251 |
252 | 1; # end
253 |
254 | __END__
255 |
256 | =head1 NAME
257 |
258 | Image::ExifTool::GIMP - Read meta information from GIMP XCF images
259 |
260 | =head1 SYNOPSIS
261 |
262 | This module is used by Image::ExifTool
263 |
264 | =head1 DESCRIPTION
265 |
266 | This module contains definitions required by Image::ExifTool to read meta
267 | information from GIMP (GNU Image Manipulation Program) XCF (eXperimental
268 | Computing Facility) images. This is the native image format used by the
269 | GIMP software.
270 |
271 | =head1 AUTHOR
272 |
273 | Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)
274 |
275 | This library is free software; you can redistribute it and/or modify it
276 | under the same terms as Perl itself.
277 |
278 | =head1 REFERENCES
279 |
280 | =over 4
281 |
282 | =item L
283 |
284 | =item L
285 |
286 | =back
287 |
288 | =head1 SEE ALSO
289 |
290 | L,
291 | L
292 |
293 | =cut
294 |
295 |
--------------------------------------------------------------------------------