├── 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 │ │ │ ├── DOSLatin1.pm │ │ │ ├── DOSLatinUS.pm │ │ │ ├── MacThai.pm │ │ │ └── Symbol.pm │ │ │ ├── Motorola.pm │ │ │ ├── Unknown.pm │ │ │ ├── GE.pm │ │ │ ├── Opus.pm │ │ │ ├── DJI.pm │ │ │ ├── Nintendo.pm │ │ │ ├── PrintIM.pm │ │ │ ├── Theora.pm │ │ │ ├── JVC.pm │ │ │ ├── Scalado.pm │ │ │ ├── JSON.pm │ │ │ ├── PGF.pm │ │ │ ├── MPC.pm │ │ │ ├── MOI.pm │ │ │ ├── Radiance.pm │ │ │ ├── KyoceraRaw.pm │ │ │ ├── Stim.pm │ │ │ ├── PPM.pm │ │ │ ├── Apple.pm │ │ │ ├── Reconyx.pm │ │ │ ├── Rawzor.pm │ │ │ ├── ITC.pm │ │ │ ├── ISO.pm │ │ │ ├── DPX.pm │ │ │ ├── iWork.pm │ │ │ ├── GIMP.pm │ │ │ ├── Lytro.pm │ │ │ └── BPG.pm │ │ └── File │ │ └── RandomAccess.pod └── com.andrewning.sortphotos.plist ├── MANIFEST.in ├── example.png ├── TODO.md ├── .gitignore ├── setup.py └── README.md /src/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | graft src/Image-ExifTool -------------------------------------------------------------------------------- /example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeaWithLucas/Sort-Photos/HEAD/example.png -------------------------------------------------------------------------------- /src/Image-ExifTool/lib/Image/ExifTool/Olympus.pm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeaWithLucas/Sort-Photos/HEAD/src/Image-ExifTool/lib/Image/ExifTool/Olympus.pm -------------------------------------------------------------------------------- /src/Image-ExifTool/lib/Image/ExifTool/Pentax.pm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeaWithLucas/Sort-Photos/HEAD/src/Image-ExifTool/lib/Image/ExifTool/Pentax.pm -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | # TODO 2 | If EXIF date is not found in photos Set '-EXIF:CreateDate' from filename if it's available [reference](http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=6408.0). 3 | 4 | # Intrested can help to implement this 5 | -------------------------------------------------------------------------------- /.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 40 | *.bak 41 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Description 3 | 4 | SortPhotos is a Python script that organizes photos into folders by date and/or time (year, year/month, year/month/day, or other custom formats). If you're like me then your growing collection of files are contained in a bunch of folders, some with a date like "Sep 2010", and others which names like "Camping Trip". SortPhotos takes this collection of folders and files and reorganizes them into a hierarchy of folders by almost any custom date/time format (by default it is by year then month). It will work with any file, but works best with image and video files that contain EXIF or other metadata formats because that stays with the file even if the files are modified. The script is also useful for transferring files from your camera into your collection of nicely organized photos. 5 | 6 | ![Example](example.png) 7 | 8 | # Download 9 | Find the lastest releases here: 10 | https://github.com/TeaWithLucas/Sort-Photos/releases 11 | 12 | # Usage 13 | 14 | SortPhotos is intended to be used primarily from the command line. To see all the options, invoke help 15 | 16 | python sortphotos.py -h 17 | 18 | The simplest usage is to specify a source directory (the directory where your mess of files is currently located) and a destination directory (where you want the files and directories to go). By default the source directory it is not searched recursively but that can changed with a flag as discussed below. 19 | 20 | python sortphotos.py /Users/Me/MessyDirectory /Users/Me/Pictures 21 | 22 | 23 | Full documentation or futher information here: 24 | https://github.com/TeaWithLucas/Sort-Photos/wiki 25 | -------------------------------------------------------------------------------- /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/Motorola.pm: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # File: Motorola.pm 3 | # 4 | # Description: Read Motorola meta information 5 | # 6 | # Revisions: 2015/10/29 - P. Harvey Created 7 | #------------------------------------------------------------------------------ 8 | 9 | package Image::ExifTool::Motorola; 10 | 11 | use strict; 12 | use vars qw($VERSION); 13 | use Image::ExifTool::Exif; 14 | 15 | $VERSION = '1.00'; 16 | 17 | # Motorola makernotes tags (ref PH) 18 | %Image::ExifTool::Motorola::Main = ( 19 | WRITE_PROC => \&Image::ExifTool::Exif::WriteExif, 20 | CHECK_PROC => \&Image::ExifTool::Exif::CheckExif, 21 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' }, 22 | WRITABLE => 1, 23 | # 0x5570 - some sort of picture mode (auto,hdr) 24 | # 0x6400 - HDR? (OFF,ON) 25 | # 0x6410 - HDR? (NO,YES) 26 | # 0x6420 - only exists in HDR images 27 | 0x665e => { Name => 'Sensor', Writable => 'string' }, # (eg. "BACK,IMX230") 28 | # 0x6700 - serial number? 29 | 0x6705 => { Name => 'ManufactureDate', Writable => 'string' }, # (NC, eg. "03Jun2015") 30 | # 0x6706 - serial number? 31 | ); 32 | 33 | 1; # end 34 | 35 | __END__ 36 | 37 | =head1 NAME 38 | 39 | Image::ExifTool::Motorola - Read Motorola meta information 40 | 41 | =head1 SYNOPSIS 42 | 43 | This module is loaded automatically by Image::ExifTool when required. 44 | 45 | =head1 DESCRIPTION 46 | 47 | This module contains the definitions to read meta information from Motorola 48 | cell phone images. 49 | 50 | =head1 AUTHOR 51 | 52 | Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca) 53 | 54 | This library is free software; you can redistribute it and/or modify it 55 | under the same terms as Perl itself. 56 | 57 | =head1 SEE ALSO 58 | 59 | L, 60 | L 61 | 62 | =cut 63 | -------------------------------------------------------------------------------- /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-2017, 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-2017, 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/Opus.pm: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # File: Opus.pm 3 | # 4 | # Description: Read Ogg Opus audio meta information 5 | # 6 | # Revisions: 2016/07/14 - P. Harvey Created 7 | # 8 | # References: 1) https://www.opus-codec.org/docs/ 9 | # 2) https://wiki.xiph.org/OggOpus 10 | # 3) https://tools.ietf.org/pdf/rfc7845.pdf 11 | #------------------------------------------------------------------------------ 12 | 13 | package Image::ExifTool::Opus; 14 | 15 | use strict; 16 | use vars qw($VERSION); 17 | 18 | $VERSION = '1.00'; 19 | 20 | # Opus metadata types 21 | %Image::ExifTool::Opus::Main = ( 22 | NOTES => q{ 23 | Information extracted from Ogg Opus files. See 24 | L for the specification. 25 | }, 26 | 'OpusHead' => { 27 | Name => 'Header', 28 | SubDirectory => { TagTable => 'Image::ExifTool::Opus::Header' }, 29 | }, 30 | 'OpusTags' => { 31 | Name => 'Comments', 32 | SubDirectory => { TagTable => 'Image::ExifTool::Vorbis::Comments' }, 33 | }, 34 | ); 35 | 36 | %Image::ExifTool::Opus::Header = ( 37 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 38 | GROUPS => { 2 => 'Audio' }, 39 | 0 => 'OpusVersion', 40 | 1 => 'AudioChannels', 41 | # 2 => 'PreSkip' (int16u) 42 | 4 => { 43 | Name => 'SampleRate', 44 | Format => 'int32u', 45 | }, 46 | 8 => { 47 | Name => 'OutputGain', 48 | Format => 'int16u', 49 | ValueConv => '10 ** ($val/5120)', 50 | }, 51 | ); 52 | 53 | 1; # end 54 | 55 | __END__ 56 | 57 | =head1 NAME 58 | 59 | Image::ExifTool::Opus - Read Ogg Opus audio meta information 60 | 61 | =head1 SYNOPSIS 62 | 63 | This module is used by Image::ExifTool 64 | 65 | =head1 DESCRIPTION 66 | 67 | This module contains definitions required by Image::ExifTool to extract meta 68 | information from Ogg Opus audio files. 69 | 70 | =head1 AUTHOR 71 | 72 | Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca) 73 | 74 | This library is free software; you can redistribute it and/or modify it 75 | under the same terms as Perl itself. 76 | 77 | =head1 REFERENCES 78 | 79 | =over 4 80 | 81 | =item L 82 | 83 | =item L 84 | 85 | =item L 86 | 87 | =back 88 | 89 | =head1 SEE ALSO 90 | 91 | L, 92 | L, 93 | L, 94 | L, 95 | L 96 | 97 | =cut 98 | 99 | -------------------------------------------------------------------------------- /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/DOSLatin1.pm: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # File: DOSLatin1.pm 3 | # 4 | # Description: cp850 to Unicode 5 | # 6 | # Revisions: 2017/10/31- P. Harvey created 7 | # 8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP850.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::DOSLatin1 = ( 15 | 0x80 => 0x00c7, 0x81 => 0x00fc, 0x82 => 0x00e9, 0x83 => 0x00e2, 16 | 0x84 => 0x00e4, 0x85 => 0x00e0, 0x86 => 0x00e5, 0x87 => 0x00e7, 17 | 0x88 => 0x00ea, 0x89 => 0x00eb, 0x8a => 0x00e8, 0x8b => 0x00ef, 18 | 0x8c => 0x00ee, 0x8d => 0x00ec, 0x8e => 0x00c4, 0x8f => 0x00c5, 19 | 0x90 => 0x00c9, 0x91 => 0x00e6, 0x92 => 0x00c6, 0x93 => 0x00f4, 20 | 0x94 => 0x00f6, 0x95 => 0x00f2, 0x96 => 0x00fb, 0x97 => 0x00f9, 21 | 0x98 => 0x00ff, 0x99 => 0x00d6, 0x9a => 0x00dc, 0x9b => 0x00f8, 22 | 0x9c => 0x00a3, 0x9d => 0x00d8, 0x9e => 0x00d7, 0x9f => 0x0192, 23 | 0xa0 => 0x00e1, 0xa1 => 0x00ed, 0xa2 => 0x00f3, 0xa3 => 0x00fa, 24 | 0xa4 => 0x00f1, 0xa5 => 0x00d1, 0xa6 => 0x00aa, 0xa7 => 0x00ba, 25 | 0xa8 => 0x00bf, 0xa9 => 0x00ae, 0xaa => 0x00ac, 0xab => 0x00bd, 26 | 0xac => 0x00bc, 0xad => 0x00a1, 0xae => 0x00ab, 0xaf => 0x00bb, 27 | 0xb0 => 0x2591, 0xb1 => 0x2592, 0xb2 => 0x2593, 0xb3 => 0x2502, 28 | 0xb4 => 0x2524, 0xb5 => 0x00c1, 0xb6 => 0x00c2, 0xb7 => 0x00c0, 29 | 0xb8 => 0x00a9, 0xb9 => 0x2563, 0xba => 0x2551, 0xbb => 0x2557, 30 | 0xbc => 0x255d, 0xbd => 0x00a2, 0xbe => 0x00a5, 0xbf => 0x2510, 31 | 0xc0 => 0x2514, 0xc1 => 0x2534, 0xc2 => 0x252c, 0xc3 => 0x251c, 32 | 0xc4 => 0x2500, 0xc5 => 0x253c, 0xc6 => 0x00e3, 0xc7 => 0x00c3, 33 | 0xc8 => 0x255a, 0xc9 => 0x2554, 0xca => 0x2569, 0xcb => 0x2566, 34 | 0xcc => 0x2560, 0xcd => 0x2550, 0xce => 0x256c, 0xcf => 0x00a4, 35 | 0xd0 => 0x00f0, 0xd1 => 0x00d0, 0xd2 => 0x00ca, 0xd3 => 0x00cb, 36 | 0xd4 => 0x00c8, 0xd5 => 0x0131, 0xd6 => 0x00cd, 0xd7 => 0x00ce, 37 | 0xd8 => 0x00cf, 0xd9 => 0x2518, 0xda => 0x250c, 0xdb => 0x2588, 38 | 0xdc => 0x2584, 0xdd => 0x00a6, 0xde => 0x00cc, 0xdf => 0x2580, 39 | 0xe0 => 0x00d3, 0xe1 => 0x00df, 0xe2 => 0x00d4, 0xe3 => 0x00d2, 40 | 0xe4 => 0x00f5, 0xe5 => 0x00d5, 0xe6 => 0x00b5, 0xe7 => 0x00fe, 41 | 0xe8 => 0x00de, 0xe9 => 0x00da, 0xea => 0x00db, 0xeb => 0x00d9, 42 | 0xec => 0x00fd, 0xed => 0x00dd, 0xee => 0x00af, 0xef => 0x00b4, 43 | 0xf0 => 0x00ad, 0xf1 => 0x00b1, 0xf2 => 0x2017, 0xf3 => 0x00be, 44 | 0xf4 => 0x00b6, 0xf5 => 0x00a7, 0xf6 => 0x00f7, 0xf7 => 0x00b8, 45 | 0xf8 => 0x00b0, 0xf9 => 0x00a8, 0xfa => 0x00b7, 0xfb => 0x00b9, 46 | 0xfc => 0x00b3, 0xfd => 0x00b2, 0xfe => 0x25a0, 0xff => 0x00a0, 47 | ); 48 | 49 | 1; # end 50 | -------------------------------------------------------------------------------- /src/Image-ExifTool/lib/Image/ExifTool/Charset/DOSLatinUS.pm: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # File: DOSLatinUS.pm 3 | # 4 | # Description: cp437 to Unicode 5 | # 6 | # Revisions: 2017/10/31- P. Harvey created 7 | # 8 | # References: 1) http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP437.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::DOSLatinUS = ( 15 | 0x80 => 0x00c7, 0x81 => 0x00fc, 0x82 => 0x00e9, 0x83 => 0x00e2, 16 | 0x84 => 0x00e4, 0x85 => 0x00e0, 0x86 => 0x00e5, 0x87 => 0x00e7, 17 | 0x88 => 0x00ea, 0x89 => 0x00eb, 0x8a => 0x00e8, 0x8b => 0x00ef, 18 | 0x8c => 0x00ee, 0x8d => 0x00ec, 0x8e => 0x00c4, 0x8f => 0x00c5, 19 | 0x90 => 0x00c9, 0x91 => 0x00e6, 0x92 => 0x00c6, 0x93 => 0x00f4, 20 | 0x94 => 0x00f6, 0x95 => 0x00f2, 0x96 => 0x00fb, 0x97 => 0x00f9, 21 | 0x98 => 0x00ff, 0x99 => 0x00d6, 0x9a => 0x00dc, 0x9b => 0x00a2, 22 | 0x9c => 0x00a3, 0x9d => 0x00a5, 0x9e => 0x20a7, 0x9f => 0x0192, 23 | 0xa0 => 0x00e1, 0xa1 => 0x00ed, 0xa2 => 0x00f3, 0xa3 => 0x00fa, 24 | 0xa4 => 0x00f1, 0xa5 => 0x00d1, 0xa6 => 0x00aa, 0xa7 => 0x00ba, 25 | 0xa8 => 0x00bf, 0xa9 => 0x2310, 0xaa => 0x00ac, 0xab => 0x00bd, 26 | 0xac => 0x00bc, 0xad => 0x00a1, 0xae => 0x00ab, 0xaf => 0x00bb, 27 | 0xb0 => 0x2591, 0xb1 => 0x2592, 0xb2 => 0x2593, 0xb3 => 0x2502, 28 | 0xb4 => 0x2524, 0xb5 => 0x2561, 0xb6 => 0x2562, 0xb7 => 0x2556, 29 | 0xb8 => 0x2555, 0xb9 => 0x2563, 0xba => 0x2551, 0xbb => 0x2557, 30 | 0xbc => 0x255d, 0xbd => 0x255c, 0xbe => 0x255b, 0xbf => 0x2510, 31 | 0xc0 => 0x2514, 0xc1 => 0x2534, 0xc2 => 0x252c, 0xc3 => 0x251c, 32 | 0xc4 => 0x2500, 0xc5 => 0x253c, 0xc6 => 0x255e, 0xc7 => 0x255f, 33 | 0xc8 => 0x255a, 0xc9 => 0x2554, 0xca => 0x2569, 0xcb => 0x2566, 34 | 0xcc => 0x2560, 0xcd => 0x2550, 0xce => 0x256c, 0xcf => 0x2567, 35 | 0xd0 => 0x2568, 0xd1 => 0x2564, 0xd2 => 0x2565, 0xd3 => 0x2559, 36 | 0xd4 => 0x2558, 0xd5 => 0x2552, 0xd6 => 0x2553, 0xd7 => 0x256b, 37 | 0xd8 => 0x256a, 0xd9 => 0x2518, 0xda => 0x250c, 0xdb => 0x2588, 38 | 0xdc => 0x2584, 0xdd => 0x258c, 0xde => 0x2590, 0xdf => 0x2580, 39 | 0xe0 => 0x03b1, 0xe1 => 0x00df, 0xe2 => 0x0393, 0xe3 => 0x03c0, 40 | 0xe4 => 0x03a3, 0xe5 => 0x03c3, 0xe6 => 0x00b5, 0xe7 => 0x03c4, 41 | 0xe8 => 0x03a6, 0xe9 => 0x0398, 0xea => 0x03a9, 0xeb => 0x03b4, 42 | 0xec => 0x221e, 0xed => 0x03c6, 0xee => 0x03b5, 0xef => 0x2229, 43 | 0xf0 => 0x2261, 0xf1 => 0x00b1, 0xf2 => 0x2265, 0xf3 => 0x2264, 44 | 0xf4 => 0x2320, 0xf5 => 0x2321, 0xf6 => 0x00f7, 0xf7 => 0x2248, 45 | 0xf8 => 0x00b0, 0xf9 => 0x2219, 0xfa => 0x00b7, 0xfb => 0x221a, 46 | 0xfc => 0x207f, 0xfd => 0x00b2, 0xfe => 0x25a0, 0xff => 0x00a0, 47 | ); 48 | 49 | 1; # end 50 | -------------------------------------------------------------------------------- /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/DJI.pm: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # File: DJI.pm 3 | # 4 | # Description: DJI Phantom maker notes tags 5 | # 6 | # Revisions: 2016-07-25 - P. Harvey Created 7 | # 2017-06-23 - PH Added XMP tags 8 | #------------------------------------------------------------------------------ 9 | 10 | package Image::ExifTool::DJI; 11 | 12 | use strict; 13 | use vars qw($VERSION); 14 | use Image::ExifTool::Exif; 15 | use Image::ExifTool::XMP; 16 | 17 | $VERSION = '1.01'; 18 | 19 | my %convFloat2 = ( 20 | PrintConv => 'sprintf("%+.2f", $val)', 21 | PrintConvInv => '$val', 22 | ); 23 | 24 | # DJI maker notes (ref PH, mostly educated guesses based on DJI QuickTime::UserData tags) 25 | %Image::ExifTool::DJI::Main = ( 26 | WRITE_PROC => \&Image::ExifTool::Exif::WriteExif, 27 | CHECK_PROC => \&Image::ExifTool::Exif::CheckExif, 28 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' }, 29 | NOTES => q{ 30 | This table lists tags found in the maker notes of images from some DJI 31 | Phantom drones. 32 | }, 33 | 0x01 => { Name => 'Make', Writable => 'string' }, 34 | # 0x02 - int8u[4]: "1 0 0 0", "1 1 0 0" 35 | 0x03 => { Name => 'SpeedX', Writable => 'float', %convFloat2 }, # (guess) 36 | 0x04 => { Name => 'SpeedY', Writable => 'float', %convFloat2 }, # (guess) 37 | 0x05 => { Name => 'SpeedZ', Writable => 'float', %convFloat2 }, # (guess) 38 | 0x06 => { Name => 'Pitch', Writable => 'float', %convFloat2 }, 39 | 0x07 => { Name => 'Yaw', Writable => 'float', %convFloat2 }, 40 | 0x08 => { Name => 'Roll', Writable => 'float', %convFloat2 }, 41 | 0x09 => { Name => 'CameraPitch',Writable => 'float', %convFloat2 }, 42 | 0x0a => { Name => 'CameraYaw', Writable => 'float', %convFloat2 }, 43 | 0x0b => { Name => 'CameraRoll', Writable => 'float', %convFloat2 }, 44 | ); 45 | 46 | %Image::ExifTool::DJI::XMP = ( 47 | %Image::ExifTool::XMP::xmpTableDefaults, 48 | GROUPS => { 0 => 'XMP', 1 => 'XMP-drone-dji', 2 => 'Image' }, 49 | NAMESPACE => 'drone-dji', 50 | TABLE_DESC => 'XMP DJI', 51 | VARS => { NO_ID => 1 }, 52 | NOTES => 'XMP tags used by DJI for images from drones.', 53 | AbsoluteAltitude => { Writable => 'real' }, 54 | RelativeAltitude => { Writable => 'real' }, 55 | GimbalRollDegree => { Writable => 'real' }, 56 | GimbalYawDegree => { Writable => 'real' }, 57 | GimbalPitchDegree => { Writable => 'real' }, 58 | FlightRollDegree => { Writable => 'real' }, 59 | FlightYawDegree => { Writable => 'real' }, 60 | FlightPitchDegree => { Writable => 'real' }, 61 | ); 62 | 63 | __END__ 64 | 65 | =head1 NAME 66 | 67 | Image::ExifTool::DJI - DJI Phantom maker notes tags 68 | 69 | =head1 SYNOPSIS 70 | 71 | This module is loaded automatically by Image::ExifTool when required. 72 | 73 | =head1 DESCRIPTION 74 | 75 | This module contains definitions required by Image::ExifTool to interpret 76 | the maker notes in images from some DJI Phantom drones. 77 | 78 | =head1 AUTHOR 79 | 80 | Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca) 81 | 82 | This library is free software; you can redistribute it and/or modify it 83 | under the same terms as Perl itself. 84 | 85 | =head1 SEE ALSO 86 | 87 | L, 88 | L 89 | 90 | =cut 91 | -------------------------------------------------------------------------------- /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-2017, 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-2017, 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-2017, 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-2017, 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-2017, 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/JSON.pm: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # File: JSON.pm 3 | # 4 | # Description: Read JSON files 5 | # 6 | # Notes: Set ExifTool MissingTagValue to "null" to ignore JSON nulls 7 | # 8 | # Revisions: 2017/03/13 - P. Harvey Created 9 | #------------------------------------------------------------------------------ 10 | 11 | package Image::ExifTool::JSON; 12 | use strict; 13 | use vars qw($VERSION); 14 | use Image::ExifTool qw(:DataAccess :Utils); 15 | use Image::ExifTool::Import; 16 | 17 | $VERSION = '1.00'; 18 | 19 | sub ProcessTag($$$$%); 20 | 21 | %Image::ExifTool::JSON::Main = ( 22 | GROUPS => { 0 => 'File', 1 => 'File', 2 => 'Other' }, 23 | NOTES => q{ 24 | No JSON tags have been pre-defined, but ExifTool will read any existing 25 | tags from basic JSON-formatted files. 26 | }, 27 | ); 28 | 29 | #------------------------------------------------------------------------------ 30 | # Store a tag value 31 | # Inputs: 0) ExifTool ref, 1) tag table, 2) tag ID, 3) value, 4) tagInfo flags 32 | sub FoundTag($$$$%) 33 | { 34 | my ($et, $tagTablePtr, $tag, $val, %flags) = @_; 35 | 36 | # avoid conflict with special table entries 37 | $tag .= '!' if $Image::ExifTool::specialTags{$tag}; 38 | 39 | AddTagToTable($tagTablePtr, $tag, { 40 | Name => Image::ExifTool::MakeTagName($tag), 41 | %flags, 42 | }) unless $$tagTablePtr{$tag}; 43 | 44 | $et->HandleTag($tagTablePtr, $tag, $val); 45 | } 46 | 47 | #------------------------------------------------------------------------------ 48 | # Process a JSON tag 49 | # Inputs: 0) ExifTool ref, 1) tag table, 2) tag ID, 3) value, 4) tagInfo flags 50 | # - expands structures into flattened tags as required 51 | sub ProcessTag($$$$%) 52 | { 53 | local $_; 54 | my ($et, $tagTablePtr, $tag, $val, %flags) = @_; 55 | 56 | if (ref $val eq 'HASH') { 57 | if ($et->Options('Struct')) { 58 | FoundTag($et, $tagTablePtr, $tag, $val, %flags, Struct => 1); 59 | return unless $et->Options('Struct') > 1; 60 | } 61 | foreach (sort keys %$val) { 62 | ProcessTag($et, $tagTablePtr, $tag . ucfirst, $$val{$_}, %flags, Flat => 1); 63 | } 64 | } elsif (ref $val eq 'ARRAY') { 65 | foreach (@$val) { 66 | ProcessTag($et, $tagTablePtr, $tag, $_, %flags, List => 1); 67 | } 68 | } elsif (defined $val) { 69 | FoundTag($et, $tagTablePtr, $tag, $val, %flags); 70 | } 71 | } 72 | 73 | #------------------------------------------------------------------------------ 74 | # Extract meta information from a JSON file 75 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference 76 | # Returns: 1 on success, 0 if this wasn't a recognized JSON file 77 | sub ProcessJSON($$) 78 | { 79 | local $_; 80 | my ($et, $dirInfo) = @_; 81 | my $raf = $$dirInfo{RAF}; 82 | my $structOpt = $et->Options('Struct'); 83 | my (%database, $key, $tag); 84 | 85 | # read information from JSON file into database structure 86 | my $err = Image::ExifTool::Import::ReadJSON($raf, \%database, 87 | $et->Options('MissingTagValue'), $et->Options('Charset')); 88 | 89 | return 0 if $err or not %database; 90 | 91 | $et->SetFileType(); 92 | 93 | my $tagTablePtr = GetTagTable('Image::ExifTool::JSON::Main'); 94 | 95 | # remove any old tag definitions in case they change flags 96 | foreach $key (TagTableKeys($tagTablePtr)) { 97 | delete $$tagTablePtr{$key}; 98 | } 99 | 100 | # extract tags from JSON database 101 | foreach $key (sort keys %database) { 102 | foreach $tag (sort keys %{$database{$key}}) { 103 | my $val = $database{$key}{$tag}; 104 | # (ignore SourceFile if generated automatically by ReadJSON) 105 | next if $tag eq 'SourceFile' and defined $val and $val eq '*'; 106 | ProcessTag($et, $tagTablePtr, $tag, $val); 107 | } 108 | } 109 | return 1; 110 | } 111 | 112 | 1; # end 113 | 114 | __END__ 115 | 116 | =head1 NAME 117 | 118 | Image::ExifTool::JSON - Read JSON files 119 | 120 | =head1 SYNOPSIS 121 | 122 | This module is used by Image::ExifTool 123 | 124 | =head1 DESCRIPTION 125 | 126 | This module contains definitions required by Image::ExifTool read 127 | information from JSON files. 128 | 129 | =head1 AUTHOR 130 | 131 | Copyright 2003-2017, 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 | 143 | -------------------------------------------------------------------------------- /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-2017, 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-2017, 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/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-2017 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 AUTHOR 219 | 220 | Copyright 2003-2017 Phil Harvey (phil at owl.phy.queensu.ca) 221 | 222 | This library is free software; you can redistribute it and/or modify it 223 | under the same terms as Perl itself. 224 | 225 | =head1 SEE ALSO 226 | 227 | L 228 | 229 | =cut 230 | 231 | # end 232 | -------------------------------------------------------------------------------- /src/Image-ExifTool/lib/Image/ExifTool/MOI.pm: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # File: MOI.pm 3 | # 4 | # Description: Read MOI meta information 5 | # 6 | # Revisions: 2014/12/15 - P. Harvey Created 7 | # 8 | # References: 1) https://en.wikipedia.org/wiki/MOI_(file_format) 9 | #------------------------------------------------------------------------------ 10 | 11 | package Image::ExifTool::MOI; 12 | 13 | use strict; 14 | use vars qw($VERSION); 15 | use Image::ExifTool qw(:DataAccess :Utils); 16 | 17 | $VERSION = '1.02'; 18 | 19 | # MOI tags (ref 1) 20 | %Image::ExifTool::MOI::Main = ( 21 | GROUPS => { 2 => 'Video' }, 22 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 23 | NOTES => q{ 24 | MOI files store information about associated MOD or TOD files, and are 25 | written by some JVC, Canon and Panasonic camcorders. 26 | }, 27 | 0x00 => { Name => 'MOIVersion', Format => 'string[2]' }, 28 | # 0x02 => { Name => 'MOIFileSize', Format => 'int32u' }, 29 | 0x06 => { 30 | Name => 'DateTimeOriginal', 31 | Format => 'undef[8]', 32 | Groups => { 2 => 'Time' }, 33 | ValueConv => sub { 34 | my $val = shift; 35 | return undef unless length($val) >= 8; 36 | my @v = unpack('nCCCCn', $val); 37 | $v[5] /= 1000; 38 | return sprintf('%.4d:%.2d:%.2d %.2d:%.2d:%06.3f', @v); 39 | }, 40 | PrintConv => '$self->ConvertDateTime($val)', 41 | }, 42 | 0x0e => { 43 | Name => 'Duration', 44 | Format => 'int32u', 45 | ValueConv => '$val / 1000', 46 | PrintConv => 'ConvertDuration($val)', 47 | }, 48 | 0x80 => { 49 | Name => 'AspectRatio', 50 | Format => 'int8u', 51 | PrintConv => q{ 52 | my $lo = ($val & 0x0f); 53 | my $hi = ($val >> 4); 54 | my $aspect; 55 | if ($lo < 2) { 56 | $aspect = '4:3'; 57 | } elsif ($lo == 4 or $lo == 5) { 58 | $aspect = '16:9'; 59 | } else { 60 | $aspect = 'Unknown'; 61 | } 62 | if ($hi == 4) { 63 | $aspect .= ' NTSC'; 64 | } elsif ($hi == 5) { 65 | $aspect .= ' PAL'; 66 | } 67 | return $aspect; 68 | }, 69 | }, 70 | 0x84 => { 71 | Name => 'AudioCodec', 72 | Format => 'int16u', 73 | Groups => { 2 => 'Audio' }, 74 | PrintHex => 1, 75 | PrintConv => { 76 | 0x00c1 => 'AC3', 77 | 0x4001 => 'MPEG', 78 | }, 79 | }, 80 | 0x86 => { 81 | Name => 'AudioBitrate', 82 | Format => 'int8u', 83 | Groups => { 2 => 'Audio' }, 84 | ValueConv => '$val * 16000 + 48000', 85 | PrintConv => 'ConvertBitrate($val)', 86 | }, 87 | 0xda => { 88 | Name => 'VideoBitrate', 89 | Format => 'int16u', 90 | PrintHex => 1, 91 | ValueConv => { 92 | 0x5896 => '8500000', 93 | 0x813d => '5500000', 94 | }, 95 | PrintConv => 'ConvertBitrate($val)', 96 | }, 97 | ); 98 | 99 | #------------------------------------------------------------------------------ 100 | # Validate and extract metadata from MOI file 101 | # Inputs: 0) ExifTool ref, 1) dirInfo ref 102 | # Returns: 1 on success, 0 if this wasn't a valid MOI file 103 | sub ProcessMOI($$) 104 | { 105 | my ($et, $dirInfo) = @_; 106 | my $raf = $$dirInfo{RAF}; 107 | my $buff; 108 | # read enough to allow skipping over run-in if it exists 109 | $raf->Read($buff, 256) == 256 and $buff =~ /^V6/ or return 0; 110 | if (defined $$et{VALUE}{FileSize}) { 111 | my $size = unpack('x2N', $buff); 112 | $size == $$et{VALUE}{FileSize} or return 0; 113 | } 114 | $et->SetFileType(); 115 | SetByteOrder('MM'); 116 | my $tagTablePtr = GetTagTable('Image::ExifTool::MOI::Main'); 117 | return $et->ProcessBinaryData({ DataPt => \$buff }, $tagTablePtr); 118 | } 119 | 120 | 1; # end 121 | 122 | __END__ 123 | 124 | =head1 NAME 125 | 126 | Image::ExifTool::MOI - Read MOI meta information 127 | 128 | =head1 SYNOPSIS 129 | 130 | This module is used by Image::ExifTool 131 | 132 | =head1 DESCRIPTION 133 | 134 | This module contains definitions required by Image::ExifTool to read meta 135 | information from MOI files. 136 | 137 | =head1 AUTHOR 138 | 139 | Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca) 140 | 141 | This library is free software; you can redistribute it and/or modify it 142 | under the same terms as Perl itself. 143 | 144 | =head1 REFERENCES 145 | 146 | =over 4 147 | 148 | =item L 149 | 150 | =back 151 | 152 | =head1 SEE ALSO 153 | 154 | L, 155 | L 156 | 157 | =cut 158 | 159 | -------------------------------------------------------------------------------- /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-2017, 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-2017, 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/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 Stim APP3 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-2017, 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.08'; 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 | HexDump(\$buff, $len, Out => $out); 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-2017, 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.03'; 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 - string[37]: some type of UID, eg. "FFCBAC24-E547-4BBC-AF47-38B1A3D845E3\0" (iPhone 6s, iOS 6.1) 75 | # 0x0014 - int32s: 1,2,3,4,5 (iPhone 6s, iOS 6.1) 76 | 0x0015 => { 77 | Name => 'ImageUniqueID', 78 | Writable => 'string', 79 | }, 80 | # 0x0016 - string[29]: "AXZ6pMTOh2L+acSh4Kg630XCScoO\0" 81 | # 0x0017 - int32s: 0,8192 82 | # 0x0019 - int32s: 0,2,128 83 | # 0x001a - string[6]: "q825s\0" 84 | # 0x001f - int32s: 0 85 | ); 86 | 87 | # PLIST-format CMTime structure (ref PH) 88 | # (CMTime ref https://developer.apple.com/library/ios/documentation/CoreMedia/Reference/CMTime/Reference/reference.html) 89 | %Image::ExifTool::Apple::RunTime = ( 90 | PROCESS_PROC => \&Image::ExifTool::PLIST::ProcessBinaryPLIST, 91 | GROUPS => { 0 => 'MakerNotes', 2 => 'Image' }, 92 | NOTES => q{ 93 | This PLIST-format information contains the elements of a CMTime structure 94 | representing the amount of time the phone has been running since the last 95 | boot, not including standby time. 96 | }, 97 | timescale => { Name => 'RunTimeScale' }, # (seen 1000000000 --> ns) 98 | epoch => { Name => 'RunTimeEpoch' }, # (seen 0) 99 | value => { Name => 'RunTimeValue' }, # (should divide by RunTimeScale to get seconds) 100 | flags => { 101 | Name => 'RunTimeFlags', 102 | PrintConv => { BITMASK => { 103 | 0 => 'Valid', 104 | 1 => 'Has been rounded', 105 | 2 => 'Positive infinity', 106 | 3 => 'Negative infinity', 107 | 4 => 'Indefinite', 108 | }}, 109 | }, 110 | ); 111 | 112 | # Apple composite tags 113 | %Image::ExifTool::Apple::Composite = ( 114 | GROUPS => { 2 => 'Camera' }, 115 | RunTimeSincePowerUp => { 116 | Require => { 117 | 0 => 'Apple:RunTimeValue', 118 | 1 => 'Apple:RunTimeScale', 119 | }, 120 | ValueConv => '$val[1] ? $val[0] / $val[1] : undef', 121 | PrintConv => 'ConvertDuration($val)', 122 | }, 123 | ); 124 | 125 | # add our composite tags 126 | Image::ExifTool::AddCompositeTags('Image::ExifTool::Apple'); 127 | 128 | 129 | 1; # end 130 | 131 | __END__ 132 | 133 | =head1 NAME 134 | 135 | Image::ExifTool::Apple - Apple EXIF maker notes tags 136 | 137 | =head1 SYNOPSIS 138 | 139 | This module is loaded automatically by Image::ExifTool when required. 140 | 141 | =head1 DESCRIPTION 142 | 143 | This module contains definitions required by Image::ExifTool to interpret 144 | Apple maker notes in EXIF information. 145 | 146 | =head1 AUTHOR 147 | 148 | Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca) 149 | 150 | This library is free software; you can redistribute it and/or modify it 151 | under the same terms as Perl itself. 152 | 153 | =head1 SEE ALSO 154 | 155 | L, 156 | L 157 | 158 | =cut 159 | -------------------------------------------------------------------------------- /src/Image-ExifTool/lib/Image/ExifTool/Reconyx.pm: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # File: Reconyx.pm 3 | # 4 | # Description: Reconyx maker notes tags 5 | # 6 | # Revisions: 2011-01-11 - P. Harvey Created 7 | # 8 | # References: 1) RCNX_MN10.pdf (courtesy of Reconyx Inc.) 9 | #------------------------------------------------------------------------------ 10 | 11 | package Image::ExifTool::Reconyx; 12 | 13 | use strict; 14 | use vars qw($VERSION); 15 | 16 | $VERSION = '1.04'; 17 | 18 | # maker notes for Reconyx Hyperfire cameras (ref PH) 19 | %Image::ExifTool::Reconyx::Main = ( 20 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' }, 21 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 22 | WRITE_PROC => \&Image::ExifTool::WriteBinaryData, 23 | CHECK_PROC => \&Image::ExifTool::CheckBinaryData, 24 | TAG_PREFIX => 'Reconyx', 25 | FORMAT => 'int16u', 26 | WRITABLE => 1, 27 | FIRST_ENTRY => 0, 28 | NOTES => q{ 29 | The following tags are extracted from the maker notes of Reconyx Hyperfire 30 | cameras such as the HC500, HC600 and PC900. 31 | }, 32 | 0x00 => { #1 33 | Name => 'MakerNoteVersion', 34 | PrintConv => 'sprintf("0x%.4x", $val)', 35 | Writable => 0, # (we use this for identification, 0xf101 --> rev 1.0) 36 | PrintConvInv => 'hex $val', 37 | }, 38 | 0x01 => { #1 39 | Name => 'FirmwareVersion', 40 | Format => 'int16u[3]', 41 | PrintConv => '$val=~tr/ /./; $val', 42 | Writable => 0, # (we use this for identification, 0x0003 --> ver 2 or 3) 43 | }, 44 | 0x04 => { #1 45 | Name => 'FirmwareDate', 46 | Format => 'int16u[2]', 47 | ValueConv => q{ 48 | my @v = split(' ',$val); 49 | sprintf('%.4x:%.2x:%.2x', $v[0], $v[1]>>8, $v[1]&0xff); 50 | }, 51 | ValueConvInv => q{ 52 | my @v = split(':', $val); 53 | hex($v[0]) . ' ' . hex($v[1] . $v[2]); 54 | }, 55 | }, 56 | 0x06 => { 57 | Name => 'TriggerMode', 58 | Format => 'string[2]', 59 | PrintConv => { 60 | C => 'CodeLoc Not Entered', #1 61 | E => 'External Sensor', #1 62 | M => 'Motion Detection', 63 | T => 'Time Lapse', 64 | }, 65 | }, 66 | 0x07 => { 67 | Name => 'Sequence', 68 | Format => 'int16u[2]', 69 | PrintConv => '$val =~ s/ / of /; $val', 70 | PrintConvInv => 'join(" ", $val=~/\d+/g)', 71 | }, 72 | 0x09 => { #1 73 | Name => 'EventNumber', 74 | Format => 'int16u[2]', 75 | ValueConv => 'my @v=split(" ",$val); ($v[0]<<16) + $v[1]', 76 | ValueConvInv => '($val>>16) . " " . ($val&0xffff)', 77 | }, 78 | 0x0b => { 79 | Name => 'DateTimeOriginal', 80 | Description => 'Date/Time Original', 81 | Format => 'int16u[6]', 82 | Groups => { 2 => 'Time' }, 83 | Priority => 0, # (not as reliable as EXIF) 84 | Shift => 'Time', 85 | ValueConv => q{ 86 | my @a = split ' ', $val; 87 | # have seen these values written big-endian when everything else is little-endian 88 | if ($a[0] & 0xff00 and not $a[0] & 0xff) { 89 | $_ = ($_ >> 8) | (($_ & 0xff) << 8) foreach @a; 90 | } 91 | sprintf('%.4d:%.2d:%.2d %.2d:%.2d:%.2d', @a[5,3,4,2,1,0]); 92 | }, 93 | ValueConvInv => q{ 94 | my @a = ($val =~ /\d+/g); 95 | return undef unless @a >= 6; 96 | join ' ', @a[5,4,3,1,2,0]; 97 | }, 98 | PrintConv => '$self->ConvertDateTime($val)', 99 | PrintConvInv => '$self->InverseDateTime($val)', 100 | }, 101 | 0x12 => { 102 | Name => 'MoonPhase', 103 | Groups => { 2 => 'Time' }, 104 | PrintConv => { 105 | 0 => 'New', 106 | 1 => 'New Crescent', 107 | 2 => 'First Quarter', 108 | 3 => 'Waxing Gibbous', 109 | 4 => 'Full', 110 | 5 => 'Waning Gibbous', 111 | 6 => 'Last Quarter', 112 | 7 => 'Old Crescent', 113 | }, 114 | }, 115 | 0x13 => { 116 | Name => 'AmbientTemperatureFahrenheit', 117 | Format => 'int16s', 118 | PrintConv => '"$val F"', 119 | PrintConvInv => '$val=~/(-?\d+)/ ? $1 : $val', 120 | }, 121 | 0x14 => { 122 | Name => 'AmbientTemperature', 123 | Format => 'int16s', 124 | PrintConv => '"$val C"', 125 | PrintConvInv => '$val=~/(-?\d+)/ ? $1 : $val', 126 | }, 127 | 0x15 => { 128 | Name => 'SerialNumber', 129 | Format => 'undef[30]', 130 | RawConv => '$_ = $self->Decode($val, "UCS2"); s/\0.*//; $_', 131 | RawConvInv => q{ 132 | $_ = $self->Encode($val, "UCS2"); 133 | $_ = substr($_, 0, 30) if length($_) > 30; 134 | return $_; 135 | }, 136 | }, 137 | 0x24 => 'Contrast', #1 138 | 0x25 => 'Brightness', #1 139 | 0x26 => 'Sharpness', #1 140 | 0x27 => 'Saturation', #1 141 | 0x28 => { 142 | Name => 'InfraredIlluminator', 143 | PrintConv => { 144 | 0 => 'Off', 145 | 1 => 'On', 146 | }, 147 | }, 148 | 0x29 => 'MotionSensitivity', #1 149 | 0x2a => { #1 150 | Name => 'BatteryVoltage', 151 | ValueConv => '$val / 1000', 152 | ValueConvInv => '$val * 1000', 153 | PrintConv => '"$val V"', 154 | PrintConvInv => '$val=~s/ ?V$//; $val', 155 | }, 156 | 0x2b => { 157 | Name => 'UserLabel', 158 | Format => 'string[22]', #1 (but manual says 16-char limit) 159 | }, 160 | ); 161 | 162 | 163 | __END__ 164 | 165 | =head1 NAME 166 | 167 | Image::ExifTool::Reconyx - Reconyx maker notes tags 168 | 169 | =head1 SYNOPSIS 170 | 171 | This module is loaded automatically by Image::ExifTool when required. 172 | 173 | =head1 DESCRIPTION 174 | 175 | This module contains definitions required by Image::ExifTool to interpret 176 | maker notes in Reconyx cameras. 177 | 178 | =head1 AUTHOR 179 | 180 | Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca) 181 | 182 | This library is free software; you can redistribute it and/or modify it 183 | under the same terms as Perl itself. 184 | 185 | =head1 SEE ALSO 186 | 187 | L, 188 | L 189 | 190 | =cut 191 | -------------------------------------------------------------------------------- /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.04'; 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 | # validate the metadata header and read the compressed metadata 108 | my $end0 = Get64u(\$buff, 0); 109 | my $pos1 = Get64u(\$buff, 8); 110 | my $end1 = Get64u(\$buff, 16); 111 | my $pos2 = Get64u(\$buff, 24); 112 | my $len = Get32u(\$buff, 40); 113 | unless ($raf->Read($buff, $len) == $len and 114 | $end0 + ($end1 - $pos1) + ($origSize - $pos2) == $metaSize and 115 | $end0 <= $pos1 and $pos1 <= $end1 and $end1 <= $pos2) 116 | { 117 | $et->Warn('Error reading image metadata'); 118 | return 1; 119 | } 120 | # uncompress the metadata 121 | unless (IO::Uncompress::Bunzip2::bunzip2(\$buff, \$buf2) and 122 | length($buf2) eq $metaSize) 123 | { 124 | $et->Warn('Error uncompressing image metadata'); 125 | return 1; 126 | } 127 | # re-assemble the original file (sans image data) 128 | undef $buff; # (can't hurt to free memory as soon as possible) 129 | $buff = substr($buf2, 0, $end0) . ("\0" x ($pos1 - $end0)) . 130 | substr($buf2, $end0, $end1 - $pos1) . ("\0" x ($pos2 - $end1)) . 131 | substr($buf2, $end0 + $end1 - $pos1, $origSize - $pos2); 132 | undef $buf2; 133 | 134 | # extract original information by calling ExtractInfo recursively 135 | $et->ExtractInfo(\$buff, { ReEntry => 1 }); 136 | undef $buff; 137 | } 138 | # set OriginalFileType from FileType of original file 139 | # then change FileType and MIMEType to indicate a Rawzor image 140 | my $origFileType = $$et{VALUE}{FileType}; 141 | if ($origFileType) { 142 | $et->HandleTag($tagTablePtr, OriginalFileType => $origFileType); 143 | $et->OverrideFileType('RWZ'); 144 | } else { 145 | $et->HandleTag($tagTablePtr, OriginalFileType => 'Unknown'); 146 | $et->SetFileType(); 147 | } 148 | return 1; 149 | } 150 | 151 | 1; # end 152 | 153 | __END__ 154 | 155 | =head1 NAME 156 | 157 | Image::ExifTool::Rawzor - Read meta information from Rawzor compressed images 158 | 159 | =head1 SYNOPSIS 160 | 161 | This module is used by Image::ExifTool 162 | 163 | =head1 DESCRIPTION 164 | 165 | This module contains definitions required by Image::ExifTool to extract meta 166 | information from Rawzor compressed images. 167 | 168 | =head1 AUTHOR 169 | 170 | Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca) 171 | 172 | This library is free software; you can redistribute it and/or modify it 173 | under the same terms as Perl itself. 174 | 175 | =head1 REFERENCES 176 | 177 | =over 4 178 | 179 | =item L 180 | 181 | =back 182 | 183 | =head1 SEE ALSO 184 | 185 | L, 186 | L 187 | 188 | =cut 189 | 190 | -------------------------------------------------------------------------------- /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-2017, 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/ISO.pm: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # File: ISO.pm 3 | # 4 | # Description: Read information from ISO 9660 disk images 5 | # 6 | # Revisions: 2016-04-07 - P. Harvey created 7 | # 8 | # References: 1) http://wiki.osdev.org/ISO_9660 9 | #------------------------------------------------------------------------------ 10 | 11 | package Image::ExifTool::ISO; 12 | 13 | use strict; 14 | use vars qw($VERSION); 15 | use Image::ExifTool qw(:DataAccess :Utils); 16 | 17 | $VERSION = '1.01'; 18 | 19 | # trim trailing spaces and ignore tag if empty 20 | my %rawStr = ( 21 | RawConv => sub { 22 | my $val = shift; 23 | $val =~ s/ +$//; 24 | return length($val) ? $val : undef; 25 | }, 26 | ); 27 | 28 | # tag info for date/time tags 29 | my %dateInfo = ( 30 | Format => 'undef[17]', 31 | Groups => { 2 => 'Time' }, 32 | ValueConv => q{ 33 | return undef if $val !~ /[^0\0 ]/; # ignore if empty 34 | if ($val =~ s/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(.)/$1:$2:$3 $4:$5:$6.$7/s) { 35 | $val .= TimeZoneString(unpack('c', $8) * 15); 36 | } 37 | return $val; 38 | }, 39 | PrintConv => '$self->ConvertDateTime($val)', 40 | ); 41 | 42 | # lookup for volume descriptor types 43 | my %volumeDescriptorType = ( 44 | 0 => 'Boot Record', 45 | 1 => 'Primary Volume', 46 | 2 => 'Supplementary Volume', 47 | 3 => 'Volume Partition', 48 | 255 => 'Terminator', 49 | ); 50 | 51 | # ISO tags 52 | %Image::ExifTool::ISO::Main = ( 53 | GROUPS => { 2 => 'Other' }, 54 | NOTES => 'Tags extracted from ISO 9660 disk images.', 55 | 0 => { 56 | Name => 'BootRecord', 57 | SubDirectory => { TagTable => 'Image::ExifTool::ISO::BootRecord' }, 58 | }, 59 | 1 => { 60 | Name => 'PrimaryVolume', 61 | SubDirectory => { TagTable => 'Image::ExifTool::ISO::PrimaryVolume' }, 62 | }, 63 | ); 64 | 65 | %Image::ExifTool::ISO::BootRecord = ( 66 | GROUPS => { 2 => 'Other' }, 67 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 68 | # 0 => { Name => 'VolumeType', PrintConv => \%volumeDescriptorType }, # (0 for boot record) 69 | # 1 => { Name => 'Identifier', Format => 'undef[5]' }, # (always "CD001") 70 | # 6 => 'VolumeDesriptorVersion', # (always 1) 71 | # always extract BootSystem, even if empty, as an indication that this is bootable 72 | 7 => { Name => 'BootSystem', Format => 'string[32]', ValueConv => '$val=~s/ +$//; $val' }, 73 | 39 => { Name => 'BootIdentifier', Format => 'string[32]', %rawStr }, 74 | ); 75 | 76 | %Image::ExifTool::ISO::PrimaryVolume = ( 77 | GROUPS => { 2 => 'Other' }, 78 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 79 | # 0 => { Name => 'VolumeType', PrintConv => \%volumeDescriptorType }, # (1 for primary volume) 80 | # 1 => { Name => 'Identifier', Format => 'undef[5]' }, # (always "CD001") 81 | # 6 => 'VolumeDesriptorVersion', # (always 1) 82 | 8 => { Name => 'System', Format => 'string[32]', %rawStr }, 83 | 40 => { Name => 'VolumeName', Format => 'string[32]', %rawStr }, 84 | 80 => { Name => 'VolumeBlockCount', Format => 'int32u' }, 85 | 120 => { Name => 'VolumeSetDiskCount', Format => 'int16u', Unknown => 1 }, 86 | 124 => { Name => 'VolumeSetDiskNumber', Format => 'int16u', Unknown => 1 }, 87 | 128 => { Name => 'VolumeBlockSize', Format => 'int16u' }, 88 | 132 => { Name => 'PathTableSize', Format => 'int32u', Unknown => 1 }, 89 | 140 => { Name => 'PathTableLocation', Format => 'int32u', Unknown => 1 }, 90 | 174 => { 91 | Name => 'RootDirectoryCreateDate', 92 | Format => 'undef[7]', 93 | Groups => { 2 => 'Time' }, 94 | ValueConv => q{ 95 | my @a = unpack('C6c', $val); 96 | $a[0] += 1900; 97 | $a[6] = TimeZoneString($a[6] * 15); 98 | return sprintf('%.4d:%.2d:%.2d %.2d:%.2d:%.2d%s', @a); 99 | }, 100 | PrintConv => '$self->ConvertDateTime($val)', 101 | }, 102 | 190 => { Name => 'VolumeSetName', Format => 'string[128]', %rawStr }, 103 | 318 => { Name => 'Publisher', Format => 'string[128]', %rawStr }, 104 | 446 => { Name => 'DataPreparer', Format => 'string[128]', %rawStr }, 105 | 574 => { Name => 'Software', Format => 'string[128]', %rawStr }, 106 | 702 => { Name => 'CopyrightFileName', Format => 'string[38]', %rawStr }, 107 | 740 => { Name => 'AbstractFileName', Format => 'string[36]', %rawStr }, 108 | 776 => { Name => 'BibligraphicFileName',Format => 'string[37]', %rawStr }, 109 | 813 => { Name => 'VolumeCreateDate', %dateInfo }, 110 | 830 => { Name => 'VolumeModifyDate', %dateInfo }, 111 | 847 => { Name => 'VolumeExpirationDate',%dateInfo }, 112 | 864 => { Name => 'VolumeEffectiveDate', %dateInfo }, 113 | #881 => 'FileStructureVersion', # (always 1) 114 | ); 115 | 116 | # ISO Composite tags 117 | %Image::ExifTool::ISO::Composite = ( 118 | GROUPS => { 2 => 'Other' }, 119 | VolumeSize => { 120 | Require => { 121 | 0 => 'ISO:VolumeBlockCount', 122 | 1 => 'ISO:VolumeBlockSize', 123 | }, 124 | ValueConv => '$val[0] * $val[1]', 125 | PrintConv => \&Image::ExifTool::ConvertFileSize, 126 | }, 127 | ); 128 | 129 | # add our composite tags 130 | Image::ExifTool::AddCompositeTags('Image::ExifTool::ISO'); 131 | 132 | #------------------------------------------------------------------------------ 133 | # Extract information from an ISO 9660 disk image 134 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference 135 | # Returns: 1 on success, 0 if this wasn't a valid ISO 9660 image 136 | sub ProcessISO($$) 137 | { 138 | my ($et, $dirInfo) = @_; 139 | my $raf = $$dirInfo{RAF}; 140 | my ($buff, $tagTablePtr); 141 | 142 | # verify this is a valid ISO file 143 | return 0 unless $raf->Seek(32768, 0); 144 | 145 | while ($raf->Read($buff, 2048) == 2048) { 146 | last unless $buff =~ /^[\0-\x03\xff]CD001/; 147 | unless ($tagTablePtr) { 148 | $et->SetFileType(); # set the FileType tag 149 | SetByteOrder('II'); # read little-endian values only 150 | $tagTablePtr = GetTagTable('Image::ExifTool::ISO::Main'); 151 | } 152 | my $type = unpack('C', $buff); 153 | $et->VPrint(0, "Volume descriptor type $type ($volumeDescriptorType{$type})\n"); 154 | last if $type == 255; # stop at terminator 155 | next unless $$tagTablePtr{$type}; 156 | my $subTablePtr = GetTagTable($$tagTablePtr{$type}{SubDirectory}{TagTable}); 157 | my %dirInfo = ( 158 | DataPt => \$buff, 159 | DataPos => $raf->Tell() - 2048, 160 | DirStart => 0, 161 | DirLen => length($buff), 162 | ); 163 | $et->ProcessDirectory(\%dirInfo, $subTablePtr); 164 | } 165 | return $tagTablePtr ? 1 : 0; 166 | } 167 | 168 | 1; # end 169 | 170 | __END__ 171 | 172 | =head1 NAME 173 | 174 | Image::ExifTool::ISO - Read information from ISO 9660 disk images 175 | 176 | =head1 SYNOPSIS 177 | 178 | This module is used by Image::ExifTool 179 | 180 | =head1 DESCRIPTION 181 | 182 | This module contains definitions required by Image::ExifTool to read 183 | information from ISO 9660 disk images. 184 | 185 | =head1 AUTHOR 186 | 187 | Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca) 188 | 189 | This library is free software; you can redistribute it and/or modify it 190 | under the same terms as Perl itself. 191 | 192 | =head1 REFERENCES 193 | 194 | =over 4 195 | 196 | =item L 197 | 198 | =back 199 | 200 | =head1 SEE ALSO 201 | 202 | L, 203 | L 204 | 205 | =cut 206 | 207 | -------------------------------------------------------------------------------- /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-2017, 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/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.04'; 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 | } 135 | $type or $type = 'ZIP'; # assume ZIP by default 136 | } 137 | $et->SetFileType($type, $mimeType{$type}); 138 | 139 | my @members = $zip->members(); 140 | my $docNum = 0; 141 | my $member; 142 | foreach $member (@members) { 143 | # get filename of this ZIP member 144 | my $file = $member->fileName(); 145 | next unless defined $file; 146 | $et->VPrint(0, "File: $file\n"); 147 | # set the document number and extract ZIP tags 148 | $$et{DOC_NUM} = ++$docNum; 149 | Image::ExifTool::ZIP::HandleMember($et, $member); 150 | 151 | # process only the index XML and JPEG thumbnail files 152 | next unless $file =~ m{^(index\.(xml|apxl)|QuickLook/Thumbnail\.jpg)$}i; 153 | # get the file contents if necessary 154 | # (CAREFUL! $buff MUST be local since we hand off a value ref to PreviewImage) 155 | my ($buff, $buffPt); 156 | if ($indexFile and $indexFile eq $file) { 157 | # use the index file we already loaded 158 | $buffPt = \$index; 159 | } else { 160 | ($buff, $status) = $zip->contents($member); 161 | $status and $et->Warn("Error extracting $file"), next; 162 | $buffPt = \$buff; 163 | } 164 | # extract JPEG as PreviewImage (should only be QuickLook/Thumbnail.jpg) 165 | if ($file =~ /\.jpg$/) { 166 | $et->FoundTag('PreviewImage', $buffPt); 167 | next; 168 | } 169 | # process "metadata" section of XML index file 170 | next unless $$buffPt =~ /<(\w+):metadata>/g; 171 | my $ns = $1; 172 | my $p1 = pos $$buffPt; 173 | next unless $$buffPt =~ m{}g; 174 | # construct XML data from "metadata" section only 175 | $$buffPt = '' . substr($$buffPt, $p1, pos($$buffPt)-$p1); 176 | my %dirInfo = ( 177 | DataPt => $buffPt, 178 | DirLen => length $$buffPt, 179 | DataLen => length $$buffPt, 180 | XMPParseOpts => { 181 | FoundProc => \&FoundTag, 182 | }, 183 | ); 184 | my $tagTablePtr = GetTagTable('Image::ExifTool::iWork::Main'); 185 | $et->ProcessDirectory(\%dirInfo, $tagTablePtr); 186 | undef $$buffPt; # (free memory now) 187 | } 188 | delete $$et{DOC_NUM}; 189 | return 1; 190 | } 191 | 192 | 1; # end 193 | 194 | __END__ 195 | 196 | =head1 NAME 197 | 198 | Image::ExifTool::iWork - Read Apple iWork '09 XML+ZIP files 199 | 200 | =head1 SYNOPSIS 201 | 202 | This module is used by Image::ExifTool 203 | 204 | =head1 DESCRIPTION 205 | 206 | This module contains definitions required by Image::ExifTool to extract meta 207 | information from Apple iWork '09 XML+ZIP files. 208 | 209 | =head1 AUTHOR 210 | 211 | Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca) 212 | 213 | This library is free software; you can redistribute it and/or modify it 214 | under the same terms as Perl itself. 215 | 216 | =head1 SEE ALSO 217 | 218 | L, 219 | L, 220 | L 221 | 222 | =cut 223 | 224 | -------------------------------------------------------------------------------- /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 | # 8 | # References: 1) GIMP source code 9 | # 2) http://svn.gnome.org/viewvc/gimp/trunk/devel-docs/xcf.txt?view=markup 10 | #------------------------------------------------------------------------------ 11 | 12 | package Image::ExifTool::GIMP; 13 | 14 | use strict; 15 | use vars qw($VERSION); 16 | use Image::ExifTool qw(:DataAccess :Utils); 17 | 18 | $VERSION = '1.02'; 19 | 20 | sub ProcessParasites($$$); 21 | 22 | # GIMP XCF properties (ref 2) 23 | %Image::ExifTool::GIMP::Main = ( 24 | GROUPS => { 2 => 'Image' }, 25 | VARS => { ALPHA_FIRST => 1 }, 26 | NOTES => q{ 27 | The GNU Image Manipulation Program (GIMP) writes these tags in its native 28 | XCF (eXperimental Computing Facilty) images. 29 | }, 30 | header => { SubDirectory => { TagTable => 'Image::ExifTool::GIMP::Header' } }, 31 | 17 => { 32 | Name => 'Compression', 33 | Format => 'int8u', 34 | PrintConv => { 35 | 0 => 'None', 36 | 1 => 'RLE Encoding', 37 | 2 => 'Zlib', 38 | 3 => 'Fractal', 39 | }, 40 | }, 41 | 19 => { 42 | Name => 'Resolution', 43 | SubDirectory => { TagTable => 'Image::ExifTool::GIMP::Resolution' }, 44 | }, 45 | 21 => { 46 | Name => 'Parasites', 47 | SubDirectory => { TagTable => 'Image::ExifTool::GIMP::Parasite' }, 48 | }, 49 | ); 50 | 51 | # information extracted from the XCF file header (ref 2) 52 | %Image::ExifTool::GIMP::Header = ( 53 | GROUPS => { 2 => 'Image' }, 54 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 55 | 9 => { 56 | Name => 'XCFVersion', 57 | Format => 'string[5]', 58 | PrintConv => { 59 | 'file' => '0', 60 | 'v001' => '1', 61 | 'v002' => '2', 62 | }, 63 | }, 64 | 14 => { Name => 'ImageWidth', Format => 'int32u' }, 65 | 18 => { Name => 'ImageHeight', Format => 'int32u' }, 66 | 22 => { 67 | Name => 'ColorMode', 68 | Format => 'int32u', 69 | PrintConv => { 70 | 0 => 'RGB Color', 71 | 1 => 'Grayscale', 72 | 2 => 'Indexed Color', 73 | }, 74 | }, 75 | ); 76 | 77 | # XCF resolution data (property type 19) (ref 2) 78 | %Image::ExifTool::GIMP::Resolution = ( 79 | GROUPS => { 2 => 'Image' }, 80 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 81 | FORMAT => 'float', 82 | 0 => 'XResolution', 83 | 1 => 'YResolution', 84 | ); 85 | 86 | # XCF "Parasite" data (property type 21) (ref 1/PH) 87 | %Image::ExifTool::GIMP::Parasite = ( 88 | GROUPS => { 2 => 'Image' }, 89 | PROCESS_PROC => \&ProcessParasites, 90 | 'gimp-comment' => { 91 | Name => 'Comment', 92 | Format => 'string', 93 | }, 94 | 'exif-data' => { 95 | Name => 'ExifData', 96 | SubDirectory => { 97 | TagTable => 'Image::ExifTool::Exif::Main', 98 | ProcessProc => \&Image::ExifTool::ProcessTIFF, 99 | Start => 6, # starts after "Exif\0\0" header 100 | }, 101 | }, 102 | 'jpeg-exif-data' => { # (deprecated, untested) 103 | Name => 'JPEGExifData', 104 | SubDirectory => { 105 | TagTable => 'Image::ExifTool::Exif::Main', 106 | ProcessProc => \&Image::ExifTool::ProcessTIFF, 107 | Start => 6, 108 | }, 109 | }, 110 | 'iptc-data' => { # (untested) 111 | Name => 'IPTCData', 112 | SubDirectory => { TagTable => 'Image::ExifTool::IPTC::Main' }, 113 | }, 114 | 'icc-profile' => { 115 | Name => 'ICC_Profile', 116 | SubDirectory => { TagTable => 'Image::ExifTool::ICC_Profile::Main' }, 117 | }, 118 | 'icc-profile-name' => { 119 | Name => 'ICCProfileName', 120 | Format => 'string', 121 | }, 122 | 'gimp-metadata' => { 123 | Name => 'XMP', 124 | SubDirectory => { 125 | TagTable => 'Image::ExifTool::XMP::Main', 126 | Start => 10, # starts after "GIMP_XMP_1" header 127 | }, 128 | }, 129 | ); 130 | 131 | #------------------------------------------------------------------------------ 132 | # Read information in a GIMP XCF parasite data (ref PH) 133 | # Inputs: 0) ExifTool ref, 1) dirInfo ref, 2) tag table ref 134 | # Returns: 1 on success 135 | sub ProcessParasites($$$) 136 | { 137 | my ($et, $dirInfo, $tagTablePtr) = @_; 138 | my $unknown = $et->Options('Unknown') || $et->Options('Verbose'); 139 | my $dataPt = $$dirInfo{DataPt}; 140 | my $pos = $$dirInfo{DirStart} || 0; 141 | my $end = length $$dataPt; 142 | $et->VerboseDir('Parasites', undef, $end); 143 | for (;;) { 144 | last if $pos + 4 > $end; 145 | my $size = Get32u($dataPt, $pos); # length of tag string 146 | $pos += 4; 147 | last if $pos + $size + 8 > $end; 148 | my $tag = substr($$dataPt, $pos, $size); 149 | $pos += $size; 150 | $tag =~ s/\0.*//s; # trim at null terminator 151 | # my $flags = Get32u($dataPt, $pos); (ignore flags) 152 | $size = Get32u($dataPt, $pos + 4); # length of data 153 | $pos += 8; 154 | last if $pos + $size > $end; 155 | if (not $$tagTablePtr{$tag} and $unknown) { 156 | my $name = $tag; 157 | $name =~ tr/-_A-Za-z0-9//dc; 158 | $name =~ s/^gimp-//; 159 | next unless length $name; 160 | $name = ucfirst $name; 161 | $name =~ s/([a-z])-([a-z])/$1\u$2/g; 162 | $name = "GIMP-$name" unless length($name) > 1; 163 | AddTagToTable($tagTablePtr, $tag, { Name => $name, Unknown => 1 }); 164 | } 165 | $et->HandleTag($tagTablePtr, $tag, undef, 166 | DataPt => $dataPt, 167 | Start => $pos, 168 | Size => $size, 169 | ); 170 | $pos += $size; 171 | } 172 | return 1; 173 | } 174 | 175 | #------------------------------------------------------------------------------ 176 | # Read information in a GIMP XCF document 177 | # Inputs: 0) ExifTool ref, 1) dirInfo ref 178 | # Returns: 1 on success, 0 if this wasn't a valid XCF file 179 | sub ProcessXCF($$) 180 | { 181 | my ($et, $dirInfo) = @_; 182 | my $raf = $$dirInfo{RAF}; 183 | my $buff; 184 | 185 | return 0 unless $raf->Read($buff, 26) == 26; 186 | return 0 unless $buff =~ /^gimp xcf /; 187 | 188 | my $tagTablePtr = GetTagTable('Image::ExifTool::GIMP::Main'); 189 | my $verbose = $et->Options('Verbose'); 190 | $et->SetFileType(); 191 | SetByteOrder('MM'); 192 | 193 | # process the XCF header 194 | $et->HandleTag($tagTablePtr, 'header', $buff); 195 | 196 | # loop through image properties 197 | for (;;) { 198 | $raf->Read($buff, 8) == 8 or last; 199 | my $tag = Get32u(\$buff, 0) or last; 200 | my $size = Get32u(\$buff, 4); 201 | $verbose and $et->VPrint(0, "XCF property $tag ($size bytes):\n"); 202 | unless ($$tagTablePtr{$tag}) { 203 | $raf->Seek($size, 1); 204 | next; 205 | } 206 | $raf->Read($buff, $size) == $size or last; 207 | $et->HandleTag($tagTablePtr, $tag, undef, 208 | DataPt => \$buff, 209 | DataPos => $raf->Tell() - $size, 210 | Size => $size, 211 | ); 212 | } 213 | return 1; 214 | } 215 | 216 | 1; # end 217 | 218 | __END__ 219 | 220 | =head1 NAME 221 | 222 | Image::ExifTool::GIMP - Read meta information from GIMP XCF images 223 | 224 | =head1 SYNOPSIS 225 | 226 | This module is used by Image::ExifTool 227 | 228 | =head1 DESCRIPTION 229 | 230 | This module contains definitions required by Image::ExifTool to read meta 231 | information from GIMP (GNU Image Manipulation Program) XCF (eXperimental 232 | Computing Facility) images. This is the native image format used by the 233 | GIMP software. 234 | 235 | =head1 AUTHOR 236 | 237 | Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca) 238 | 239 | This library is free software; you can redistribute it and/or modify it 240 | under the same terms as Perl itself. 241 | 242 | =head1 REFERENCES 243 | 244 | =over 4 245 | 246 | =item L 247 | 248 | =item L 249 | 250 | =back 251 | 252 | =head1 SEE ALSO 253 | 254 | L, 255 | L 256 | 257 | =cut 258 | 259 | -------------------------------------------------------------------------------- /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.02'; 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, %dumpParms); 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 | if ($verbose > 2) { 145 | %dumpParms = ( Out => $$et{OPTIONS}{TextOut} ); 146 | $dumpParms{MaxLen} = 128 if $verbose < 4; 147 | } 148 | my $tagTablePtr = GetTagTable('Image::ExifTool::Lytro::Main'); 149 | while ($raf->Read($buff, 16) == 16) { 150 | $buff =~ /^\x89LF/ or $et->Warn('LFP format error'), last; 151 | my $size = Get32u(\$buff, 12); 152 | $size & 0x80000000 and $et->Warn('Invalid LFP segment size'), last; 153 | $raf->Read($id, 80) == 80 or $et->Warn('Truncated LFP segment'), last; # ignore the sha1 154 | if ($verbose) { 155 | $id =~ s/\0.*//s; 156 | $et->VPrint(0, substr($buff,1,3), " segment ($size bytes, $id)\n"); 157 | } 158 | if ($size > 20000000) { 159 | $raf->Seek($size, 1) or $et->Warn('Seek error in LFP file'), last; 160 | } else { 161 | $raf->Read($buff,$size) == $size or $et->Warn('Truncated LFP data'), last; 162 | HexDump(\$buff, undef, %dumpParms, Addr=>$raf->Tell()-$size) if $verbose > 2; 163 | if ($buff =~ /^\{\s+"/) { # JSON metadata? 164 | pos($buff) = 0; 165 | $et->HandleTag($tagTablePtr, 'JSONMetadata', $buff); 166 | my $meta = Image::ExifTool::Import::ReadJSONObject(undef, \$buff); 167 | ExtractTags($et, $meta, ''); 168 | } elsif ($buff =~ /^\xff\xd8\xff/) { # embedded JPEG image? 169 | $et->HandleTag($tagTablePtr, 'EmbeddedImage', $buff); 170 | } 171 | } 172 | # skip padding if necessary 173 | my $pad = 16 - ($size % 16); 174 | $raf->Seek($pad, 1) if $pad != 16; 175 | } 176 | return 1; 177 | } 178 | 179 | 1; # end 180 | 181 | __END__ 182 | 183 | =head1 NAME 184 | 185 | Image::ExifTool::Lytro - Read Lytro LFP files 186 | 187 | =head1 SYNOPSIS 188 | 189 | This module is used by Image::ExifTool 190 | 191 | =head1 DESCRIPTION 192 | 193 | This module contains routines required by Image::ExifTool to read metadata 194 | from Lytro Light Field Picture (LFP) files. 195 | 196 | =head1 AUTHOR 197 | 198 | Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca) 199 | 200 | This library is free software; you can redistribute it and/or modify it 201 | under the same terms as Perl itself. 202 | 203 | =head1 REFERENCES 204 | 205 | =over 4 206 | 207 | =item L 208 | 209 | =back 210 | 211 | =head1 SEE ALSO 212 | 213 | L, 214 | L 215 | 216 | =cut 217 | 218 | -------------------------------------------------------------------------------- /src/Image-ExifTool/lib/Image/ExifTool/BPG.pm: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # File: BPG.pm 3 | # 4 | # Description: Read BPG meta information 5 | # 6 | # Revisions: 2016-07-05 - P. Harvey Created 7 | # 8 | # References: 1) http://bellard.org/bpg/ 9 | #------------------------------------------------------------------------------ 10 | 11 | package Image::ExifTool::BPG; 12 | 13 | use strict; 14 | use vars qw($VERSION); 15 | use Image::ExifTool qw(:DataAccess :Utils); 16 | 17 | $VERSION = '1.00'; 18 | 19 | # BPG information 20 | %Image::ExifTool::BPG::Main = ( 21 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 22 | GROUPS => { 0 => 'File', 1 => 'File', 2 => 'Image' }, 23 | NOTES => q{ 24 | The information listed below is extracted from BPG (Better Portable 25 | Graphics) images. See L for the specification. 26 | }, 27 | 4 => { 28 | Name => 'PixelFormat', 29 | Format => 'int16u', 30 | Mask => 0xe000, 31 | PrintConv => { 32 | 0x0000 => 'Grayscale', 33 | 0x2000 => '4:2:0 (chroma at 0.5, 0.5)', 34 | 0x4000 => '4:2:2 (chroma at 0.5, 0)', 35 | 0x6000 => '4:4:4', 36 | 0x8000 => '4:2:0 (chroma at 0, 0.5)', 37 | 0xa000 => '4:2:2 (chroma at 0, 0)', 38 | }, 39 | }, 40 | 4.1 => { 41 | Name => 'Alpha', 42 | Format => 'int16u', 43 | Mask => 0x1004, 44 | PrintConv => { 45 | 0x0000 => 'No Alpha Plane', 46 | 0x1000 => 'Alpha Exists (color not premultiplied)', 47 | 0x1004 => 'Alpha Exists (color premultiplied)', 48 | 0x0004 => 'Alpha Exists (W color component)', 49 | }, 50 | }, 51 | 4.2 => { 52 | Name => 'BitDepth', 53 | Format => 'int16u', 54 | Mask => 0x0f00, 55 | ValueConv => '($val >> 8) + 8', 56 | }, 57 | 4.3 => { 58 | Name => 'ColorSpace', 59 | Format => 'int16u', 60 | Mask => 0x00f0, 61 | PrintConv => { 62 | 0x0000 => 'YCbCr (BT 601)', 63 | 0x0010 => 'RGB', 64 | 0x0020 => 'YCgCo', 65 | 0x0030 => 'YCbCr (BT 709)', 66 | 0x0040 => 'YCbCr (BT 2020)', 67 | 0x0050 => 'BT 2020 Constant Luminance', 68 | }, 69 | }, 70 | 4.4 => { 71 | Name => 'Flags', 72 | Format => 'int16u', 73 | Mask => 0x000b, 74 | PrintConv => { BITMASK => { 75 | 0 => 'Animation', 76 | 1 => 'Limited Range', 77 | 3 => 'Extension Present', 78 | }}, 79 | }, 80 | 6 => { Name => 'ImageWidth', Format => 'var_ue7' }, 81 | 7 => { Name => 'ImageHeight', Format => 'var_ue7' }, 82 | # length of image data or 0 to EOF 83 | # (must be decoded so we know where the extension data starts) 84 | 8 => { Name => 'ImageLength', Format => 'var_ue7' }, 85 | ); 86 | 87 | %Image::ExifTool::BPG::Extensions = ( 88 | GROUPS => { 0 => 'File', 1 => 'File', 2 => 'Image' }, 89 | VARS => { ALPHA_FIRST => 1 }, 90 | 1 => { 91 | Name => 'EXIF', 92 | SubDirectory => { 93 | TagTable => 'Image::ExifTool::Exif::Main', 94 | ProcessProc => \&Image::ExifTool::ProcessTIFF, 95 | }, 96 | }, 97 | 2 => { 98 | Name => 'ICC_Profile', 99 | SubDirectory => { TagTable => 'Image::ExifTool::ICC_Profile::Main' }, 100 | }, 101 | 3 => { 102 | Name => 'XMP', 103 | SubDirectory => { TagTable => 'Image::ExifTool::XMP::Main' }, 104 | }, 105 | 4 => { 106 | Name => 'ThumbnailBPG', 107 | Binary => 1, 108 | }, 109 | 5 => { 110 | Name => 'AnimationControl', 111 | Binary => 1, 112 | Unknown => 1, 113 | }, 114 | ); 115 | 116 | #------------------------------------------------------------------------------ 117 | # Get ue7 integer from binary data (max 32 bits) 118 | # Inputs: 0) data ref, 1) location in data (undef for 0) 119 | # Returns: 0) ue7 as integer or undef on error, 1) length of ue7 in bytes 120 | sub Get_ue7($;$) 121 | { 122 | my $dataPt = shift; 123 | my $pos = shift || 0; 124 | my $size = length $$dataPt; 125 | my $val = 0; 126 | my $i; 127 | for ($i=0; ; ) { 128 | return() if $pos+$i >= $size or $i >= 5; 129 | my $byte = Get8u($dataPt, $pos + $i); 130 | $val = ($val << 7) | ($byte & 0x7f); 131 | unless ($byte & 0x80) { 132 | return() if $i == 4 and $byte & 0x70; # error if bits 32-34 are set 133 | last; # this was the last byte 134 | } 135 | return() if $i == 0 and $byte == 0x80; # error if first byte is 0x80 136 | ++$i; # step to the next byte 137 | } 138 | return($val, $i+1); 139 | } 140 | 141 | #------------------------------------------------------------------------------ 142 | # Extract EXIF information from a BPG image 143 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference 144 | # Returns: 1 on success, 0 if this wasn't a valid BPG file 145 | sub ProcessBPG($$) 146 | { 147 | local $_; 148 | my ($et, $dirInfo) = @_; 149 | my $raf = $$dirInfo{RAF}; 150 | my ($buff, $size, $n, $len, $pos); 151 | 152 | # verify this is a valid BPG file 153 | return 0 unless $raf->Read($buff, 21) == 21; # (21 bytes is maximum header length) 154 | return 0 unless $buff =~ /^BPG\xfb/; 155 | $et->SetFileType(); # set the FileType tag 156 | 157 | SetByteOrder('MM'); 158 | my %dirInfo = ( 159 | DataPt => \$buff, 160 | DirStart => 0, 161 | DirLen => length($buff), 162 | VarFormatData => [ ], 163 | ); 164 | $et->ProcessDirectory(\%dirInfo, GetTagTable('Image::ExifTool::BPG::Main')); 165 | 166 | return 1 unless $$et{VALUE}{Flags} & 0x0008; # all done unless extension flag is set 167 | 168 | # add varSize from last entry in VarFormatData to determine 169 | # the current read position in the file 170 | my $dataPos = 9 + $dirInfo{VarFormatData}[-1][1]; 171 | # read extension length 172 | unless ($raf->Seek($dataPos, 0) and $raf->Read($buff, 5) == 5) { 173 | $et->Warn('Missing BPG extension data'); 174 | return 1; 175 | } 176 | ($size, $n) = Get_ue7(\$buff); 177 | defined $size or $et->Warn('Corrupted BPG extension length'), return 1; 178 | $dataPos += $n; 179 | $size > 10000000 and $et->Warn('BPG extension is too large'), return 1; 180 | unless ($raf->Seek($dataPos, 0) and $raf->Read($buff, $size) == $size) { 181 | $et->Warn('Truncated BPG extension'); 182 | return 1; 183 | } 184 | my $tagTablePtr = GetTagTable('Image::ExifTool::BPG::Extensions'); 185 | # loop through the individual extensions 186 | for ($pos=0; $pos<$size; $pos+=$len) { 187 | my $type = Get8u(\$buff, $pos); 188 | # get length of this extension 189 | ($len, $n) = Get_ue7(\$buff, ++$pos); 190 | defined $len or $et->Warn('Corrupted BPG extension'), last; 191 | $pos += $n; # point to start of data for this extension 192 | $pos + $len > $size and $et->Warn('Invalid BPG extension size'), last; 193 | $$tagTablePtr{$type} or $et->Warn("Unrecognized BPG extension $type ($len bytes)", 1), next; 194 | # libbpg (in my opinion) incorrectly copies the padding byte after the 195 | # "EXIF\0" APP1 header to the start of the BPG EXIF extension, so issue a 196 | # minor warning and ignore the padding if we find it before the TIFF header 197 | if ($type == 1 and $len > 3 and substr($buff,$pos,3)=~/^.(II|MM)/s) { 198 | $et->Warn("Ignored extra byte at start of EXIF extension", 1); 199 | ++$pos; 200 | --$len; 201 | } 202 | $et->HandleTag($tagTablePtr, $type, undef, 203 | DataPt => \$buff, 204 | DataPos => $dataPos, 205 | Start => $pos, 206 | Size => $len, 207 | Parent => 'BPG', 208 | ); 209 | } 210 | return 1; 211 | } 212 | 213 | 1; # end 214 | 215 | __END__ 216 | 217 | =head1 NAME 218 | 219 | Image::ExifTool::BPG - Read BPG meta information 220 | 221 | =head1 SYNOPSIS 222 | 223 | This module is used by Image::ExifTool 224 | 225 | =head1 DESCRIPTION 226 | 227 | This module contains definitions required by Image::ExifTool to read BPG 228 | (Better Portable Graphics) images. 229 | 230 | =head1 AUTHOR 231 | 232 | Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca) 233 | 234 | This library is free software; you can redistribute it and/or modify it 235 | under the same terms as Perl itself. 236 | 237 | =head1 REFERENCES 238 | 239 | =over 4 240 | 241 | =item L 242 | 243 | =back 244 | 245 | =head1 SEE ALSO 246 | 247 | L, 248 | L 249 | 250 | =cut 251 | 252 | --------------------------------------------------------------------------------