diff -Nru metamorphose2-0.8.4/changelog.rst metamorphose2-0.8.4+git20160722/changelog.rst --- metamorphose2-0.8.4/changelog.rst 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/changelog.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,470 +0,0 @@ -*********************** -Métamorphose2 Changelog -*********************** - -2.0.8.4 beta -============ -**2015-08-11** - -Source only release. Will a real packager please stand up? - -Fixes/Changes: - - Improved cross OS/shell compatibility — Javier Prats - - Improved FreeBSD compatibility — Javier Prats - - Properly import the Image module from PIL(low) — ShadowKyogre - - Update to mutagen 1.28 - - Update to exif-py 2.1.1 - - Whitespace & except improvements - - Enlarge width of operations list - - Style/PEP8 improvements - - Move option parsing to earlier in the startup process - -Additions: - - Allow setting the wxPython version in CLI options - - rST readme and changelog - - -2.0.8.3 beta -============ -**2011-??-??** - -Fixes/Changes: - - Upgrade to latest version of mutagen, 1.20 - - Bug fix, m4a extension now correctly identified as audio file. - - Change "Destroy" to "Delete" for operations (ticket 146403). - -Additions: - - Allow recursive folder renaming (finally!) - - Get audio metadata from m4a/mp4 files. - - -2.0.8.2 beta -============ -**2011-01-07** - -Fixes/Changes: - - Fix bug folder periods (ticket 3148632). - - Continue better centralized variable storage. - - Change color picker buttons. - - Minor bugfixes. - - Translation updates. - -Additions: - - Allow recursive folder renaming in debug mode (!) - - -2.0.8.1 beta -============ -**2010-12-31** - -Fixes/Changes: - - Fix bug with duplicate rename (ticket 3095633). - - Fix bug with config file load/save (ticket 3148071). - - Fix bug with removing items from error panel. - - Preferences dialog now uses toolbar. - - Start using better centralized variable storage. - - Minor bugfixes. - - Translation updates. - - -2.0.8.0 beta -============ -**2010-12-16** - -Fixes/Changes: - - Miscellaneous minor bug fixes. - - Track numbers are now auto-padded with 0 when needed. - - Speed and memory usage improvements to error panel. - - Configs folder now defaults to user home (ticket 2803288). - - Home folder in Windows no longer has leading period. - - MAJOR rewrite of method names and code documentation, this makes - contributing to Métamorphose2 much easier and more pleasant than before. - - Begin setting some methods to 'private' for clearer view of modularity. - -Additions: - - Allow changing highlight colors (ticket 2783757) - - Copy file name in directory (ticket 3019859). - - Save list of errors to file. - - 'Reset' menu item to clear all settings. - - -2.0.7.1 beta -============ -**2010-06-20** - -Fixes/Changes: - - Fix preferences not opening (ticket 2995714). - - Fix issue with wrong encoder when loading items from directory. - - Improvements to French translation. - - Many miscellaneous fixes & code cleanup. - -Additions: - - Organize operations by drag & drop. - - Start converting to python 3. - - Use system fonts under GTK - - -2.0.7.0 beta -============ -**2010-03-26** - -Fixes/Changes: - - Fix multiple preference problems by changing how settings are accessed. - - Fix inconsistent highlighting (ticket 2974367). - - Fix Ubuntu/Debian install issue with .desktop file (ticket 2967145). - -Additions: - - Preliminary Spanish Translation. - - -2.0.6.6 beta -============ -**2010-03-02** - -Fixes/Changes: - - Fixed some command line options bugs. - - Fixed dialog crash (ticket 2948461). - - Fixed admin privileges bug in Windows Vista / 7. - -Additions: - - Command line options to manpage. - - -2.0.6.5 beta -============ -**2009-10-14** - -Fixes/Changes: - - Installer problems in multi-user winXP systems (ticket 2868067). - - Some crashes on renaming (import wx error). - - Refresh during rename works again. - - Loading a config with no path set does not override the path. - -Additions: - - Renamer menu. - - Some internal changes for better modularity. - - -2.0.6.4 beta -============ -**2009-09-14** - -Fixes/Changes: - - Fixed XML encoding error in config files (ticket 2859515). - - Fixed 'apply to' checkboxes not saving in config files (ticket 2803294). - -Additions: - - Some internal changes for better modularity. - - -2.0.6.3 beta -============ -**2009-08-30** - -Fixes/Changes: - - Some fixes related to the mutagen library integration. - - Some minor clarifications to program wording. - - Continuing source code reorganization. - -Additions: - - Improvements to manual edit dialog as requested in ticket # 2803281. - - -2.0.6.2 beta -============ -**2009-08-15** - -Fixes/Changes: - - Now using ``Mutagen`` for all audio metadata retrieval. - - Fix bug 2837523 : "FilterSel" Field remains empty in config file. - -Additions: - - Mutagen allows getting metadata from almost all types of audio files, not - just mp3 as before. - - -2.0.6.1 beta -============ -**2009-08-03** - -Fixes/Changes: - - Fix manual edit not error checking bug (id# 2794757) - - Fix operation numbering bug (ticket 2794751) — Kenneth Murphy - - More modularizing of internal components - - Fix config extension not shown by default in linux bug (ticket 2803293) - -Additions: - - Allow copying from a read-only location. - - More options for removing files in preview list - - Only show changed items option (id# 2831192) - - -2.0.6.0 beta -============ -**2009-02-28** - -Fixes/Changes: - - Major re-arrange of source file structure for more logical layout. - - Major work on modularizing internal components. This will allow many future improvements and features. - - Code style updates. - - Removal/merging of redundant code. - - Some minor speed improvements. - -Additions: - - Recursive renaming of folders. (Highly experimental, only active in debug mode) - - Command line option : set auto mode level - - More debug and time outputs. - - -2.0.5.0 beta -============ -**2008-10-29** - -Fixes/Changes: - - Config file issues. - - Exif tag processing bugs. - - Id3 tag retrieval. - - Allow setting directory placement when sorting by stat. - - Missing dll files in Windows Installer. - - Preference issues under Windows. - -Additions: - - Command line options processing. - - Command line options : show options, debug mode, timer mode, load config file, set language - - -2.0.4.3 beta -============ -**2008-06-15** - -Fixes/Changes: - - Sizing and layout issues. - - Freeze on some Exif files (patch by James Marjie). - -Additions: - - Command line options. - - French translation. - - Sort on item attributes. - - Recursive depth option. - - Manual editing of names. - - Progress dialog when previewing many items. - - Progress dialog preferences. - - File extension related picker filters. - - Dupe numbering (experimental). - - -2.0.4.2 beta -============ -**2008-04-01** - -Fixes/Changes: - - Date formatting problem for config file on some non-English systems. - - String conversion bug in error panel. - - Bug when deselecting twice from error panel. - -Additions: - - wxPython version checking: require 2.6, prefer 2.8. - - -2.0.4.1 beta -============ -**2008-03-05** - -Fixes/Changes: - - Some annoying error pop ups redirected to standard error instead. - - Much faster loading of Exif data. - - Images now re-preview only when the thumbnail size is changed. - - Update accent strip. - - Uninstaller now removes quick-launch links. - -Additions: - - *Finally* — Full saving and loading of configuration files! - All operation parameters can be saved to configuration files, all settings can be loaded. - - Preferences: change renaming refresh rate - - Preferences: split 'automation' and 'logging' panels. - - Windows binary compiled under python 2.5.2, wxPython 2.8.7.1 - - Installer adds GdiPlus.dll for Windows 2000. - - -2.0.3.2 beta -============ -**2007-12-21** - -Fixes/Changes: - - Lots of code cleanup and various fixes. - - Preview speed increased. - - Renaming speed increased. - - Selection list (picker) is now much faster for multiple selections. - - Preview now uses less memory. - - Rewrite of config file functions to use XML. - - Renaming across filesystems. - - Date/Time from EXIF. - - Double loading bug. - - Directory operations bugs in Windows. - - Loading directory bug in Windows. - - Images not found when loading application bug. - - Improper command line path parsing. - -Additions: - - Show which files will be modified. - - Modifications: encoding conversions. - - Preferences: show thumbnails in preview, highlight changed files. - - Expanded operations right click menu. - - Config file saves operation type and order. - - Date/time from EXIF: original, modified. - - Windows installer. - - -2.0.2.1 beta -============ -**2007-09-04** - -Fixes/Changes: - - Lots of code cleanup and various small fixes. - - Makefile — Pierre-Yves Chibon - - Some sizing issues. - - Rewrite of positions. - - Some issues with RE functions. - - Issues with directory operation. - - Names of operations (a bit more understandable now) - -Additions: - - Drag and Drop operations. - - Right-click menu for operations. - - Modifications: strip accents (cnvert to ASCII), url-decode, 1337. - - Removed buttons for id3 and exif, access functions by choice list now. - - Sort by specific position. - - Options for logging — separator, encloser, file extension. - - 256px sized preview, removed 16px. - - Nicer text in intro panel. - - -2.0.2.0 beta -============ -**2007-07-13** - -*First beta version wOOt!* - -Fixes/Changes: - - Lots of code cleanup and various small fixes. - - Repetitive functions go to separate utils file. - - Redo of preferences for easier maintenance. - - Preferences now correctly identifies version (again!). - -Additions: - - Project to SVN repository. - - Image preview in various sizes in picker and preview as requested by Joerg Desch. - - Undo button in main windows as requested by Joerg Desch. - - Show item type (file, folder) in preview. - - Lots of new icons, from the Fedora project. - - Saving and loading of a *basic* configuration file. - - Loading selection from CSV file. - - -2.0.1.7 alpha -============= -**2007-05-15** - -Fixes/Changes: - - Several problems as reported by William Swearingen. - - Some fixes for directory path structure checking. - - Preferences now correctly identifies version. - -Additions: - - Save as CSV now works. - - Removal of items with errors/warnings now possible. - - -2.0.1.6 alpha -============= -**2007-04-24** - -Fixes/Changes: - - More sizing issues, various platforms. - - Fixed crash on radio button change under win2000. - - On language initialization error, popup message suppressed. - -Additions: - - Swap now works for single character matches. - - More sorting options for directories. - - Directory path structure checking, functional but not complete. - - Regular expression quick buttons. - - Changes to how modules are handled for easier plugins. - - Add parent folder name into file/folder name, per requests. - - When filename exists suggest using sub-folder for renaming. - - -2.0.1.5 alpha -============= -**2007-04-03** - -Fixes/Changes: - - Icon not displaying errors. - - More sizing issues, various platforms. - - Bug that caused lost files under UNIX filesystems. - - Regular expressions problems. - -Additions: - - 'Destroy all operations' button. - - 'Reset current operation' button. - - Insert in between text finished. - - -2.0.1.4 alpha -============= -**2007-03-24** - -Fixes/Changes: - - Lots of small fixes and adjustments. - -Additions: - - Swap operation (only GUI as of now) - - Insert in between text (not functional yet). - - Rewrite of regular expressions for more uniform look (almost done). - - The main interface is now split horizontally, allows resizing. - - -2.0.1.3 alpha -============= -**2007-03-05** - -Fixes/Changes: - - Some sizing issues. - - Various bugs that crashed the program. - - Various less serious bugs. - - Alpha padding issues. - -Additions: - - Match in between text in search. - - Insert in between text (not functional yet). - - Repeating the same number when counting. - - Regular expression quick buttons. - - -2.0.1.2 alpha -============= -**2007-02-14** - -Fixes/Changes: - - Numbering auto pad when counting down. - - text boxes trigger preview on text change. - -Additions: - - Intelligent sorting of unpadded numbers. - - Better language support (for later). - - All Métamorphose1 counting parameters! - - Numbering sequences are now unique for each operation. - - -2.0.1.1 alpha -============= -**2007-02-09** - -Fixes/Changes: - - Regular expression for replace operation. - -Additions: - - Regular expression error messages. - - Better handling of warnings/errors. - - Option to sort directories first. - - Some new icons from http://www.deviantart.com/deviation/37966044 diff -Nru metamorphose2-0.8.4/ChangeLog.rst metamorphose2-0.8.4+git20160722/ChangeLog.rst --- metamorphose2-0.8.4/ChangeLog.rst 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/ChangeLog.rst 2017-01-25 12:35:14.000000000 +0000 @@ -0,0 +1,470 @@ +*********************** +Métamorphose2 Changelog +*********************** + +2.0.8.4 beta +============ +**2015-08-11** + +Source only release. Will a real packager please stand up? + +Fixes/Changes: + - Improved cross OS/shell compatibility — Javier Prats + - Improved FreeBSD compatibility — Javier Prats + - Properly import the Image module from PIL(low) — ShadowKyogre + - Update to mutagen 1.28 + - Update to exif-py 2.1.1 + - Whitespace & except improvements + - Enlarge width of operations list + - Style/PEP8 improvements + - Move option parsing to earlier in the startup process + +Additions: + - Allow setting the wxPython version in CLI options + - rST readme and changelog + + +2.0.8.3 beta +============ +**2011-??-??** + +Fixes/Changes: + - Upgrade to latest version of mutagen, 1.20 + - Bug fix, m4a extension now correctly identified as audio file. + - Change "Destroy" to "Delete" for operations (ticket 146403). + +Additions: + - Allow recursive folder renaming (finally!) + - Get audio metadata from m4a/mp4 files. + + +2.0.8.2 beta +============ +**2011-01-07** + +Fixes/Changes: + - Fix bug folder periods (ticket 3148632). + - Continue better centralized variable storage. + - Change color picker buttons. + - Minor bugfixes. + - Translation updates. + +Additions: + - Allow recursive folder renaming in debug mode (!) + + +2.0.8.1 beta +============ +**2010-12-31** + +Fixes/Changes: + - Fix bug with duplicate rename (ticket 3095633). + - Fix bug with config file load/save (ticket 3148071). + - Fix bug with removing items from error panel. + - Preferences dialog now uses toolbar. + - Start using better centralized variable storage. + - Minor bugfixes. + - Translation updates. + + +2.0.8.0 beta +============ +**2010-12-16** + +Fixes/Changes: + - Miscellaneous minor bug fixes. + - Track numbers are now auto-padded with 0 when needed. + - Speed and memory usage improvements to error panel. + - Configs folder now defaults to user home (ticket 2803288). + - Home folder in Windows no longer has leading period. + - MAJOR rewrite of method names and code documentation, this makes + contributing to Métamorphose2 much easier and more pleasant than before. + - Begin setting some methods to 'private' for clearer view of modularity. + +Additions: + - Allow changing highlight colors (ticket 2783757) + - Copy file name in directory (ticket 3019859). + - Save list of errors to file. + - 'Reset' menu item to clear all settings. + + +2.0.7.1 beta +============ +**2010-06-20** + +Fixes/Changes: + - Fix preferences not opening (ticket 2995714). + - Fix issue with wrong encoder when loading items from directory. + - Improvements to French translation. + - Many miscellaneous fixes & code cleanup. + +Additions: + - Organize operations by drag & drop. + - Start converting to python 3. + - Use system fonts under GTK + + +2.0.7.0 beta +============ +**2010-03-26** + +Fixes/Changes: + - Fix multiple preference problems by changing how settings are accessed. + - Fix inconsistent highlighting (ticket 2974367). + - Fix Ubuntu/Debian install issue with .desktop file (ticket 2967145). + +Additions: + - Preliminary Spanish Translation. + + +2.0.6.6 beta +============ +**2010-03-02** + +Fixes/Changes: + - Fixed some command line options bugs. + - Fixed dialog crash (ticket 2948461). + - Fixed admin privileges bug in Windows Vista / 7. + +Additions: + - Command line options to manpage. + + +2.0.6.5 beta +============ +**2009-10-14** + +Fixes/Changes: + - Installer problems in multi-user winXP systems (ticket 2868067). + - Some crashes on renaming (import wx error). + - Refresh during rename works again. + - Loading a config with no path set does not override the path. + +Additions: + - Renamer menu. + - Some internal changes for better modularity. + + +2.0.6.4 beta +============ +**2009-09-14** + +Fixes/Changes: + - Fixed XML encoding error in config files (ticket 2859515). + - Fixed 'apply to' checkboxes not saving in config files (ticket 2803294). + +Additions: + - Some internal changes for better modularity. + + +2.0.6.3 beta +============ +**2009-08-30** + +Fixes/Changes: + - Some fixes related to the mutagen library integration. + - Some minor clarifications to program wording. + - Continuing source code reorganization. + +Additions: + - Improvements to manual edit dialog as requested in ticket # 2803281. + + +2.0.6.2 beta +============ +**2009-08-15** + +Fixes/Changes: + - Now using ``Mutagen`` for all audio metadata retrieval. + - Fix bug 2837523 : "FilterSel" Field remains empty in config file. + +Additions: + - Mutagen allows getting metadata from almost all types of audio files, not + just mp3 as before. + + +2.0.6.1 beta +============ +**2009-08-03** + +Fixes/Changes: + - Fix manual edit not error checking bug (id# 2794757) + - Fix operation numbering bug (ticket 2794751) — Kenneth Murphy + - More modularizing of internal components + - Fix config extension not shown by default in linux bug (ticket 2803293) + +Additions: + - Allow copying from a read-only location. + - More options for removing files in preview list + - Only show changed items option (id# 2831192) + + +2.0.6.0 beta +============ +**2009-02-28** + +Fixes/Changes: + - Major re-arrange of source file structure for more logical layout. + - Major work on modularizing internal components. This will allow many future improvements and features. + - Code style updates. + - Removal/merging of redundant code. + - Some minor speed improvements. + +Additions: + - Recursive renaming of folders. (Highly experimental, only active in debug mode) + - Command line option : set auto mode level + - More debug and time outputs. + + +2.0.5.0 beta +============ +**2008-10-29** + +Fixes/Changes: + - Config file issues. + - Exif tag processing bugs. + - Id3 tag retrieval. + - Allow setting directory placement when sorting by stat. + - Missing dll files in Windows Installer. + - Preference issues under Windows. + +Additions: + - Command line options processing. + - Command line options : show options, debug mode, timer mode, load config file, set language + + +2.0.4.3 beta +============ +**2008-06-15** + +Fixes/Changes: + - Sizing and layout issues. + - Freeze on some Exif files (patch by James Marjie). + +Additions: + - Command line options. + - French translation. + - Sort on item attributes. + - Recursive depth option. + - Manual editing of names. + - Progress dialog when previewing many items. + - Progress dialog preferences. + - File extension related picker filters. + - Dupe numbering (experimental). + + +2.0.4.2 beta +============ +**2008-04-01** + +Fixes/Changes: + - Date formatting problem for config file on some non-English systems. + - String conversion bug in error panel. + - Bug when deselecting twice from error panel. + +Additions: + - wxPython version checking: require 2.6, prefer 2.8. + + +2.0.4.1 beta +============ +**2008-03-05** + +Fixes/Changes: + - Some annoying error pop ups redirected to standard error instead. + - Much faster loading of Exif data. + - Images now re-preview only when the thumbnail size is changed. + - Update accent strip. + - Uninstaller now removes quick-launch links. + +Additions: + - *Finally* — Full saving and loading of configuration files! + All operation parameters can be saved to configuration files, all settings can be loaded. + - Preferences: change renaming refresh rate + - Preferences: split 'automation' and 'logging' panels. + - Windows binary compiled under python 2.5.2, wxPython 2.8.7.1 + - Installer adds GdiPlus.dll for Windows 2000. + + +2.0.3.2 beta +============ +**2007-12-21** + +Fixes/Changes: + - Lots of code cleanup and various fixes. + - Preview speed increased. + - Renaming speed increased. + - Selection list (picker) is now much faster for multiple selections. + - Preview now uses less memory. + - Rewrite of config file functions to use XML. + - Renaming across filesystems. + - Date/Time from EXIF. + - Double loading bug. + - Directory operations bugs in Windows. + - Loading directory bug in Windows. + - Images not found when loading application bug. + - Improper command line path parsing. + +Additions: + - Show which files will be modified. + - Modifications: encoding conversions. + - Preferences: show thumbnails in preview, highlight changed files. + - Expanded operations right click menu. + - Config file saves operation type and order. + - Date/time from EXIF: original, modified. + - Windows installer. + + +2.0.2.1 beta +============ +**2007-09-04** + +Fixes/Changes: + - Lots of code cleanup and various small fixes. + - Makefile — Pierre-Yves Chibon + - Some sizing issues. + - Rewrite of positions. + - Some issues with RE functions. + - Issues with directory operation. + - Names of operations (a bit more understandable now) + +Additions: + - Drag and Drop operations. + - Right-click menu for operations. + - Modifications: strip accents (cnvert to ASCII), url-decode, 1337. + - Removed buttons for id3 and exif, access functions by choice list now. + - Sort by specific position. + - Options for logging — separator, encloser, file extension. + - 256px sized preview, removed 16px. + - Nicer text in intro panel. + + +2.0.2.0 beta +============ +**2007-07-13** + +*First beta version wOOt!* + +Fixes/Changes: + - Lots of code cleanup and various small fixes. + - Repetitive functions go to separate utils file. + - Redo of preferences for easier maintenance. + - Preferences now correctly identifies version (again!). + +Additions: + - Project to SVN repository. + - Image preview in various sizes in picker and preview as requested by Joerg Desch. + - Undo button in main windows as requested by Joerg Desch. + - Show item type (file, folder) in preview. + - Lots of new icons, from the Fedora project. + - Saving and loading of a *basic* configuration file. + - Loading selection from CSV file. + + +2.0.1.7 alpha +============= +**2007-05-15** + +Fixes/Changes: + - Several problems as reported by William Swearingen. + - Some fixes for directory path structure checking. + - Preferences now correctly identifies version. + +Additions: + - Save as CSV now works. + - Removal of items with errors/warnings now possible. + + +2.0.1.6 alpha +============= +**2007-04-24** + +Fixes/Changes: + - More sizing issues, various platforms. + - Fixed crash on radio button change under win2000. + - On language initialization error, popup message suppressed. + +Additions: + - Swap now works for single character matches. + - More sorting options for directories. + - Directory path structure checking, functional but not complete. + - Regular expression quick buttons. + - Changes to how modules are handled for easier plugins. + - Add parent folder name into file/folder name, per requests. + - When filename exists suggest using sub-folder for renaming. + + +2.0.1.5 alpha +============= +**2007-04-03** + +Fixes/Changes: + - Icon not displaying errors. + - More sizing issues, various platforms. + - Bug that caused lost files under UNIX filesystems. + - Regular expressions problems. + +Additions: + - 'Destroy all operations' button. + - 'Reset current operation' button. + - Insert in between text finished. + + +2.0.1.4 alpha +============= +**2007-03-24** + +Fixes/Changes: + - Lots of small fixes and adjustments. + +Additions: + - Swap operation (only GUI as of now) + - Insert in between text (not functional yet). + - Rewrite of regular expressions for more uniform look (almost done). + - The main interface is now split horizontally, allows resizing. + + +2.0.1.3 alpha +============= +**2007-03-05** + +Fixes/Changes: + - Some sizing issues. + - Various bugs that crashed the program. + - Various less serious bugs. + - Alpha padding issues. + +Additions: + - Match in between text in search. + - Insert in between text (not functional yet). + - Repeating the same number when counting. + - Regular expression quick buttons. + + +2.0.1.2 alpha +============= +**2007-02-14** + +Fixes/Changes: + - Numbering auto pad when counting down. + - text boxes trigger preview on text change. + +Additions: + - Intelligent sorting of unpadded numbers. + - Better language support (for later). + - All Métamorphose1 counting parameters! + - Numbering sequences are now unique for each operation. + + +2.0.1.1 alpha +============= +**2007-02-09** + +Fixes/Changes: + - Regular expression for replace operation. + +Additions: + - Regular expression error messages. + - Better handling of warnings/errors. + - Option to sort directories first. + - Some new icons from http://www.deviantart.com/deviation/37966044 diff -Nru metamorphose2-0.8.4/common.mk metamorphose2-0.8.4+git20160722/common.mk --- metamorphose2-0.8.4/common.mk 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/common.mk 2017-01-25 12:35:14.000000000 +0000 @@ -0,0 +1,10 @@ +# Specify an alternate install root +DESTDIR= +PREFIX=/usr + +PACKAGE=metamorphose2 + +# change to 1 to remove all metamorphose user files +remusr=0 + +OS=$(shell uname -s) diff -Nru metamorphose2-0.8.4/CONTRIBUTING.rst metamorphose2-0.8.4+git20160722/CONTRIBUTING.rst --- metamorphose2-0.8.4/CONTRIBUTING.rst 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/CONTRIBUTING.rst 2017-01-25 12:35:14.000000000 +0000 @@ -0,0 +1,16 @@ +************ +Contributing +************ + +All contributions are welcome! + +Bug reports, feature requests, bug fixes, documentation updates, etc ... +Nothing is too small or too big ;-) + +Please be aware that this is a purely spare time project, so don't be offended if it +takes some time to answer. + +Code Contributions +****************** + +Please start from the latest ``master`` branch for any code or documentation contributions. diff -Nru metamorphose2-0.8.4/debian/changelog metamorphose2-0.8.4+git20160722/debian/changelog --- metamorphose2-0.8.4/debian/changelog 2016-02-24 14:21:04.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/debian/changelog 2017-01-25 12:37:19.000000000 +0000 @@ -1,3 +1,20 @@ +metamorphose2 (0.8.4+git20160722-1~webupd8~xenial4) xenial; urgency=medium + + * Use latest Git to get it to work properly with wxgtk3.0 + * Enable run-with-wxpython3.patch + * Depend on python-wxgtk3.0 instead of python-wxgtk2.8 + * Disable fix-makefile-doc-install.patch, no longer required + + -- Alin Andrei Wed, 25 Jan 2017 14:37:19 +0200 + +metamorphose2 (0.8.4-1~webupd8~2~xenial) xenial; urgency=medium + + * Depend on python-wxgtk3.0 + * Patch desktop file to run with wxPython3 + * Bump standards-version to 3.9.7 + + -- Alin Andrei Mon, 15 Aug 2016 12:39:21 +0200 + metamorphose2 (0.8.4-1~webupd8~1) wily; urgency=medium * New upstream release diff -Nru metamorphose2-0.8.4/debian/control metamorphose2-0.8.4+git20160722/debian/control --- metamorphose2-0.8.4/debian/control 2016-02-24 14:20:12.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/debian/control 2017-01-25 12:37:19.000000000 +0000 @@ -3,12 +3,12 @@ Priority: optional Maintainer: ianaré sévi Build-Depends: debhelper (>= 9) -Standards-Version: 3.9.6 -Homepage: http://file-folder-ren.sourceforge.net +Standards-Version: 3.9.8 +Homepage: https://github.com/metamorphose/metamorphose2 Package: metamorphose2 Architecture: all -Depends: ${misc:Depends}, python (>=2.6), python-wxgtk2.8 (>= 2.8), python-imaging (>=1.1.6), python-mutagen (>=1.20), python-exif (>=2.1.1) +Depends: ${misc:Depends}, python (>=2.6), python-wxgtk3.0, python-imaging (>=1.1.6), python-mutagen (>=1.20), python-exif (>=2.1.1) Description: A mass renamer for files and folders (version 2). A profesional renaming tool for almost any situation, it has many powerful functions. Well suited for those that need to rename many files and/or folders diff -Nru metamorphose2-0.8.4/debian/patches/fix-makefile-for-launchpad-ppa.patch metamorphose2-0.8.4+git20160722/debian/patches/fix-makefile-for-launchpad-ppa.patch --- metamorphose2-0.8.4/debian/patches/fix-makefile-for-launchpad-ppa.patch 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/debian/patches/fix-makefile-for-launchpad-ppa.patch 2017-01-25 12:37:19.000000000 +0000 @@ -0,0 +1,29 @@ +--- a/Makefile ++++ b//Makefile +@@ -60,14 +60,14 @@ + cd messages && $(MAKE) install + + # adjust app.py translations' search-path +- sed -i "s|/usr|$(DESTDIR)$(PREFIX)|g" $(DESTDIR)$(PREFIX)/share/$(PACKAGE)/app.py; ++ #sed -i "s|/usr|$(DESTDIR)$(PREFIX)|g" $(DESTDIR)$(PREFIX)/share/$(PACKAGE)/app.py; + + # install the executables + install -d $(DESTDIR)$(PREFIX)/bin/; + install -m 755 $(PACKAGE) $(DESTDIR)$(PREFIX)/bin/; + + # adjust executable' path +- sed -i "s|/usr|$(DESTDIR)$(PREFIX)|g" $(DESTDIR)$(PREFIX)/bin/$(PACKAGE); ++ #sed -i "s|/usr|$(DESTDIR)$(PREFIX)|g" $(DESTDIR)$(PREFIX)/bin/$(PACKAGE); + + # copy icon and launcher if folders exist + #must create this folders or rpm won't build +@@ -79,7 +79,7 @@ + install -d $(DESTDIR)$(PREFIX)/share/applications + install -m 644 $(PACKAGE).desktop $(DESTDIR)$(PREFIX)/share/applications/ + # adjust launcher's path +- sed -i "s|/usr|$(DESTDIR)$(PREFIX)|g" $(DESTDIR)$(PREFIX)/share/applications/$(PACKAGE).desktop ++ #sed -i "s|/usr|$(DESTDIR)$(PREFIX)|g" $(DESTDIR)$(PREFIX)/share/applications/$(PACKAGE).desktop + if [ -d $(DESTDIR)$(PREFIX)/share/app-install/desktop ]; then\ + ln -s $(DESTDIR)$(PREFIX)/share/applications/$(PACKAGE).desktop $(DESTDIR)$(PREFIX)/share/app-install/desktop/$(PACKAGE).desktop;\ + fi; + diff -Nru metamorphose2-0.8.4/debian/patches/run-with-wxpython3.patch metamorphose2-0.8.4+git20160722/debian/patches/run-with-wxpython3.patch --- metamorphose2-0.8.4/debian/patches/run-with-wxpython3.patch 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/debian/patches/run-with-wxpython3.patch 2016-08-15 09:41:42.000000000 +0000 @@ -0,0 +1,12 @@ +--- a/metamorphose2.desktop ++++ b/metamorphose2.desktop +@@ -5,7 +5,7 @@ + Terminal=false + Categories=Utility;Filesystem; + Icon=metamorphose2 +-Exec=/usr/bin/metamorphose2 ++Exec=/usr/bin/metamorphose2 -w 3.0 + Encoding=UTF-8 + StartupNotify=true + X-AppInstall-Package=metamorphose2 + diff -Nru metamorphose2-0.8.4/debian/patches/series metamorphose2-0.8.4+git20160722/debian/patches/series --- metamorphose2-0.8.4/debian/patches/series 2016-02-23 12:22:13.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/debian/patches/series 2017-01-25 12:37:19.000000000 +0000 @@ -1 +1,3 @@ -fix-makefile-doc-install.patch +#fix-makefile-doc-install.patch +run-with-wxpython3.patch +fix-makefile-for-launchpad-ppa.patch diff -Nru metamorphose2-0.8.4/distinfo metamorphose2-0.8.4+git20160722/distinfo --- metamorphose2-0.8.4/distinfo 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/distinfo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -checksums of files that must be downloaded to build the port \ No newline at end of file diff -Nru metamorphose2-0.8.4/Makefile metamorphose2-0.8.4+git20160722/Makefile --- metamorphose2-0.8.4/Makefile 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/Makefile 2017-01-25 12:35:14.000000000 +0000 @@ -6,48 +6,35 @@ # hacked by Gabriel Espinoza to create RPM packages # -# Specify an alternate install root -DESTDIR= -prefix=/usr +include common.mk -PACKAGE=metamorphose2 - -# change to 1 to remove all metamorphose user files -remusr=0 - -OS=`uname -s` - -all: build install +all: options build install build: # make needed directories - install -d $(DESTDIR)$(prefix)/share/doc/$(PACKAGE)/; - install -d $(DESTDIR)$(prefix)/share/$(PACKAGE)/; + install -d $(DESTDIR)$(PREFIX)/share/$(PACKAGE)/; remove: - rm -fR $(DESTDIR)$(prefix)/share/doc/$(PACKAGE); - rm -fR $(DESTDIR)$(prefix)/share/$(PACKAGE); - rm -f $(DESTDIR)$(prefix)/bin/$(PACKAGE); - rm -f $(DESTDIR)$(prefix)/share/man/man1/$(PACKAGE).1.gz; + rm -fR $(DESTDIR)$(PREFIX)/share/$(PACKAGE); + rm -f $(DESTDIR)$(PREFIX)/bin/$(PACKAGE); + rm -f $(DESTDIR)$(PREFIX)/share/man/man1/$(PACKAGE).1.gz; # delete icon and launcher if folders exist - if [ -d $(DESTDIR)$(prefix)/share/pixmaps ]; then\ - rm -f $(DESTDIR)$(prefix)/share/pixmaps/$(PACKAGE).png;\ + if [ -d $(DESTDIR)$(PREFIX)/share/pixmaps ]; then\ + rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/$(PACKAGE).png;\ + fi; + if [ -d $(DESTDIR)$(PREFIX)/share/applications ] ; then\ + rm -f $(DESTDIR)$(PREFIX)/share/applications/$(PACKAGE).desktop;\ fi; - if [ -d $(DESTDIR)$(prefix)/share/applications ] ; then\ - rm -f $(DESTDIR)$(prefix)/share/applications/$(PACKAGE).desktop;\ + if [ -d $(DESTDIR)$(PREFIX)/share/app-install/icons ] ; then\ + rm -f $(DESTDIR)$(PREFIX)/share/app-install/icons/$(PACKAGE).png;\ + fi; + if [ -d $(DESTDIR)$(PREFIX)/share/app-install/desktop ] ; then\ + rm -f $(DESTDIR)$(PREFIX)/share/app-install/desktop/$(PACKAGE).desktop;\ fi; - if [ -d $(DESTDIR)$(prefix)/share/app-install/icons ] ; then\ - rm -f $(DESTDIR)$(prefix)/share/app-install/icons/$(PACKAGE).png;\ - fi; - if [ -d $(DESTDIR)$(prefix)/share/app-install/desktop ] ; then\ - rm -f $(DESTDIR)$(prefix)/share/app-install/desktop/$(PACKAGE).desktop;\ - fi; # delete translation files - if [ -d $(DESTDIR)$(prefix)/share/locale ] ; then\ - find $(DESTDIR)$(prefix)/share/locale -name $(PACKAGE).mo -delete;\ - fi;\ + cd messages && $(MAKE) uninstall # delete user files if [ ${remusr} = 1 ] ; then\ @@ -55,12 +42,10 @@ find /root/ -depth -name .$(PACKAGE) -exec rm -fR {} \; ;\ fi;\ - clean: find . -type f -regex ".*\\(pyc\|tmp\|~\)$"" -delete; find . -depth -name "*.svn" -exec rm -fr {} \; - install: install-doc # make sure all permissions are correct chmod -R a+r *; @@ -68,43 +53,50 @@ rm $(PACKAGE).1.gz # copy program files and libraries - cp -pR src/* $(DESTDIR)$(prefix)/share/$(PACKAGE)/; - + mkdir -p $(DESTDIR)$(PREFIX)/share/$(PACKAGE) + cp -pR src/* $(DESTDIR)$(PREFIX)/share/$(PACKAGE)/; # install translation files - if [ ${OS} = "Linux" ]; then\ - for lang in `ls -1 messages`; do\ - if [ -d messages/$${lang} ]; then\ - mkdir -p $(DESTDIR)$(prefix)/share/locale/$${lang}/LC_MESSAGES;\ - cp -p messages/$${lang}/LC_MESSAGES/$(PACKAGE).mo $(DESTDIR)$(prefix)/share/locale/$${lang}/LC_MESSAGES/;\ - fi;\ - done;\ - fi;\ - if [ ${OS} != "Linux" ]; then\ - cp -pR messages $(DESTDIR)$(prefix)/share/$(PACKAGE)/;\ - fi;\ + cd messages && $(MAKE) install + + # adjust app.py translations' search-path + sed -i "s|/usr|$(DESTDIR)$(PREFIX)|g" $(DESTDIR)$(PREFIX)/share/$(PACKAGE)/app.py; # install the executables - install -d $(DESTDIR)$(prefix)/bin/; - install -m 755 $(PACKAGE) $(DESTDIR)$(prefix)/bin/; + install -d $(DESTDIR)$(PREFIX)/bin/; + install -m 755 $(PACKAGE) $(DESTDIR)$(PREFIX)/bin/; + + # adjust executable' path + sed -i "s|/usr|$(DESTDIR)$(PREFIX)|g" $(DESTDIR)$(PREFIX)/bin/$(PACKAGE); # copy icon and launcher if folders exist #must create this folders or rpm won't build - install -d $(DESTDIR)$(prefix)/share/pixmaps - install -m 644 src/icons/metamorphose64.png $(DESTDIR)$(prefix)/share/pixmaps/$(PACKAGE).png;\ - if [ -d $(DESTDIR)$(prefix)/share/app-install/icons ]; then\ - ln -s $(DESTDIR)$(prefix)/share/pixmaps/$(PACKAGE).png $(DESTDIR)$(prefix)/share/app-install/icons/$(PACKAGE).png;\ - fi; - install -d $(DESTDIR)$(prefix)/share/applications - install -m 644 $(PACKAGE).desktop $(DESTDIR)$(prefix)/share/applications/ - if [ -d $(DESTDIR)$(prefix)/share/app-install/desktop ]; then\ - ln -s $(DESTDIR)$(prefix)/share/applications/$(PACKAGE).desktop $(DESTDIR)$(prefix)/share/app-install/desktop/$(PACKAGE).desktop;\ + install -d $(DESTDIR)$(PREFIX)/share/pixmaps + install -m 644 src/icons/metamorphose64.png $(DESTDIR)$(PREFIX)/share/pixmaps/$(PACKAGE).png;\ + if [ -d $(DESTDIR)$(PREFIX)/share/app-install/icons ]; then\ + ln -s $(DESTDIR)$(PREFIX)/share/pixmaps/$(PACKAGE).png $(DESTDIR)$(PREFIX)/share/app-install/icons/$(PACKAGE).png;\ + fi; + install -d $(DESTDIR)$(PREFIX)/share/applications + install -m 644 $(PACKAGE).desktop $(DESTDIR)$(PREFIX)/share/applications/ + # adjust launcher's path + sed -i "s|/usr|$(DESTDIR)$(PREFIX)|g" $(DESTDIR)$(PREFIX)/share/applications/$(PACKAGE).desktop + if [ -d $(DESTDIR)$(PREFIX)/share/app-install/desktop ]; then\ + ln -s $(DESTDIR)$(PREFIX)/share/applications/$(PACKAGE).desktop $(DESTDIR)$(PREFIX)/share/app-install/desktop/$(PACKAGE).desktop;\ fi; install-doc: - install -d $(DESTDIR)$(prefix)/share/man/man1/ + install -d $(DESTDIR)$(PREFIX)/share/man/man1/ gzip -c9 manpage.1 > $(PACKAGE).1.gz - install -m 644 $(PACKAGE).1.gz $(DESTDIR)$(prefix)/share/man/man1/ - cp *.html $(DESTDIR)$(prefix)/share/doc/$(PACKAGE)/ + install -m 644 $(PACKAGE).1.gz $(DESTDIR)$(PREFIX)/share/man/man1/ + +options: + @echo PACKAGE = $(PACKAGE) + @echo DESTDIR = $(DESTDIR) + @echo PREFIX = $(PREFIX) + @echo remusr = $(remusr) + @echo msgfmt_location = $(msgfmt_location) + @echo OS = $(OS) + +.PHONY: options all remove # EOF diff -Nru metamorphose2-0.8.4/manpage.1 metamorphose2-0.8.4+git20160722/manpage.1 --- metamorphose2-0.8.4/manpage.1 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/manpage.1 2017-01-25 12:35:14.000000000 +0000 @@ -63,13 +63,15 @@ .TP -c, --config Specify a configuration file to load. .TP --a, --auto Specify automatic mode level to use with configuration file : +-a, --auto Specify automatic mode level to use with configuration file: 0 = do not preview items 1 = auto preview items 2 = auto rename items 3 = auto rename items and exit on success .TP -l, --language Override the preferred language. +.TP +-w, --wxversion Specify wxPython Version - use at your own risk! .SH FILES .B ~/.metamorphose2/ @@ -90,7 +92,7 @@ .SH RESOURCES -Python 2.6, wxPython 2.8, Python Imaging Library (PIL), mutagen +Python 2.7, wxPython 2.8, Python Imaging Library (PIL), mutagen .SH "SEE ALSO" .BR python(1) @@ -112,7 +114,7 @@ .SH BUGS Please check the bug reports at the project page: .P -.B http://sourceforge.net/projects/file-folder-ren +.B https://github.com/metamorphose/metamorphose2 .SH AUTHOR Ianaré Sévi (ianare@gmail.com) diff -Nru metamorphose2-0.8.4/messages/Makefile metamorphose2-0.8.4+git20160722/messages/Makefile --- metamorphose2-0.8.4/messages/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/messages/Makefile 2017-01-25 12:35:14.000000000 +0000 @@ -0,0 +1,59 @@ +# +# Makefile +# +# Update or create all translation files. +# + +include ../common.mk +msgfmt_location=$(shell which msgfmt) + +build: + @for lang in $$(ls); do\ + if [ -d $$lang ]; then\ + echo building "$$lang/LC_MESSAGES/metamorphose2.mo";\ + mkdir -p $$lang/LC_MESSAGES;\ + $(msgfmt_location) -o $$lang/LC_MESSAGES/metamorphose2.mo $$lang/$$lang.po;\ + fi;\ + done; + +clean: + @for lang in $$(ls); do\ + if [ -d $$lang ]; then\ + echo deleting "$$lang/LC_MESSAGES/metamorphose2.mo";\ + rm $$lang/LC_MESSAGES/metamorphose2.mo;\ + rmdir $$lang/LC_MESSAGES;\ + fi;\ + done; + +copy: + @for lang in $$(ls); do\ + if [ -d $$lang ]; then\ + echo copying to "$(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES/metamorphose2.mo";\ + mkdir -p $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES;\ + cp $$lang/LC_MESSAGES/*.mo $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES/;\ + fi;\ + done; + +install: build copy clean + +uninstall: + @for lang in $$(ls); do\ + if [ -d $$lang ]; then\ + echo deleting "$(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES/metamorphose2.mo";\ + rm $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES/*.mo;\ + echo deleting $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES;\ + rmdir -p $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES > /dev/null 2>&1;\ + fi;\ + done; + +options: + @echo PACKAGE = $(PACKAGE) + @echo DESTDIR = $(DESTDIR) + @echo PREFIX = $(PREFIX) + @echo remusr = $(remusr) + @echo msgfmt_location = $(msgfmt_location) + @echo OS = $(OS) + +.PHONY: options install uninstall + +# EOF diff -Nru metamorphose2-0.8.4/messages/update_langs.sh metamorphose2-0.8.4+git20160722/messages/update_langs.sh --- metamorphose2-0.8.4/messages/update_langs.sh 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/messages/update_langs.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# -# Update or create all translation files. -# - -# XXX TODO Verify compatibility on non-Bourne shells such as zsh - -if [ "$(uname)" == "Linux" ]; then - msgfmt_location='/usr/bin/msgfmt' -elif [ "$(uname)" == "FreeBSD" ]; then - msgfmt_location='/usr/local/bin/msgfmt' -fi - -msgs_dir=$( cd "$( dirname "${0}" )" && pwd ) - -cd $msgs_dir -for dir in `ls -1`; do - if [ -d $dir ]; then - if [ ! -d $dir/LC_MESSAGES ]; then - mkdir $dir/LC_MESSAGES - fi - echo "$msgs_dir/$dir/LC_MESSAGES/metamorphose2.mo" - $msgfmt_location -o $dir/LC_MESSAGES/metamorphose2.mo $dir/$dir.po - rm -f $dir/*.mo - fi -done - diff -Nru metamorphose2-0.8.4/metamorphose2 metamorphose2-0.8.4+git20160722/metamorphose2 --- metamorphose2-0.8.4/metamorphose2 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/metamorphose2 2017-01-25 12:35:14.000000000 +0000 @@ -4,7 +4,8 @@ MAIN= #findPrefix -if [ -x /bin/rpm ];then +if [ -x /bin/rpm ] +then MAIN=`rpm -ql metamorphose2|grep metamorphose2.py` if [ -f "$MAIN" ];then exec python $MAIN "$@" @@ -14,9 +15,9 @@ #findPrefixEnd #run -if [ -d "$PREFIX/share/metamorphose2" ]; +if [ -d "$PREFIX/share/metamorphose2" ] then - exec python $PREFIX/share/metamorphose2/metamorphose2.py "$@"; + exec python $PREFIX/share/metamorphose2/metamorphose2.py "$@" else - exec python src/metamorphose2.py "$@"; -fi; + exec python src/metamorphose2.py "$@" +fi diff -Nru metamorphose2-0.8.4/pkg-descr metamorphose2-0.8.4+git20160722/pkg-descr --- metamorphose2-0.8.4/pkg-descr 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/pkg-descr 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -A graphical, cross platform, mass renaming tool with many powerful functions. Well suited for those -that need to rename many files and/or folders on a regular basis. In addition to -general usage operations, it is useful for photo and music collections, -webmasters, programmers, legal and clerical, et cetera. - -Some features include the use of regular expressions, providing a preview prior to changes, and -acting recursively through directories and subdirectories. \ No newline at end of file diff -Nru metamorphose2-0.8.4/pkg-plist metamorphose2-0.8.4+git20160722/pkg-plist --- metamorphose2-0.8.4/pkg-plist 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/pkg-plist 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -a -list -of -all -the -files -that -will -be -installed -by -the -port \ No newline at end of file diff -Nru metamorphose2-0.8.4/README.rst metamorphose2-0.8.4+git20160722/README.rst --- metamorphose2-0.8.4/README.rst 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/README.rst 2017-01-25 12:35:14.000000000 +0000 @@ -6,19 +6,21 @@ These are the command line options:: - -h, --help Show the help screen and exit - -t, --timer Show time taken to complete operations - -d, --debug Show debugging information - -p=, --path= Specify a directory to load - -c=, --config= Specify a Metamorphose2 config file to load - -a=, --auto= Specify automatic mode level (when also using -c option): - 0 = do not preview items (will overide preferences) - 1 = auto preview items (will overide preferences) + -h, --help Show help screen and exit. + -t, --timer Show time taken to complete operations. + -d, --debug Show debugging information. + -p=, --path Specify a directory to load. + -c=, --config Specify a configuration file to load. + -a=, --auto Specify automatic mode level to use with configuration file: + 0 = do not preview items + 1 = auto preview items 2 = auto rename items 3 = auto rename items and exit on success - -l=, --language= Overide prefered interface language: + -l=, --language Override preferred language: en_US fr + es + -w=, --wxversion Specify wxPython Version - use at your own risk! If no other options are given, you may specify a path to open:: @@ -49,10 +51,9 @@ Requirements ============ -- Python: version 2.6 or 2.7 (*not* compatible with 3.x) -- wxPython: version 2.8 +- Python 2.6 or 2.7 (*not* compatible with 3.x) +- wxPython 2.8 (preferred) or 3.0 - Python Imaging Library (PIL) 1.1.6 or greater **or** Pillow 2.3.0 or greater -- Mutagen: version 1.21 or greater Running @@ -72,10 +73,7 @@ As root:: - make build - make install - -``build`` makes the directory structure, ``install`` copies the sources and byte-compiles them. + make all Under Linux & freeBSD The makefile should take care of everything for you, it is architecture and distro independant. diff -Nru metamorphose2-0.8.4/src/about.py metamorphose2-0.8.4+git20160722/src/about.py --- metamorphose2-0.8.4/src/about.py 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/about.py 2017-01-25 12:35:14.000000000 +0000 @@ -33,6 +33,15 @@ class About(wx.Dialog): """The about dialog.""" + + def _get_wxversion(self): + """Get the wxPython Version.""" + wxVer = "" + for x in wx.VERSION: + wxVer = wxVer + str(x) + "." + wxVer = wxVer.rstrip(".") + return wxVer + def __init_sizer(self): bottomRow = wx.BoxSizer(wx.HORIZONTAL) bottomRow.Add(self.bugReport, 0, wx.ALIGN_CENTER | wx.RIGHT) @@ -91,7 +100,7 @@ self.wxVersion = wx.StaticText(id=wxID_ABOUTWXVERSION, label=_(u"Using Python %s, wxPython %s") % ( platform.python_version(), - utils.get_wxversion() + self._get_wxversion() ), name=u'version', parent=self) self.wxVersion.SetFont(wx.Font(fontSize + 1, fontFamily, fontStyle, wx.NORMAL, False)) diff -Nru metamorphose2-0.8.4/src/app.py metamorphose2-0.8.4+git20160722/src/app.py --- metamorphose2-0.8.4/src/app.py 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/app.py 2017-01-25 12:35:14.000000000 +0000 @@ -23,10 +23,10 @@ here than in the utils module. """ -homedir = 'metamorphose2' -if os.sep == '/': - homedir = '.' + homedir +# +# Functions +# def debug_print(msg): """Print debug messages to screen, if debugging is enabled.""" @@ -49,28 +49,16 @@ break if not path: print("Could not determine application path.\nMake sure the application is correctly installed.\n") - sys.exit(); + sys.exit(1); #print(path) return os.path.join(path) realPath = __set_real_path() -def get_real_path(file): +def get_real_path(path): """Return application path for file.""" - return os.path.join(realPath, file) - - -def __get_version(): - """Get current version from file.""" - try: - f = open(get_real_path("version")) - except: - v = 'unknown' - else: - v = f.readline().strip() - f.close() - return v + u' (beta)' + return os.path.join(realPath, path) def locale_path(lang): @@ -85,40 +73,62 @@ else: return get_real_path(u'../messages') + # -#--- Variables +# Basic Variables # -# Application version -version = __get_version() +# home directory, for config files and such +homedir = 'metamorphose2' +if os.sep == '/': + homedir = '.' + homedir + +# Application versions +__f = open(get_real_path("version")) +version = __f.readline().strip() +prefsVersion = __f.readline().strip() +__f.close() + # Interface language language = '' + # Items with warnings warn = [] + # Items with errors bad = [] + # All errors errorLog = [] + # Items to rename items = [] + # Has regular expression error message REmsg = False + # If true, will need to sort items before renaming recursiveFolderOn = False + # Automatic mode level autoModeLevel = False + # Show processing times showTimes = False + # Show debug info debug = False + # Font parameters fontParams = {} + # Running in GUI or CLI mode (future) cliMode = False # -#--- Objects +# Classes # # preferences object to be set on load prefs = False + diff -Nru metamorphose2-0.8.4/src/exif/ChangeLog.rst metamorphose2-0.8.4+git20160722/src/exif/ChangeLog.rst --- metamorphose2-0.8.4/src/exif/ChangeLog.rst 2015-09-14 16:22:25.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/ChangeLog.rst 2017-01-25 12:35:16.000000000 +0000 @@ -2,11 +2,6 @@ Change Log ********** -2.1.2 — 2015-09-14 - * Fix 90 CW (6) and Rotated 90 CCW (8) which were swapped with each other (Mark Hahnenberg) - * Catch memory and overflow errors on file seek, print a warning - * Put manufacturers' makernote definitions in separate files - 2.1.1 — 2015-05-16 * Add a CONTRIBUTING file for Github. * Add some FujiFilm tags. diff -Nru metamorphose2-0.8.4/src/exif/EXIF.py metamorphose2-0.8.4+git20160722/src/exif/EXIF.py --- metamorphose2-0.8.4/src/exif/EXIF.py 2015-09-14 16:22:25.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/EXIF.py 2017-01-25 12:35:16.000000000 +0000 @@ -79,7 +79,7 @@ if option in ("-c", "--color"): color = True - if not args: + if args == []: usage(2) exif_log.setup_logger(debug, color) diff -Nru metamorphose2-0.8.4/src/exif/exifread/classes.py metamorphose2-0.8.4+git20160722/src/exif/exifread/classes.py --- metamorphose2-0.8.4/src/exif/exifread/classes.py 2015-09-14 16:22:25.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/exifread/classes.py 2017-01-25 12:35:16.000000000 +0000 @@ -180,11 +180,10 @@ # XXX investigate # sometimes gets too big to fit in int value if count != 0: # and count < (2**31): # 2E31 is hardware dependant. --gd - file_position = self.offset + offset try: - self.file.seek(file_position) + self.file.seek(self.offset + offset) values = self.file.read(count) - #print(values) + #print values # Drop any garbage after a null. values = values.split(b'\x00', 1)[0] if isinstance(values, bytes): @@ -193,10 +192,6 @@ except UnicodeDecodeError: logger.warning("Possibly corrupted field %s in %s IFD", tag_name, ifd_name) except OverflowError: - logger.warn('OverflowError at position: %s, length: %s', file_position, count) - values = '' - except MemoryError: - logger.warn('MemoryError at position: %s, length: %s', file_position, count) values = '' else: values = [] @@ -389,25 +384,26 @@ if note.values[0:7] == [78, 105, 107, 111, 110, 0, 1]: logger.debug("Looks like a type 1 Nikon MakerNote.") self.dump_ifd(note.field_offset + 8, 'MakerNote', - tag_dict=makernote.nikon.TAGS_OLD) + tag_dict=makernote.NIKON_OLD) elif note.values[0:7] == [78, 105, 107, 111, 110, 0, 2]: - logger.debug("Looks like a labeled type 2 Nikon MakerNote") + if self.debug: + logger.debug("Looks like a labeled type 2 Nikon MakerNote") if note.values[12:14] != [0, 42] and note.values[12:14] != [42, 0]: raise ValueError("Missing marker tag '42' in MakerNote.") # skip the Makernote label and the TIFF header self.dump_ifd(note.field_offset + 10 + 8, 'MakerNote', - tag_dict=makernote.nikon.TAGS_NEW, relative=1) + tag_dict=makernote.NIKON_NEW, relative=1) else: # E99x or D1 logger.debug("Looks like an unlabeled type 2 Nikon MakerNote") self.dump_ifd(note.field_offset, 'MakerNote', - tag_dict=makernote.nikon.TAGS_NEW) + tag_dict=makernote.NIKON_NEW) return # Olympus if make.startswith('OLYMPUS'): self.dump_ifd(note.field_offset + 8, 'MakerNote', - tag_dict=makernote.olympus.TAGS) + tag_dict=makernote.OLYMPUS) # TODO #for i in (('MakerNote Tag 0x2020', makernote.OLYMPUS_TAG_0x2020),): # self.decode_olympus_tag(self.tags[i[0]].values, i[1]) @@ -416,7 +412,7 @@ # Casio if 'CASIO' in make or 'Casio' in make: self.dump_ifd(note.field_offset, 'MakerNote', - tag_dict=makernote.casio.TAGS) + tag_dict=makernote.CASIO) return # Fujifilm @@ -437,8 +433,9 @@ return # Apple - if make == 'Apple' and \ - note.values[0:10] == [65, 112, 112, 108, 101, 32, 105, 79, 83, 0]: + if (make == 'Apple') and \ + (note.values[0:10] == \ + [65, 112, 112, 108, 101, 32, 105, 79, 83, 0]): t = self.offset self.offset += note.field_offset+14 self.dump_ifd(0, 'MakerNote', diff -Nru metamorphose2-0.8.4/src/exif/exifread/__init__.py metamorphose2-0.8.4+git20160722/src/exif/exifread/__init__.py --- metamorphose2-0.8.4/src/exif/exifread/__init__.py 2015-09-14 16:22:25.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/exifread/__init__.py 2017-01-25 12:35:16.000000000 +0000 @@ -7,7 +7,7 @@ from .tags import * from .utils import ord_ -__version__ = '2.1.2' +__version__ = '2.1.1' logger = get_logger() diff -Nru metamorphose2-0.8.4/src/exif/exifread/tags/exif.py metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/exif.py --- metamorphose2-0.8.4/src/exif/exifread/tags/exif.py 2015-09-14 16:22:25.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/exif.py 2017-01-25 12:35:16.000000000 +0000 @@ -126,9 +126,9 @@ 3: 'Rotated 180', 4: 'Mirrored vertical', 5: 'Mirrored horizontal then rotated 90 CCW', - 6: 'Rotated 90 CW', + 6: 'Rotated 90 CCW', 7: 'Mirrored horizontal then rotated 90 CW', - 8: 'Rotated 90 CCW' + 8: 'Rotated 90 CW' }), 0x0115: ('SamplesPerPixel', ), 0x0116: ('RowsPerStrip', ), diff -Nru metamorphose2-0.8.4/src/exif/exifread/tags/__init__.py metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/__init__.py --- metamorphose2-0.8.4/src/exif/exifread/tags/__init__.py 2015-09-14 16:22:25.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/__init__.py 2017-01-25 12:35:16.000000000 +0000 @@ -3,7 +3,7 @@ """ from .exif import * -from .makernote import * +from . import makernote DEFAULT_STOP_TAG = 'UNDEF' diff -Nru metamorphose2-0.8.4/src/exif/exifread/tags/makernote/apple.py metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/makernote/apple.py --- metamorphose2-0.8.4/src/exif/exifread/tags/makernote/apple.py 2015-09-14 16:22:25.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/makernote/apple.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -""" -Makernote (proprietary) tag definitions for Apple iOS - -Based on version 1.01 of ExifTool -> Image/ExifTool/Apple.pm -http://owl.phy.queensu.ca/~phil/exiftool/ -""" - -TAGS = { - 0x000a: ('HDRImageType', { - 3: 'HDR Image', - 4: 'Original Image', - }), -} diff -Nru metamorphose2-0.8.4/src/exif/exifread/tags/makernote/canon.py metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/makernote/canon.py --- metamorphose2-0.8.4/src/exif/exifread/tags/makernote/canon.py 2015-09-14 16:22:25.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/makernote/canon.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,711 +0,0 @@ -""" -Makernote (proprietary) tag definitions for Canon. - -http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html -""" - -TAGS = { - 0x0003: ('FlashInfo',), - 0x0006: ('ImageType', ), - 0x0007: ('FirmwareVersion', ), - 0x0008: ('ImageNumber', ), - 0x0009: ('OwnerName', ), - 0x000c: ('SerialNumber', ), - 0x000e: ('FileLength', ), - 0x0010: ('ModelID', { - 0x1010000: 'PowerShot A30', - 0x1040000: 'PowerShot S300 / Digital IXUS 300 / IXY Digital 300', - 0x1060000: 'PowerShot A20', - 0x1080000: 'PowerShot A10', - 0x1090000: 'PowerShot S110 / Digital IXUS v / IXY Digital 200', - 0x1100000: 'PowerShot G2', - 0x1110000: 'PowerShot S40', - 0x1120000: 'PowerShot S30', - 0x1130000: 'PowerShot A40', - 0x1140000: 'EOS D30', - 0x1150000: 'PowerShot A100', - 0x1160000: 'PowerShot S200 / Digital IXUS v2 / IXY Digital 200a', - 0x1170000: 'PowerShot A200', - 0x1180000: 'PowerShot S330 / Digital IXUS 330 / IXY Digital 300a', - 0x1190000: 'PowerShot G3', - 0x1210000: 'PowerShot S45', - 0x1230000: 'PowerShot SD100 / Digital IXUS II / IXY Digital 30', - 0x1240000: 'PowerShot S230 / Digital IXUS v3 / IXY Digital 320', - 0x1250000: 'PowerShot A70', - 0x1260000: 'PowerShot A60', - 0x1270000: 'PowerShot S400 / Digital IXUS 400 / IXY Digital 400', - 0x1290000: 'PowerShot G5', - 0x1300000: 'PowerShot A300', - 0x1310000: 'PowerShot S50', - 0x1340000: 'PowerShot A80', - 0x1350000: 'PowerShot SD10 / Digital IXUS i / IXY Digital L', - 0x1360000: 'PowerShot S1 IS', - 0x1370000: 'PowerShot Pro1', - 0x1380000: 'PowerShot S70', - 0x1390000: 'PowerShot S60', - 0x1400000: 'PowerShot G6', - 0x1410000: 'PowerShot S500 / Digital IXUS 500 / IXY Digital 500', - 0x1420000: 'PowerShot A75', - 0x1440000: 'PowerShot SD110 / Digital IXUS IIs / IXY Digital 30a', - 0x1450000: 'PowerShot A400', - 0x1470000: 'PowerShot A310', - 0x1490000: 'PowerShot A85', - 0x1520000: 'PowerShot S410 / Digital IXUS 430 / IXY Digital 450', - 0x1530000: 'PowerShot A95', - 0x1540000: 'PowerShot SD300 / Digital IXUS 40 / IXY Digital 50', - 0x1550000: 'PowerShot SD200 / Digital IXUS 30 / IXY Digital 40', - 0x1560000: 'PowerShot A520', - 0x1570000: 'PowerShot A510', - 0x1590000: 'PowerShot SD20 / Digital IXUS i5 / IXY Digital L2', - 0x1640000: 'PowerShot S2 IS', - 0x1650000: 'PowerShot SD430 / Digital IXUS Wireless / IXY Digital Wireless', - 0x1660000: 'PowerShot SD500 / Digital IXUS 700 / IXY Digital 600', - 0x1668000: 'EOS D60', - 0x1700000: 'PowerShot SD30 / Digital IXUS i Zoom / IXY Digital L3', - 0x1740000: 'PowerShot A430', - 0x1750000: 'PowerShot A410', - 0x1760000: 'PowerShot S80', - 0x1780000: 'PowerShot A620', - 0x1790000: 'PowerShot A610', - 0x1800000: 'PowerShot SD630 / Digital IXUS 65 / IXY Digital 80', - 0x1810000: 'PowerShot SD450 / Digital IXUS 55 / IXY Digital 60', - 0x1820000: 'PowerShot TX1', - 0x1870000: 'PowerShot SD400 / Digital IXUS 50 / IXY Digital 55', - 0x1880000: 'PowerShot A420', - 0x1890000: 'PowerShot SD900 / Digital IXUS 900 Ti / IXY Digital 1000', - 0x1900000: 'PowerShot SD550 / Digital IXUS 750 / IXY Digital 700', - 0x1920000: 'PowerShot A700', - 0x1940000: 'PowerShot SD700 IS / Digital IXUS 800 IS / IXY Digital 800 IS', - 0x1950000: 'PowerShot S3 IS', - 0x1960000: 'PowerShot A540', - 0x1970000: 'PowerShot SD600 / Digital IXUS 60 / IXY Digital 70', - 0x1980000: 'PowerShot G7', - 0x1990000: 'PowerShot A530', - 0x2000000: 'PowerShot SD800 IS / Digital IXUS 850 IS / IXY Digital 900 IS', - 0x2010000: 'PowerShot SD40 / Digital IXUS i7 / IXY Digital L4', - 0x2020000: 'PowerShot A710 IS', - 0x2030000: 'PowerShot A640', - 0x2040000: 'PowerShot A630', - 0x2090000: 'PowerShot S5 IS', - 0x2100000: 'PowerShot A460', - 0x2120000: 'PowerShot SD850 IS / Digital IXUS 950 IS / IXY Digital 810 IS', - 0x2130000: 'PowerShot A570 IS', - 0x2140000: 'PowerShot A560', - 0x2150000: 'PowerShot SD750 / Digital IXUS 75 / IXY Digital 90', - 0x2160000: 'PowerShot SD1000 / Digital IXUS 70 / IXY Digital 10', - 0x2180000: 'PowerShot A550', - 0x2190000: 'PowerShot A450', - 0x2230000: 'PowerShot G9', - 0x2240000: 'PowerShot A650 IS', - 0x2260000: 'PowerShot A720 IS', - 0x2290000: 'PowerShot SX100 IS', - 0x2300000: 'PowerShot SD950 IS / Digital IXUS 960 IS / IXY Digital 2000 IS', - 0x2310000: 'PowerShot SD870 IS / Digital IXUS 860 IS / IXY Digital 910 IS', - 0x2320000: 'PowerShot SD890 IS / Digital IXUS 970 IS / IXY Digital 820 IS', - 0x2360000: 'PowerShot SD790 IS / Digital IXUS 90 IS / IXY Digital 95 IS', - 0x2370000: 'PowerShot SD770 IS / Digital IXUS 85 IS / IXY Digital 25 IS', - 0x2380000: 'PowerShot A590 IS', - 0x2390000: 'PowerShot A580', - 0x2420000: 'PowerShot A470', - 0x2430000: 'PowerShot SD1100 IS / Digital IXUS 80 IS / IXY Digital 20 IS', - 0x2460000: 'PowerShot SX1 IS', - 0x2470000: 'PowerShot SX10 IS', - 0x2480000: 'PowerShot A1000 IS', - 0x2490000: 'PowerShot G10', - 0x2510000: 'PowerShot A2000 IS', - 0x2520000: 'PowerShot SX110 IS', - 0x2530000: 'PowerShot SD990 IS / Digital IXUS 980 IS / IXY Digital 3000 IS', - 0x2540000: 'PowerShot SD880 IS / Digital IXUS 870 IS / IXY Digital 920 IS', - 0x2550000: 'PowerShot E1', - 0x2560000: 'PowerShot D10', - 0x2570000: 'PowerShot SD960 IS / Digital IXUS 110 IS / IXY Digital 510 IS', - 0x2580000: 'PowerShot A2100 IS', - 0x2590000: 'PowerShot A480', - 0x2600000: 'PowerShot SX200 IS', - 0x2610000: 'PowerShot SD970 IS / Digital IXUS 990 IS / IXY Digital 830 IS', - 0x2620000: 'PowerShot SD780 IS / Digital IXUS 100 IS / IXY Digital 210 IS', - 0x2630000: 'PowerShot A1100 IS', - 0x2640000: 'PowerShot SD1200 IS / Digital IXUS 95 IS / IXY Digital 110 IS', - 0x2700000: 'PowerShot G11', - 0x2710000: 'PowerShot SX120 IS', - 0x2720000: 'PowerShot S90', - 0x2750000: 'PowerShot SX20 IS', - 0x2760000: 'PowerShot SD980 IS / Digital IXUS 200 IS / IXY Digital 930 IS', - 0x2770000: 'PowerShot SD940 IS / Digital IXUS 120 IS / IXY Digital 220 IS', - 0x2800000: 'PowerShot A495', - 0x2810000: 'PowerShot A490', - 0x2820000: 'PowerShot A3100 IS / A3150 IS', - 0x2830000: 'PowerShot A3000 IS', - 0x2840000: 'PowerShot SD1400 IS / IXUS 130 / IXY 400F', - 0x2850000: 'PowerShot SD1300 IS / IXUS 105 / IXY 200F', - 0x2860000: 'PowerShot SD3500 IS / IXUS 210 / IXY 10S', - 0x2870000: 'PowerShot SX210 IS', - 0x2880000: 'PowerShot SD4000 IS / IXUS 300 HS / IXY 30S', - 0x2890000: 'PowerShot SD4500 IS / IXUS 1000 HS / IXY 50S', - 0x2920000: 'PowerShot G12', - 0x2930000: 'PowerShot SX30 IS', - 0x2940000: 'PowerShot SX130 IS', - 0x2950000: 'PowerShot S95', - 0x2980000: 'PowerShot A3300 IS', - 0x2990000: 'PowerShot A3200 IS', - 0x3000000: 'PowerShot ELPH 500 HS / IXUS 310 HS / IXY 31S', - 0x3010000: 'PowerShot Pro90 IS', - 0x3010001: 'PowerShot A800', - 0x3020000: 'PowerShot ELPH 100 HS / IXUS 115 HS / IXY 210F', - 0x3030000: 'PowerShot SX230 HS', - 0x3040000: 'PowerShot ELPH 300 HS / IXUS 220 HS / IXY 410F', - 0x3050000: 'PowerShot A2200', - 0x3060000: 'PowerShot A1200', - 0x3070000: 'PowerShot SX220 HS', - 0x3080000: 'PowerShot G1 X', - 0x3090000: 'PowerShot SX150 IS', - 0x3100000: 'PowerShot ELPH 510 HS / IXUS 1100 HS / IXY 51S', - 0x3110000: 'PowerShot S100 (new)', - 0x3130000: 'PowerShot SX40 HS', - 0x3120000: 'PowerShot ELPH 310 HS / IXUS 230 HS / IXY 600F', - 0x3160000: 'PowerShot A1300', - 0x3170000: 'PowerShot A810', - 0x3180000: 'PowerShot ELPH 320 HS / IXUS 240 HS / IXY 420F', - 0x3190000: 'PowerShot ELPH 110 HS / IXUS 125 HS / IXY 220F', - 0x3200000: 'PowerShot D20', - 0x3210000: 'PowerShot A4000 IS', - 0x3220000: 'PowerShot SX260 HS', - 0x3230000: 'PowerShot SX240 HS', - 0x3240000: 'PowerShot ELPH 530 HS / IXUS 510 HS / IXY 1', - 0x3250000: 'PowerShot ELPH 520 HS / IXUS 500 HS / IXY 3', - 0x3260000: 'PowerShot A3400 IS', - 0x3270000: 'PowerShot A2400 IS', - 0x3280000: 'PowerShot A2300', - 0x3330000: 'PowerShot G15', - 0x3340000: 'PowerShot SX50', - 0x3350000: 'PowerShot SX160 IS', - 0x3360000: 'PowerShot S110 (new)', - 0x3370000: 'PowerShot SX500 IS', - 0x3380000: 'PowerShot N', - 0x3390000: 'IXUS 245 HS / IXY 430F', - 0x3400000: 'PowerShot SX280 HS', - 0x3410000: 'PowerShot SX270 HS', - 0x3420000: 'PowerShot A3500 IS', - 0x3430000: 'PowerShot A2600', - 0x3450000: 'PowerShot A1400', - 0x3460000: 'PowerShot ELPH 130 IS / IXUS 140 / IXY 110F', - 0x3470000: 'PowerShot ELPH 115/120 IS / IXUS 132/135 / IXY 90F/100F', - 0x3490000: 'PowerShot ELPH 330 HS / IXUS 255 HS / IXY 610F', - 0x3510000: 'PowerShot A2500', - 0x3540000: 'PowerShot G16', - 0x3550000: 'PowerShot S120', - 0x3560000: 'PowerShot SX170 IS', - 0x3580000: 'PowerShot SX510 HS', - 0x3590000: 'PowerShot S200 (new)', - 0x3600000: 'IXY 620F', - 0x3610000: 'PowerShot N100', - 0x3640000: 'PowerShot G1 X Mark II', - 0x3650000: 'PowerShot D30', - 0x3660000: 'PowerShot SX700 HS', - 0x3670000: 'PowerShot SX600 HS', - 0x3680000: 'PowerShot ELPH 140 IS / IXUS 150 / IXY 130', - 0x3690000: 'PowerShot ELPH 135 / IXUS 145 / IXY 120', - 0x3700000: 'PowerShot ELPH 340 HS / IXUS 265 HS / IXY 630', - 0x3710000: 'PowerShot ELPH 150 IS / IXUS 155 / IXY 140', - 0x3740000: 'EOS M3', - 0x3750000: 'PowerShot SX60 HS', - 0x3760000: 'PowerShot SX520 HS', - 0x3770000: 'PowerShot SX400 IS', - 0x3780000: 'PowerShot G7 X', - 0x3790000: 'PowerShot N2', - 0x3800000: 'PowerShot SX530 HS', - 0x3820000: 'PowerShot SX710 HS', - 0x3830000: 'PowerShot SX610 HS', - 0x3870000: 'PowerShot ELPH 160 / IXUS 160', - 0x3890000: 'PowerShot ELPH 170 IS / IXUS 170', - 0x3910000: 'PowerShot SX410 IS', - 0x4040000: 'PowerShot G1', - 0x6040000: 'PowerShot S100 / Digital IXUS / IXY Digital', - 0x4007d673: 'DC19/DC21/DC22', - 0x4007d674: 'XH A1', - 0x4007d675: 'HV10', - 0x4007d676: 'MD130/MD140/MD150/MD160/ZR850', - 0x4007d777: 'DC50', - 0x4007d778: 'HV20', - 0x4007d779: 'DC211', - 0x4007d77a: 'HG10', - 0x4007d77b: 'HR10', - 0x4007d77d: 'MD255/ZR950', - 0x4007d81c: 'HF11', - 0x4007d878: 'HV30', - 0x4007d87c: 'XH A1S', - 0x4007d87e: 'DC301/DC310/DC311/DC320/DC330', - 0x4007d87f: 'FS100', - 0x4007d880: 'HF10', - 0x4007d882: 'HG20/HG21', - 0x4007d925: 'HF21', - 0x4007d926: 'HF S11', - 0x4007d978: 'HV40', - 0x4007d987: 'DC410/DC411/DC420', - 0x4007d988: 'FS19/FS20/FS21/FS22/FS200', - 0x4007d989: 'HF20/HF200', - 0x4007d98a: 'HF S10/S100', - 0x4007da8e: 'HF R10/R16/R17/R18/R100/R106', - 0x4007da8f: 'HF M30/M31/M36/M300/M306', - 0x4007da90: 'HF S20/S21/S200', - 0x4007da92: 'FS31/FS36/FS37/FS300/FS305/FS306/FS307', - 0x4007dda9: 'HF G25', - 0x80000001: 'EOS-1D', - 0x80000167: 'EOS-1DS', - 0x80000168: 'EOS 10D', - 0x80000169: 'EOS-1D Mark III', - 0x80000170: 'EOS Digital Rebel / 300D / Kiss Digital', - 0x80000174: 'EOS-1D Mark II', - 0x80000175: 'EOS 20D', - 0x80000176: 'EOS Digital Rebel XSi / 450D / Kiss X2', - 0x80000188: 'EOS-1Ds Mark II', - 0x80000189: 'EOS Digital Rebel XT / 350D / Kiss Digital N', - 0x80000190: 'EOS 40D', - 0x80000213: 'EOS 5D', - 0x80000215: 'EOS-1Ds Mark III', - 0x80000218: 'EOS 5D Mark II', - 0x80000219: 'WFT-E1', - 0x80000232: 'EOS-1D Mark II N', - 0x80000234: 'EOS 30D', - 0x80000236: 'EOS Digital Rebel XTi / 400D / Kiss Digital X', - 0x80000241: 'WFT-E2', - 0x80000246: 'WFT-E3', - 0x80000250: 'EOS 7D', - 0x80000252: 'EOS Rebel T1i / 500D / Kiss X3', - 0x80000254: 'EOS Rebel XS / 1000D / Kiss F', - 0x80000261: 'EOS 50D', - 0x80000269: 'EOS-1D X', - 0x80000270: 'EOS Rebel T2i / 550D / Kiss X4', - 0x80000271: 'WFT-E4', - 0x80000273: 'WFT-E5', - 0x80000281: 'EOS-1D Mark IV', - 0x80000285: 'EOS 5D Mark III', - 0x80000286: 'EOS Rebel T3i / 600D / Kiss X5', - 0x80000287: 'EOS 60D', - 0x80000288: 'EOS Rebel T3 / 1100D / Kiss X50', - 0x80000289: 'EOS 7D Mark II', - 0x80000297: 'WFT-E2 II', - 0x80000298: 'WFT-E4 II', - 0x80000301: 'EOS Rebel T4i / 650D / Kiss X6i', - 0x80000302: 'EOS 6D', - 0x80000324: 'EOS-1D C', - 0x80000325: 'EOS 70D', - 0x80000326: 'EOS Rebel T5i / 700D / Kiss X7i', - 0x80000327: 'EOS Rebel T5 / 1200D / Kiss X70', - 0x80000331: 'EOS M', - 0x80000355: 'EOS M2', - 0x80000346: 'EOS Rebel SL1 / 100D / Kiss X7', - 0x80000347: 'EOS Rebel T6s / 760D / 8000D', - 0x80000382: 'EOS 5DS', - 0x80000393: 'EOS Rebel T6i / 750D / Kiss X8i', - 0x80000401: 'EOS 5DS R', - }), - 0x0013: ('ThumbnailImageValidArea', ), - 0x0015: ('SerialNumberFormat', { - 0x90000000: 'Format 1', - 0xA0000000: 'Format 2' - }), - 0x001a: ('SuperMacro', { - 0: 'Off', - 1: 'On (1)', - 2: 'On (2)' - }), - 0x001c: ('DateStampMode', { - 0: 'Off', - 1: 'Date', - 2: 'Date & Time', - }), - 0x001e: ('FirmwareRevision', ), - 0x0028: ('ImageUniqueID', ), - 0x0095: ('LensModel', ), - 0x0096: ('InternalSerialNumber ', ), - 0x0097: ('DustRemovalData ', ), - 0x0098: ('CropInfo ', ), - 0x009a: ('AspectInfo', ), - 0x00b4: ('ColorSpace', { - 1: 'sRGB', - 2: 'Adobe RGB' - }), -} - -# this is in element offset, name, optional value dictionary format -# 0x0001 -CAMERA_SETTINGS = { - 1: ('Macromode', { - 1: 'Macro', - 2: 'Normal' - }), - 2: ('SelfTimer', ), - 3: ('Quality', { - 1: 'Economy', - 2: 'Normal', - 3: 'Fine', - 5: 'Superfine' - }), - 4: ('FlashMode', { - 0: 'Flash Not Fired', - 1: 'Auto', - 2: 'On', - 3: 'Red-Eye Reduction', - 4: 'Slow Synchro', - 5: 'Auto + Red-Eye Reduction', - 6: 'On + Red-Eye Reduction', - 16: 'external flash' - }), - 5: ('ContinuousDriveMode', { - 0: 'Single Or Timer', - 1: 'Continuous', - 2: 'Movie', - }), - 7: ('FocusMode', { - 0: 'One-Shot', - 1: 'AI Servo', - 2: 'AI Focus', - 3: 'MF', - 4: 'Single', - 5: 'Continuous', - 6: 'MF' - }), - 9: ('RecordMode', { - 1: 'JPEG', - 2: 'CRW+THM', - 3: 'AVI+THM', - 4: 'TIF', - 5: 'TIF+JPEG', - 6: 'CR2', - 7: 'CR2+JPEG', - 9: 'Video' - }), - 10: ('ImageSize', { - 0: 'Large', - 1: 'Medium', - 2: 'Small' - }), - 11: ('EasyShootingMode', { - 0: 'Full Auto', - 1: 'Manual', - 2: 'Landscape', - 3: 'Fast Shutter', - 4: 'Slow Shutter', - 5: 'Night', - 6: 'B&W', - 7: 'Sepia', - 8: 'Portrait', - 9: 'Sports', - 10: 'Macro/Close-Up', - 11: 'Pan Focus', - 51: 'High Dynamic Range', - }), - 12: ('DigitalZoom', { - 0: 'None', - 1: '2x', - 2: '4x', - 3: 'Other' - }), - 13: ('Contrast', { - 0xFFFF: 'Low', - 0: 'Normal', - 1: 'High' - }), - 14: ('Saturation', { - 0xFFFF: 'Low', - 0: 'Normal', - 1: 'High' - }), - 15: ('Sharpness', { - 0xFFFF: 'Low', - 0: 'Normal', - 1: 'High' - }), - 16: ('ISO', { - 0: 'See ISOSpeedRatings Tag', - 15: 'Auto', - 16: '50', - 17: '100', - 18: '200', - 19: '400' - }), - 17: ('MeteringMode', { - 0: 'Default', - 1: 'Spot', - 2: 'Average', - 3: 'Evaluative', - 4: 'Partial', - 5: 'Center-weighted' - }), - 18: ('FocusType', { - 0: 'Manual', - 1: 'Auto', - 3: 'Close-Up (Macro)', - 8: 'Locked (Pan Mode)' - }), - 19: ('AFPointSelected', { - 0x3000: 'None (MF)', - 0x3001: 'Auto-Selected', - 0x3002: 'Right', - 0x3003: 'Center', - 0x3004: 'Left' - }), - 20: ('ExposureMode', { - 0: 'Easy Shooting', - 1: 'Program', - 2: 'Tv-priority', - 3: 'Av-priority', - 4: 'Manual', - 5: 'A-DEP' - }), - 22: ('LensType', ), - 23: ('LongFocalLengthOfLensInFocalUnits', ), - 24: ('ShortFocalLengthOfLensInFocalUnits', ), - 25: ('FocalUnitsPerMM', ), - 28: ('FlashActivity', { - 0: 'Did Not Fire', - 1: 'Fired' - }), - 29: ('FlashDetails', { - 0: 'Manual', - 1: 'TTL', - 2: 'A-TTL', - 3: 'E-TTL', - 4: 'FP Sync Enabled', - 7: '2nd("Rear")-Curtain Sync Used', - 11: 'FP Sync Used', - 13: 'Internal Flash', - 14: 'External E-TTL' - }), - 32: ('FocusMode', { - 0: 'Single', - 1: 'Continuous', - 8: 'Manual' - }), - 33: ('AESetting', { - 0: 'Normal AE', - 1: 'Exposure Compensation', - 2: 'AE Lock', - 3: 'AE Lock + Exposure Comp.', - 4: 'No AE' - }), - 34: ('ImageStabilization', { - 0: 'Off', - 1: 'On', - 2: 'Shoot Only', - 3: 'Panning', - 4: 'Dynamic', - 256: 'Off', - 257: 'On', - 258: 'Shoot Only', - 259: 'Panning', - 260: 'Dynamic' - }), - 39: ('SpotMeteringMode', { - 0: 'Center', - 1: 'AF Point' - }), - 41: ('ManualFlashOutput', { - 0x0: 'n/a', - 0x500: 'Full', - 0x502: 'Medium', - 0x504: 'Low', - 0x7fff: 'n/a' - }), -} - -# 0x0002 -FOCAL_LENGTH = { - 1: ('FocalType', { - 1: 'Fixed', - 2: 'Zoom', - }), - 2: ('FocalLength', ), -} - -# 0x0004 -SHOT_INFO = { - 7: ('WhiteBalance', { - 0: 'Auto', - 1: 'Sunny', - 2: 'Cloudy', - 3: 'Tungsten', - 4: 'Fluorescent', - 5: 'Flash', - 6: 'Custom' - }), - 8: ('SlowShutter', { - -1: 'n/a', - 0: 'Off', - 1: 'Night Scene', - 2: 'On', - 3: 'None' - }), - 9: ('SequenceNumber', ), - 14: ('AFPointUsed', ), - 15: ('FlashBias', { - 0xFFC0: '-2 EV', - 0xFFCC: '-1.67 EV', - 0xFFD0: '-1.50 EV', - 0xFFD4: '-1.33 EV', - 0xFFE0: '-1 EV', - 0xFFEC: '-0.67 EV', - 0xFFF0: '-0.50 EV', - 0xFFF4: '-0.33 EV', - 0x0000: '0 EV', - 0x000c: '0.33 EV', - 0x0010: '0.50 EV', - 0x0014: '0.67 EV', - 0x0020: '1 EV', - 0x002c: '1.33 EV', - 0x0030: '1.50 EV', - 0x0034: '1.67 EV', - 0x0040: '2 EV' - }), - 19: ('SubjectDistance', ), -} - -# 0x0026 -AF_INFO_2 = { - 2: ('AFAreaMode', { - 0: 'Off (Manual Focus)', - 2: 'Single-point AF', - 4: 'Multi-point AF or AI AF', - 5: 'Face Detect AF', - 6: 'Face + Tracking', - 7: 'Zone AF', - 8: 'AF Point Expansion', - 9: 'Spot AF', - 11: 'Flexizone Multi', - 13: 'Flexizone Single', - }), - 3: ('NumAFPoints', ), - 4: ('ValidAFPoints', ), - 5: ('CanonImageWidth', ), -} - -# 0x0093 -FILE_INFO = { - 1: ('FileNumber', ), - 3: ('BracketMode', { - 0: 'Off', - 1: 'AEB', - 2: 'FEB', - 3: 'ISO', - 4: 'WB', - }), - 4: ('BracketValue', ), - 5: ('BracketShotNumber', ), - 6: ('RawJpgQuality', { - 0xFFFF: 'n/a', - 1: 'Economy', - 2: 'Normal', - 3: 'Fine', - 4: 'RAW', - 5: 'Superfine', - 130: 'Normal Movie' - }), - 7: ('RawJpgSize', { - 0: 'Large', - 1: 'Medium', - 2: 'Small', - 5: 'Medium 1', - 6: 'Medium 2', - 7: 'Medium 3', - 8: 'Postcard', - 9: 'Widescreen', - 10: 'Medium Widescreen', - 14: 'Small 1', - 15: 'Small 2', - 16: 'Small 3', - 128: '640x480 Movie', - 129: 'Medium Movie', - 130: 'Small Movie', - 137: '1280x720 Movie', - 142: '1920x1080 Movie', - }), - 8: ('LongExposureNoiseReduction2', { - 0: 'Off', - 1: 'On (1D)', - 2: 'On', - 3: 'Auto' - }), - 9: ('WBBracketMode', { - 0: 'Off', - 1: 'On (shift AB)', - 2: 'On (shift GM)' - }), - 12: ('WBBracketValueAB', ), - 13: ('WBBracketValueGM', ), - 14: ('FilterEffect', { - 0: 'None', - 1: 'Yellow', - 2: 'Orange', - 3: 'Red', - 4: 'Green' - }), - 15: ('ToningEffect', { - 0: 'None', - 1: 'Sepia', - 2: 'Blue', - 3: 'Purple', - 4: 'Green', - }), - 16: ('MacroMagnification', ), - 19: ('LiveViewShooting', { - 0: 'Off', - 1: 'On' - }), - 25: ('FlashExposureLock', { - 0: 'Off', - 1: 'On' - }) -} - - -def add_one(value): - return value + 1 - - -def subtract_one(value): - return value - 1 - - -def convert_temp(value): - return '%d C' % (value - 128) - -# CameraInfo data structures have variable sized members. Each entry here is: -# byte offset: (item name, data item type, decoding map). -# Note that the data item type is fed directly to struct.unpack at the -# specified offset. -CAMERA_INFO_TAG_NAME = 'MakerNote Tag 0x000D' - -CAMERA_INFO_5D = { - 23: ('CameraTemperature', ' 127: - a = 256 - a - ret_str = '-' - else: - ret_str = '+' - step = seq[2] # Assume third value means the step size - whole = a / step - a = a % step - if whole != 0: - ret_str = '%s%s ' % (ret_str, str(whole)) - if a == 0: - ret_str += 'EV' - else: - r = Ratio(a, step) - ret_str = ret_str + r.__repr__() + ' EV' - return ret_str - -# Nikon E99x MakerNote Tags -TAGS_NEW = { - 0x0001: ('MakernoteVersion', make_string), # Sometimes binary - 0x0002: ('ISOSetting', make_string), - 0x0003: ('ColorMode', ), - 0x0004: ('Quality', ), - 0x0005: ('Whitebalance', ), - 0x0006: ('ImageSharpening', ), - 0x0007: ('FocusMode', ), - 0x0008: ('FlashSetting', ), - 0x0009: ('AutoFlashMode', ), - 0x000B: ('WhiteBalanceBias', ), - 0x000C: ('WhiteBalanceRBCoeff', ), - 0x000D: ('ProgramShift', ev_bias), - # Nearly the same as the other EV vals, but step size is 1/12 EV (?) - 0x000E: ('ExposureDifference', ev_bias), - 0x000F: ('ISOSelection', ), - 0x0010: ('DataDump', ), - 0x0011: ('NikonPreview', ), - 0x0012: ('FlashCompensation', ev_bias), - 0x0013: ('ISOSpeedRequested', ), - 0x0016: ('PhotoCornerCoordinates', ), - 0x0017: ('ExternalFlashExposureComp', ev_bias), - 0x0018: ('FlashBracketCompensationApplied', ev_bias), - 0x0019: ('AEBracketCompensationApplied', ), - 0x001A: ('ImageProcessing', ), - 0x001B: ('CropHiSpeed', ), - 0x001C: ('ExposureTuning', ), - 0x001D: ('SerialNumber', ), # Conflict with 0x00A0 ? - 0x001E: ('ColorSpace', ), - 0x001F: ('VRInfo', ), - 0x0020: ('ImageAuthentication', ), - 0x0022: ('ActiveDLighting', ), - 0x0023: ('PictureControl', ), - 0x0024: ('WorldTime', ), - 0x0025: ('ISOInfo', ), - 0x0080: ('ImageAdjustment', ), - 0x0081: ('ToneCompensation', ), - 0x0082: ('AuxiliaryLens', ), - 0x0083: ('LensType', ), - 0x0084: ('LensMinMaxFocalMaxAperture', ), - 0x0085: ('ManualFocusDistance', ), - 0x0086: ('DigitalZoomFactor', ), - 0x0087: ('FlashMode', { - 0x00: 'Did Not Fire', - 0x01: 'Fired, Manual', - 0x07: 'Fired, External', - 0x08: 'Fired, Commander Mode ', - 0x09: 'Fired, TTL Mode', - }), - 0x0088: ('AFFocusPosition', { - 0x0000: 'Center', - 0x0100: 'Top', - 0x0200: 'Bottom', - 0x0300: 'Left', - 0x0400: 'Right', - }), - 0x0089: ('BracketingMode', { - 0x00: 'Single frame, no bracketing', - 0x01: 'Continuous, no bracketing', - 0x02: 'Timer, no bracketing', - 0x10: 'Single frame, exposure bracketing', - 0x11: 'Continuous, exposure bracketing', - 0x12: 'Timer, exposure bracketing', - 0x40: 'Single frame, white balance bracketing', - 0x41: 'Continuous, white balance bracketing', - 0x42: 'Timer, white balance bracketing' - }), - 0x008A: ('AutoBracketRelease', ), - 0x008B: ('LensFStops', ), - 0x008C: ('NEFCurve1', ), # ExifTool calls this 'ContrastCurve' - 0x008D: ('ColorMode', ), - 0x008F: ('SceneMode', ), - 0x0090: ('LightingType', ), - 0x0091: ('ShotInfo', ), # First 4 bytes are a version number in ASCII - 0x0092: ('HueAdjustment', ), - # ExifTool calls this 'NEFCompression', should be 1-4 - 0x0093: ('Compression', ), - 0x0094: ('Saturation', { - -3: 'B&W', - -2: '-2', - -1: '-1', - 0: '0', - 1: '1', - 2: '2', - }), - 0x0095: ('NoiseReduction', ), - 0x0096: ('NEFCurve2', ), # ExifTool calls this 'LinearizationTable' - 0x0097: ('ColorBalance', ), # First 4 bytes are a version number in ASCII - 0x0098: ('LensData', ), # First 4 bytes are a version number in ASCII - 0x0099: ('RawImageCenter', ), - 0x009A: ('SensorPixelSize', ), - 0x009C: ('Scene Assist', ), - 0x009E: ('RetouchHistory', ), - 0x00A0: ('SerialNumber', ), - 0x00A2: ('ImageDataSize', ), - # 00A3: unknown - a single byte 0 - # 00A4: In NEF, looks like a 4 byte ASCII version number ('0200') - 0x00A5: ('ImageCount', ), - 0x00A6: ('DeletedImageCount', ), - 0x00A7: ('TotalShutterReleases', ), - # First 4 bytes are a version number in ASCII, with version specific - # info to follow. Its hard to treat it as a string due to embedded nulls. - 0x00A8: ('FlashInfo', ), - 0x00A9: ('ImageOptimization', ), - 0x00AA: ('Saturation', ), - 0x00AB: ('DigitalVariProgram', ), - 0x00AC: ('ImageStabilization', ), - 0x00AD: ('AFResponse', ), - 0x00B0: ('MultiExposure', ), - 0x00B1: ('HighISONoiseReduction', ), - 0x00B6: ('PowerUpTime', ), - 0x00B7: ('AFInfo2', ), - 0x00B8: ('FileInfo', ), - 0x00B9: ('AFTune', ), - 0x0100: ('DigitalICE', ), - 0x0103: ('PreviewCompression', { - 1: 'Uncompressed', - 2: 'CCITT 1D', - 3: 'T4/Group 3 Fax', - 4: 'T6/Group 4 Fax', - 5: 'LZW', - 6: 'JPEG (old-style)', - 7: 'JPEG', - 8: 'Adobe Deflate', - 9: 'JBIG B&W', - 10: 'JBIG Color', - 32766: 'Next', - 32769: 'Epson ERF Compressed', - 32771: 'CCIRLEW', - 32773: 'PackBits', - 32809: 'Thunderscan', - 32895: 'IT8CTPAD', - 32896: 'IT8LW', - 32897: 'IT8MP', - 32898: 'IT8BL', - 32908: 'PixarFilm', - 32909: 'PixarLog', - 32946: 'Deflate', - 32947: 'DCS', - 34661: 'JBIG', - 34676: 'SGILog', - 34677: 'SGILog24', - 34712: 'JPEG 2000', - 34713: 'Nikon NEF Compressed', - 65000: 'Kodak DCR Compressed', - 65535: 'Pentax PEF Compressed', - }), - 0x0201: ('PreviewImageStart', ), - 0x0202: ('PreviewImageLength', ), - 0x0213: ('PreviewYCbCrPositioning', { - 1: 'Centered', - 2: 'Co-sited', - }), - 0x0E09: ('NikonCaptureVersion', ), - 0x0E0E: ('NikonCaptureOffsets', ), - 0x0E10: ('NikonScan', ), - 0x0E22: ('NEFBitDepth', ), -} - -TAGS_OLD = { - 0x0003: ('Quality', { - 1: 'VGA Basic', - 2: 'VGA Normal', - 3: 'VGA Fine', - 4: 'SXGA Basic', - 5: 'SXGA Normal', - 6: 'SXGA Fine', - }), - 0x0004: ('ColorMode', { - 1: 'Color', - 2: 'Monochrome', - }), - 0x0005: ('ImageAdjustment', { - 0: 'Normal', - 1: 'Bright+', - 2: 'Bright-', - 3: 'Contrast+', - 4: 'Contrast-', - }), - 0x0006: ('CCDSpeed', { - 0: 'ISO 80', - 2: 'ISO 160', - 4: 'ISO 320', - 5: 'ISO 100', - }), - 0x0007: ('WhiteBalance', { - 0: 'Auto', - 1: 'Preset', - 2: 'Daylight', - 3: 'Incandescent', - 4: 'Fluorescent', - 5: 'Cloudy', - 6: 'Speed Light', - }), -} diff -Nru metamorphose2-0.8.4/src/exif/exifread/tags/makernote/olympus.py metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/makernote/olympus.py --- metamorphose2-0.8.4/src/exif/exifread/tags/makernote/olympus.py 2015-09-14 16:22:25.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/makernote/olympus.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,291 +0,0 @@ - -from ...utils import make_string - -def special_mode(v): - """decode Olympus SpecialMode tag in MakerNote""" - mode1 = { - 0: 'Normal', - 1: 'Unknown', - 2: 'Fast', - 3: 'Panorama', - } - mode2 = { - 0: 'Non-panoramic', - 1: 'Left to right', - 2: 'Right to left', - 3: 'Bottom to top', - 4: 'Top to bottom', - } - if not v or (v[0] not in mode1 or v[2] not in mode2): - return v - return '%s - sequence %d - %s' % (mode1[v[0]], v[1], mode2[v[2]]) - - -TAGS = { - # ah HAH! those sneeeeeaky bastids! this is how they get past the fact - # that a JPEG thumbnail is not allowed in an uncompressed TIFF file - 0x0100: ('JPEGThumbnail', ), - 0x0200: ('SpecialMode', special_mode), - 0x0201: ('JPEGQual', { - 1: 'SQ', - 2: 'HQ', - 3: 'SHQ', - }), - 0x0202: ('Macro', { - 0: 'Normal', - 1: 'Macro', - 2: 'SuperMacro' - }), - 0x0203: ('BWMode', { - 0: 'Off', - 1: 'On' - }), - 0x0204: ('DigitalZoom', ), - 0x0205: ('FocalPlaneDiagonal', ), - 0x0206: ('LensDistortionParams', ), - 0x0207: ('SoftwareRelease', ), - 0x0208: ('PictureInfo', ), - 0x0209: ('CameraID', make_string), # print as string - 0x0F00: ('DataDump', ), - 0x0300: ('PreCaptureFrames', ), - 0x0404: ('SerialNumber', ), - 0x1000: ('ShutterSpeedValue', ), - 0x1001: ('ISOValue', ), - 0x1002: ('ApertureValue', ), - 0x1003: ('BrightnessValue', ), - 0x1004: ('FlashMode', { - 2: 'On', - 3: 'Off' - }), - 0x1005: ('FlashDevice', { - 0: 'None', - 1: 'Internal', - 4: 'External', - 5: 'Internal + External' - }), - 0x1006: ('ExposureCompensation', ), - 0x1007: ('SensorTemperature', ), - 0x1008: ('LensTemperature', ), - 0x100b: ('FocusMode', { - 0: 'Auto', - 1: 'Manual' - }), - 0x1017: ('RedBalance', ), - 0x1018: ('BlueBalance', ), - 0x101a: ('SerialNumber', ), - 0x1023: ('FlashExposureComp', ), - 0x1026: ('ExternalFlashBounce', { - 0: 'No', - 1: 'Yes' - }), - 0x1027: ('ExternalFlashZoom', ), - 0x1028: ('ExternalFlashMode', ), - 0x1029: ('Contrast int16u', { - 0: 'High', - 1: 'Normal', - 2: 'Low' - }), - 0x102a: ('SharpnessFactor', ), - 0x102b: ('ColorControl', ), - 0x102c: ('ValidBits', ), - 0x102d: ('CoringFilter', ), - 0x102e: ('OlympusImageWidth', ), - 0x102f: ('OlympusImageHeight', ), - 0x1034: ('CompressionRatio', ), - 0x1035: ('PreviewImageValid', { - 0: 'No', - 1: 'Yes' - }), - 0x1036: ('PreviewImageStart', ), - 0x1037: ('PreviewImageLength', ), - 0x1039: ('CCDScanMode', { - 0: 'Interlaced', - 1: 'Progressive' - }), - 0x103a: ('NoiseReduction', { - 0: 'Off', - 1: 'On' - }), - 0x103b: ('InfinityLensStep', ), - 0x103c: ('NearLensStep', ), - - # TODO - these need extra definitions - # http://search.cpan.org/src/EXIFTOOL/Image-ExifTool-6.90/html/TagNames/Olympus.html - 0x2010: ('Equipment', ), - 0x2020: ('CameraSettings', ), - 0x2030: ('RawDevelopment', ), - 0x2040: ('ImageProcessing', ), - 0x2050: ('FocusInfo', ), - 0x3000: ('RawInfo ', ), -} - -# 0x2020 CameraSettings -TAG_0x2020 = { - 0x0100: ('PreviewImageValid', { - 0: 'No', - 1: 'Yes' - }), - 0x0101: ('PreviewImageStart', ), - 0x0102: ('PreviewImageLength', ), - 0x0200: ('ExposureMode', { - 1: 'Manual', - 2: 'Program', - 3: 'Aperture-priority AE', - 4: 'Shutter speed priority AE', - 5: 'Program-shift' - }), - 0x0201: ('AELock', { - 0: 'Off', - 1: 'On' - }), - 0x0202: ('MeteringMode', { - 2: 'Center Weighted', - 3: 'Spot', - 5: 'ESP', - 261: 'Pattern+AF', - 515: 'Spot+Highlight control', - 1027: 'Spot+Shadow control' - }), - 0x0300: ('MacroMode', { - 0: 'Off', - 1: 'On' - }), - 0x0301: ('FocusMode', { - 0: 'Single AF', - 1: 'Sequential shooting AF', - 2: 'Continuous AF', - 3: 'Multi AF', - 10: 'MF' - }), - 0x0302: ('FocusProcess', { - 0: 'AF Not Used', - 1: 'AF Used' - }), - 0x0303: ('AFSearch', { - 0: 'Not Ready', - 1: 'Ready' - }), - 0x0304: ('AFAreas', ), - 0x0401: ('FlashExposureCompensation', ), - 0x0500: ('WhiteBalance2', { - 0: 'Auto', - 16: '7500K (Fine Weather with Shade)', - 17: '6000K (Cloudy)', - 18: '5300K (Fine Weather)', - 20: '3000K (Tungsten light)', - 21: '3600K (Tungsten light-like)', - 33: '6600K (Daylight fluorescent)', - 34: '4500K (Neutral white fluorescent)', - 35: '4000K (Cool white fluorescent)', - 48: '3600K (Tungsten light-like)', - 256: 'Custom WB 1', - 257: 'Custom WB 2', - 258: 'Custom WB 3', - 259: 'Custom WB 4', - 512: 'Custom WB 5400K', - 513: 'Custom WB 2900K', - 514: 'Custom WB 8000K', - }), - 0x0501: ('WhiteBalanceTemperature', ), - 0x0502: ('WhiteBalanceBracket', ), - 0x0503: ('CustomSaturation', ), # (3 numbers: 1. CS Value, 2. Min, 3. Max) - 0x0504: ('ModifiedSaturation', { - 0: 'Off', - 1: 'CM1 (Red Enhance)', - 2: 'CM2 (Green Enhance)', - 3: 'CM3 (Blue Enhance)', - 4: 'CM4 (Skin Tones)', - }), - 0x0505: ('ContrastSetting', ), # (3 numbers: 1. Contrast, 2. Min, 3. Max) - 0x0506: ('SharpnessSetting', ), # (3 numbers: 1. Sharpness, 2. Min, 3. Max) - 0x0507: ('ColorSpace', { - 0: 'sRGB', - 1: 'Adobe RGB', - 2: 'Pro Photo RGB' - }), - 0x0509: ('SceneMode', { - 0: 'Standard', - 6: 'Auto', - 7: 'Sport', - 8: 'Portrait', - 9: 'Landscape+Portrait', - 10: 'Landscape', - 11: 'Night scene', - 13: 'Panorama', - 16: 'Landscape+Portrait', - 17: 'Night+Portrait', - 19: 'Fireworks', - 20: 'Sunset', - 22: 'Macro', - 25: 'Documents', - 26: 'Museum', - 28: 'Beach&Snow', - 30: 'Candle', - 35: 'Underwater Wide1', - 36: 'Underwater Macro', - 39: 'High Key', - 40: 'Digital Image Stabilization', - 44: 'Underwater Wide2', - 45: 'Low Key', - 46: 'Children', - 48: 'Nature Macro', - }), - 0x050a: ('NoiseReduction', { - 0: 'Off', - 1: 'Noise Reduction', - 2: 'Noise Filter', - 3: 'Noise Reduction + Noise Filter', - 4: 'Noise Filter (ISO Boost)', - 5: 'Noise Reduction + Noise Filter (ISO Boost)' - }), - 0x050b: ('DistortionCorrection', { - 0: 'Off', - 1: 'On' - }), - 0x050c: ('ShadingCompensation', { - 0: 'Off', - 1: 'On' - }), - 0x050d: ('CompressionFactor', ), - 0x050f: ('Gradation', { - '-1 -1 1': 'Low Key', - '0 -1 1': 'Normal', - '1 -1 1': 'High Key' - }), - 0x0520: ('PictureMode', { - 1: 'Vivid', - 2: 'Natural', - 3: 'Muted', - 256: 'Monotone', - 512: 'Sepia' - }), - 0x0521: ('PictureModeSaturation', ), - 0x0522: ('PictureModeHue?', ), - 0x0523: ('PictureModeContrast', ), - 0x0524: ('PictureModeSharpness', ), - 0x0525: ('PictureModeBWFilter', { - 0: 'n/a', - 1: 'Neutral', - 2: 'Yellow', - 3: 'Orange', - 4: 'Red', - 5: 'Green' - }), - 0x0526: ('PictureModeTone', { - 0: 'n/a', - 1: 'Neutral', - 2: 'Sepia', - 3: 'Blue', - 4: 'Purple', - 5: 'Green' - }), - 0x0600: ('Sequence', ), # 2 or 3 numbers: 1. Mode, 2. Shot number, 3. Mode bits - 0x0601: ('PanoramaMode', ), # (2 numbers: 1. Mode, 2. Shot number) - 0x0603: ('ImageQuality2', { - 1: 'SQ', - 2: 'HQ', - 3: 'SHQ', - 4: 'RAW', - }), - 0x0901: ('ManometerReading', ), -} diff -Nru metamorphose2-0.8.4/src/exif/exifread/tags/makernote_apple.py metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/makernote_apple.py --- metamorphose2-0.8.4/src/exif/exifread/tags/makernote_apple.py 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/makernote_apple.py 2017-01-25 12:35:16.000000000 +0000 @@ -0,0 +1,13 @@ +""" +Makernote (proprietary) tag definitions for Apple iOS + +Based on version 1.01 of ExifTool -> Image/ExifTool/Apple.pm +http://owl.phy.queensu.ca/~phil/exiftool/ +""" + +TAGS = { + 0x000a: ('HDRImageType', { + 3: 'HDR Image', + 4: 'Original Image', + }), +} diff -Nru metamorphose2-0.8.4/src/exif/exifread/tags/makernote_canon.py metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/makernote_canon.py --- metamorphose2-0.8.4/src/exif/exifread/tags/makernote_canon.py 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/exifread/tags/makernote_canon.py 2017-01-25 12:35:16.000000000 +0000 @@ -0,0 +1,711 @@ +""" +Makernote (proprietary) tag definitions for Canon. + +http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html +""" + +TAGS = { + 0x0003: ('FlashInfo',), + 0x0006: ('ImageType', ), + 0x0007: ('FirmwareVersion', ), + 0x0008: ('ImageNumber', ), + 0x0009: ('OwnerName', ), + 0x000c: ('SerialNumber', ), + 0x000e: ('FileLength', ), + 0x0010: ('ModelID', { + 0x1010000: 'PowerShot A30', + 0x1040000: 'PowerShot S300 / Digital IXUS 300 / IXY Digital 300', + 0x1060000: 'PowerShot A20', + 0x1080000: 'PowerShot A10', + 0x1090000: 'PowerShot S110 / Digital IXUS v / IXY Digital 200', + 0x1100000: 'PowerShot G2', + 0x1110000: 'PowerShot S40', + 0x1120000: 'PowerShot S30', + 0x1130000: 'PowerShot A40', + 0x1140000: 'EOS D30', + 0x1150000: 'PowerShot A100', + 0x1160000: 'PowerShot S200 / Digital IXUS v2 / IXY Digital 200a', + 0x1170000: 'PowerShot A200', + 0x1180000: 'PowerShot S330 / Digital IXUS 330 / IXY Digital 300a', + 0x1190000: 'PowerShot G3', + 0x1210000: 'PowerShot S45', + 0x1230000: 'PowerShot SD100 / Digital IXUS II / IXY Digital 30', + 0x1240000: 'PowerShot S230 / Digital IXUS v3 / IXY Digital 320', + 0x1250000: 'PowerShot A70', + 0x1260000: 'PowerShot A60', + 0x1270000: 'PowerShot S400 / Digital IXUS 400 / IXY Digital 400', + 0x1290000: 'PowerShot G5', + 0x1300000: 'PowerShot A300', + 0x1310000: 'PowerShot S50', + 0x1340000: 'PowerShot A80', + 0x1350000: 'PowerShot SD10 / Digital IXUS i / IXY Digital L', + 0x1360000: 'PowerShot S1 IS', + 0x1370000: 'PowerShot Pro1', + 0x1380000: 'PowerShot S70', + 0x1390000: 'PowerShot S60', + 0x1400000: 'PowerShot G6', + 0x1410000: 'PowerShot S500 / Digital IXUS 500 / IXY Digital 500', + 0x1420000: 'PowerShot A75', + 0x1440000: 'PowerShot SD110 / Digital IXUS IIs / IXY Digital 30a', + 0x1450000: 'PowerShot A400', + 0x1470000: 'PowerShot A310', + 0x1490000: 'PowerShot A85', + 0x1520000: 'PowerShot S410 / Digital IXUS 430 / IXY Digital 450', + 0x1530000: 'PowerShot A95', + 0x1540000: 'PowerShot SD300 / Digital IXUS 40 / IXY Digital 50', + 0x1550000: 'PowerShot SD200 / Digital IXUS 30 / IXY Digital 40', + 0x1560000: 'PowerShot A520', + 0x1570000: 'PowerShot A510', + 0x1590000: 'PowerShot SD20 / Digital IXUS i5 / IXY Digital L2', + 0x1640000: 'PowerShot S2 IS', + 0x1650000: 'PowerShot SD430 / Digital IXUS Wireless / IXY Digital Wireless', + 0x1660000: 'PowerShot SD500 / Digital IXUS 700 / IXY Digital 600', + 0x1668000: 'EOS D60', + 0x1700000: 'PowerShot SD30 / Digital IXUS i Zoom / IXY Digital L3', + 0x1740000: 'PowerShot A430', + 0x1750000: 'PowerShot A410', + 0x1760000: 'PowerShot S80', + 0x1780000: 'PowerShot A620', + 0x1790000: 'PowerShot A610', + 0x1800000: 'PowerShot SD630 / Digital IXUS 65 / IXY Digital 80', + 0x1810000: 'PowerShot SD450 / Digital IXUS 55 / IXY Digital 60', + 0x1820000: 'PowerShot TX1', + 0x1870000: 'PowerShot SD400 / Digital IXUS 50 / IXY Digital 55', + 0x1880000: 'PowerShot A420', + 0x1890000: 'PowerShot SD900 / Digital IXUS 900 Ti / IXY Digital 1000', + 0x1900000: 'PowerShot SD550 / Digital IXUS 750 / IXY Digital 700', + 0x1920000: 'PowerShot A700', + 0x1940000: 'PowerShot SD700 IS / Digital IXUS 800 IS / IXY Digital 800 IS', + 0x1950000: 'PowerShot S3 IS', + 0x1960000: 'PowerShot A540', + 0x1970000: 'PowerShot SD600 / Digital IXUS 60 / IXY Digital 70', + 0x1980000: 'PowerShot G7', + 0x1990000: 'PowerShot A530', + 0x2000000: 'PowerShot SD800 IS / Digital IXUS 850 IS / IXY Digital 900 IS', + 0x2010000: 'PowerShot SD40 / Digital IXUS i7 / IXY Digital L4', + 0x2020000: 'PowerShot A710 IS', + 0x2030000: 'PowerShot A640', + 0x2040000: 'PowerShot A630', + 0x2090000: 'PowerShot S5 IS', + 0x2100000: 'PowerShot A460', + 0x2120000: 'PowerShot SD850 IS / Digital IXUS 950 IS / IXY Digital 810 IS', + 0x2130000: 'PowerShot A570 IS', + 0x2140000: 'PowerShot A560', + 0x2150000: 'PowerShot SD750 / Digital IXUS 75 / IXY Digital 90', + 0x2160000: 'PowerShot SD1000 / Digital IXUS 70 / IXY Digital 10', + 0x2180000: 'PowerShot A550', + 0x2190000: 'PowerShot A450', + 0x2230000: 'PowerShot G9', + 0x2240000: 'PowerShot A650 IS', + 0x2260000: 'PowerShot A720 IS', + 0x2290000: 'PowerShot SX100 IS', + 0x2300000: 'PowerShot SD950 IS / Digital IXUS 960 IS / IXY Digital 2000 IS', + 0x2310000: 'PowerShot SD870 IS / Digital IXUS 860 IS / IXY Digital 910 IS', + 0x2320000: 'PowerShot SD890 IS / Digital IXUS 970 IS / IXY Digital 820 IS', + 0x2360000: 'PowerShot SD790 IS / Digital IXUS 90 IS / IXY Digital 95 IS', + 0x2370000: 'PowerShot SD770 IS / Digital IXUS 85 IS / IXY Digital 25 IS', + 0x2380000: 'PowerShot A590 IS', + 0x2390000: 'PowerShot A580', + 0x2420000: 'PowerShot A470', + 0x2430000: 'PowerShot SD1100 IS / Digital IXUS 80 IS / IXY Digital 20 IS', + 0x2460000: 'PowerShot SX1 IS', + 0x2470000: 'PowerShot SX10 IS', + 0x2480000: 'PowerShot A1000 IS', + 0x2490000: 'PowerShot G10', + 0x2510000: 'PowerShot A2000 IS', + 0x2520000: 'PowerShot SX110 IS', + 0x2530000: 'PowerShot SD990 IS / Digital IXUS 980 IS / IXY Digital 3000 IS', + 0x2540000: 'PowerShot SD880 IS / Digital IXUS 870 IS / IXY Digital 920 IS', + 0x2550000: 'PowerShot E1', + 0x2560000: 'PowerShot D10', + 0x2570000: 'PowerShot SD960 IS / Digital IXUS 110 IS / IXY Digital 510 IS', + 0x2580000: 'PowerShot A2100 IS', + 0x2590000: 'PowerShot A480', + 0x2600000: 'PowerShot SX200 IS', + 0x2610000: 'PowerShot SD970 IS / Digital IXUS 990 IS / IXY Digital 830 IS', + 0x2620000: 'PowerShot SD780 IS / Digital IXUS 100 IS / IXY Digital 210 IS', + 0x2630000: 'PowerShot A1100 IS', + 0x2640000: 'PowerShot SD1200 IS / Digital IXUS 95 IS / IXY Digital 110 IS', + 0x2700000: 'PowerShot G11', + 0x2710000: 'PowerShot SX120 IS', + 0x2720000: 'PowerShot S90', + 0x2750000: 'PowerShot SX20 IS', + 0x2760000: 'PowerShot SD980 IS / Digital IXUS 200 IS / IXY Digital 930 IS', + 0x2770000: 'PowerShot SD940 IS / Digital IXUS 120 IS / IXY Digital 220 IS', + 0x2800000: 'PowerShot A495', + 0x2810000: 'PowerShot A490', + 0x2820000: 'PowerShot A3100 IS / A3150 IS', + 0x2830000: 'PowerShot A3000 IS', + 0x2840000: 'PowerShot SD1400 IS / IXUS 130 / IXY 400F', + 0x2850000: 'PowerShot SD1300 IS / IXUS 105 / IXY 200F', + 0x2860000: 'PowerShot SD3500 IS / IXUS 210 / IXY 10S', + 0x2870000: 'PowerShot SX210 IS', + 0x2880000: 'PowerShot SD4000 IS / IXUS 300 HS / IXY 30S', + 0x2890000: 'PowerShot SD4500 IS / IXUS 1000 HS / IXY 50S', + 0x2920000: 'PowerShot G12', + 0x2930000: 'PowerShot SX30 IS', + 0x2940000: 'PowerShot SX130 IS', + 0x2950000: 'PowerShot S95', + 0x2980000: 'PowerShot A3300 IS', + 0x2990000: 'PowerShot A3200 IS', + 0x3000000: 'PowerShot ELPH 500 HS / IXUS 310 HS / IXY 31S', + 0x3010000: 'PowerShot Pro90 IS', + 0x3010001: 'PowerShot A800', + 0x3020000: 'PowerShot ELPH 100 HS / IXUS 115 HS / IXY 210F', + 0x3030000: 'PowerShot SX230 HS', + 0x3040000: 'PowerShot ELPH 300 HS / IXUS 220 HS / IXY 410F', + 0x3050000: 'PowerShot A2200', + 0x3060000: 'PowerShot A1200', + 0x3070000: 'PowerShot SX220 HS', + 0x3080000: 'PowerShot G1 X', + 0x3090000: 'PowerShot SX150 IS', + 0x3100000: 'PowerShot ELPH 510 HS / IXUS 1100 HS / IXY 51S', + 0x3110000: 'PowerShot S100 (new)', + 0x3130000: 'PowerShot SX40 HS', + 0x3120000: 'PowerShot ELPH 310 HS / IXUS 230 HS / IXY 600F', + 0x3160000: 'PowerShot A1300', + 0x3170000: 'PowerShot A810', + 0x3180000: 'PowerShot ELPH 320 HS / IXUS 240 HS / IXY 420F', + 0x3190000: 'PowerShot ELPH 110 HS / IXUS 125 HS / IXY 220F', + 0x3200000: 'PowerShot D20', + 0x3210000: 'PowerShot A4000 IS', + 0x3220000: 'PowerShot SX260 HS', + 0x3230000: 'PowerShot SX240 HS', + 0x3240000: 'PowerShot ELPH 530 HS / IXUS 510 HS / IXY 1', + 0x3250000: 'PowerShot ELPH 520 HS / IXUS 500 HS / IXY 3', + 0x3260000: 'PowerShot A3400 IS', + 0x3270000: 'PowerShot A2400 IS', + 0x3280000: 'PowerShot A2300', + 0x3330000: 'PowerShot G15', + 0x3340000: 'PowerShot SX50', + 0x3350000: 'PowerShot SX160 IS', + 0x3360000: 'PowerShot S110 (new)', + 0x3370000: 'PowerShot SX500 IS', + 0x3380000: 'PowerShot N', + 0x3390000: 'IXUS 245 HS / IXY 430F', + 0x3400000: 'PowerShot SX280 HS', + 0x3410000: 'PowerShot SX270 HS', + 0x3420000: 'PowerShot A3500 IS', + 0x3430000: 'PowerShot A2600', + 0x3450000: 'PowerShot A1400', + 0x3460000: 'PowerShot ELPH 130 IS / IXUS 140 / IXY 110F', + 0x3470000: 'PowerShot ELPH 115/120 IS / IXUS 132/135 / IXY 90F/100F', + 0x3490000: 'PowerShot ELPH 330 HS / IXUS 255 HS / IXY 610F', + 0x3510000: 'PowerShot A2500', + 0x3540000: 'PowerShot G16', + 0x3550000: 'PowerShot S120', + 0x3560000: 'PowerShot SX170 IS', + 0x3580000: 'PowerShot SX510 HS', + 0x3590000: 'PowerShot S200 (new)', + 0x3600000: 'IXY 620F', + 0x3610000: 'PowerShot N100', + 0x3640000: 'PowerShot G1 X Mark II', + 0x3650000: 'PowerShot D30', + 0x3660000: 'PowerShot SX700 HS', + 0x3670000: 'PowerShot SX600 HS', + 0x3680000: 'PowerShot ELPH 140 IS / IXUS 150 / IXY 130', + 0x3690000: 'PowerShot ELPH 135 / IXUS 145 / IXY 120', + 0x3700000: 'PowerShot ELPH 340 HS / IXUS 265 HS / IXY 630', + 0x3710000: 'PowerShot ELPH 150 IS / IXUS 155 / IXY 140', + 0x3740000: 'EOS M3', + 0x3750000: 'PowerShot SX60 HS', + 0x3760000: 'PowerShot SX520 HS', + 0x3770000: 'PowerShot SX400 IS', + 0x3780000: 'PowerShot G7 X', + 0x3790000: 'PowerShot N2', + 0x3800000: 'PowerShot SX530 HS', + 0x3820000: 'PowerShot SX710 HS', + 0x3830000: 'PowerShot SX610 HS', + 0x3870000: 'PowerShot ELPH 160 / IXUS 160', + 0x3890000: 'PowerShot ELPH 170 IS / IXUS 170', + 0x3910000: 'PowerShot SX410 IS', + 0x4040000: 'PowerShot G1', + 0x6040000: 'PowerShot S100 / Digital IXUS / IXY Digital', + 0x4007d673: 'DC19/DC21/DC22', + 0x4007d674: 'XH A1', + 0x4007d675: 'HV10', + 0x4007d676: 'MD130/MD140/MD150/MD160/ZR850', + 0x4007d777: 'DC50', + 0x4007d778: 'HV20', + 0x4007d779: 'DC211', + 0x4007d77a: 'HG10', + 0x4007d77b: 'HR10', + 0x4007d77d: 'MD255/ZR950', + 0x4007d81c: 'HF11', + 0x4007d878: 'HV30', + 0x4007d87c: 'XH A1S', + 0x4007d87e: 'DC301/DC310/DC311/DC320/DC330', + 0x4007d87f: 'FS100', + 0x4007d880: 'HF10', + 0x4007d882: 'HG20/HG21', + 0x4007d925: 'HF21', + 0x4007d926: 'HF S11', + 0x4007d978: 'HV40', + 0x4007d987: 'DC410/DC411/DC420', + 0x4007d988: 'FS19/FS20/FS21/FS22/FS200', + 0x4007d989: 'HF20/HF200', + 0x4007d98a: 'HF S10/S100', + 0x4007da8e: 'HF R10/R16/R17/R18/R100/R106', + 0x4007da8f: 'HF M30/M31/M36/M300/M306', + 0x4007da90: 'HF S20/S21/S200', + 0x4007da92: 'FS31/FS36/FS37/FS300/FS305/FS306/FS307', + 0x4007dda9: 'HF G25', + 0x80000001: 'EOS-1D', + 0x80000167: 'EOS-1DS', + 0x80000168: 'EOS 10D', + 0x80000169: 'EOS-1D Mark III', + 0x80000170: 'EOS Digital Rebel / 300D / Kiss Digital', + 0x80000174: 'EOS-1D Mark II', + 0x80000175: 'EOS 20D', + 0x80000176: 'EOS Digital Rebel XSi / 450D / Kiss X2', + 0x80000188: 'EOS-1Ds Mark II', + 0x80000189: 'EOS Digital Rebel XT / 350D / Kiss Digital N', + 0x80000190: 'EOS 40D', + 0x80000213: 'EOS 5D', + 0x80000215: 'EOS-1Ds Mark III', + 0x80000218: 'EOS 5D Mark II', + 0x80000219: 'WFT-E1', + 0x80000232: 'EOS-1D Mark II N', + 0x80000234: 'EOS 30D', + 0x80000236: 'EOS Digital Rebel XTi / 400D / Kiss Digital X', + 0x80000241: 'WFT-E2', + 0x80000246: 'WFT-E3', + 0x80000250: 'EOS 7D', + 0x80000252: 'EOS Rebel T1i / 500D / Kiss X3', + 0x80000254: 'EOS Rebel XS / 1000D / Kiss F', + 0x80000261: 'EOS 50D', + 0x80000269: 'EOS-1D X', + 0x80000270: 'EOS Rebel T2i / 550D / Kiss X4', + 0x80000271: 'WFT-E4', + 0x80000273: 'WFT-E5', + 0x80000281: 'EOS-1D Mark IV', + 0x80000285: 'EOS 5D Mark III', + 0x80000286: 'EOS Rebel T3i / 600D / Kiss X5', + 0x80000287: 'EOS 60D', + 0x80000288: 'EOS Rebel T3 / 1100D / Kiss X50', + 0x80000289: 'EOS 7D Mark II', + 0x80000297: 'WFT-E2 II', + 0x80000298: 'WFT-E4 II', + 0x80000301: 'EOS Rebel T4i / 650D / Kiss X6i', + 0x80000302: 'EOS 6D', + 0x80000324: 'EOS-1D C', + 0x80000325: 'EOS 70D', + 0x80000326: 'EOS Rebel T5i / 700D / Kiss X7i', + 0x80000327: 'EOS Rebel T5 / 1200D / Kiss X70', + 0x80000331: 'EOS M', + 0x80000355: 'EOS M2', + 0x80000346: 'EOS Rebel SL1 / 100D / Kiss X7', + 0x80000347: 'EOS Rebel T6s / 760D / 8000D', + 0x80000382: 'EOS 5DS', + 0x80000393: 'EOS Rebel T6i / 750D / Kiss X8i', + 0x80000401: 'EOS 5DS R', + }), + 0x0013: ('ThumbnailImageValidArea', ), + 0x0015: ('SerialNumberFormat', { + 0x90000000: 'Format 1', + 0xA0000000: 'Format 2' + }), + 0x001a: ('SuperMacro', { + 0: 'Off', + 1: 'On (1)', + 2: 'On (2)' + }), + 0x001c: ('DateStampMode', { + 0: 'Off', + 1: 'Date', + 2: 'Date & Time', + }), + 0x001e: ('FirmwareRevision', ), + 0x0028: ('ImageUniqueID', ), + 0x0095: ('LensModel', ), + 0x0096: ('InternalSerialNumber ', ), + 0x0097: ('DustRemovalData ', ), + 0x0098: ('CropInfo ', ), + 0x009a: ('AspectInfo', ), + 0x00b4: ('ColorSpace', { + 1: 'sRGB', + 2: 'Adobe RGB' + }), +} + +# this is in element offset, name, optional value dictionary format +# 0x0001 +CAMERA_SETTINGS = { + 1: ('Macromode', { + 1: 'Macro', + 2: 'Normal' + }), + 2: ('SelfTimer', ), + 3: ('Quality', { + 1: 'Economy', + 2: 'Normal', + 3: 'Fine', + 5: 'Superfine' + }), + 4: ('FlashMode', { + 0: 'Flash Not Fired', + 1: 'Auto', + 2: 'On', + 3: 'Red-Eye Reduction', + 4: 'Slow Synchro', + 5: 'Auto + Red-Eye Reduction', + 6: 'On + Red-Eye Reduction', + 16: 'external flash' + }), + 5: ('ContinuousDriveMode', { + 0: 'Single Or Timer', + 1: 'Continuous', + 2: 'Movie', + }), + 7: ('FocusMode', { + 0: 'One-Shot', + 1: 'AI Servo', + 2: 'AI Focus', + 3: 'MF', + 4: 'Single', + 5: 'Continuous', + 6: 'MF' + }), + 9: ('RecordMode', { + 1: 'JPEG', + 2: 'CRW+THM', + 3: 'AVI+THM', + 4: 'TIF', + 5: 'TIF+JPEG', + 6: 'CR2', + 7: 'CR2+JPEG', + 9: 'Video' + }), + 10: ('ImageSize', { + 0: 'Large', + 1: 'Medium', + 2: 'Small' + }), + 11: ('EasyShootingMode', { + 0: 'Full Auto', + 1: 'Manual', + 2: 'Landscape', + 3: 'Fast Shutter', + 4: 'Slow Shutter', + 5: 'Night', + 6: 'B&W', + 7: 'Sepia', + 8: 'Portrait', + 9: 'Sports', + 10: 'Macro/Close-Up', + 11: 'Pan Focus', + 51: 'High Dynamic Range', + }), + 12: ('DigitalZoom', { + 0: 'None', + 1: '2x', + 2: '4x', + 3: 'Other' + }), + 13: ('Contrast', { + 0xFFFF: 'Low', + 0: 'Normal', + 1: 'High' + }), + 14: ('Saturation', { + 0xFFFF: 'Low', + 0: 'Normal', + 1: 'High' + }), + 15: ('Sharpness', { + 0xFFFF: 'Low', + 0: 'Normal', + 1: 'High' + }), + 16: ('ISO', { + 0: 'See ISOSpeedRatings Tag', + 15: 'Auto', + 16: '50', + 17: '100', + 18: '200', + 19: '400' + }), + 17: ('MeteringMode', { + 0: 'Default', + 1: 'Spot', + 2: 'Average', + 3: 'Evaluative', + 4: 'Partial', + 5: 'Center-weighted' + }), + 18: ('FocusType', { + 0: 'Manual', + 1: 'Auto', + 3: 'Close-Up (Macro)', + 8: 'Locked (Pan Mode)' + }), + 19: ('AFPointSelected', { + 0x3000: 'None (MF)', + 0x3001: 'Auto-Selected', + 0x3002: 'Right', + 0x3003: 'Center', + 0x3004: 'Left' + }), + 20: ('ExposureMode', { + 0: 'Easy Shooting', + 1: 'Program', + 2: 'Tv-priority', + 3: 'Av-priority', + 4: 'Manual', + 5: 'A-DEP' + }), + 22: ('LensType', ), + 23: ('LongFocalLengthOfLensInFocalUnits', ), + 24: ('ShortFocalLengthOfLensInFocalUnits', ), + 25: ('FocalUnitsPerMM', ), + 28: ('FlashActivity', { + 0: 'Did Not Fire', + 1: 'Fired' + }), + 29: ('FlashDetails', { + 0: 'Manual', + 1: 'TTL', + 2: 'A-TTL', + 3: 'E-TTL', + 4: 'FP Sync Enabled', + 7: '2nd("Rear")-Curtain Sync Used', + 11: 'FP Sync Used', + 13: 'Internal Flash', + 14: 'External E-TTL' + }), + 32: ('FocusMode', { + 0: 'Single', + 1: 'Continuous', + 8: 'Manual' + }), + 33: ('AESetting', { + 0: 'Normal AE', + 1: 'Exposure Compensation', + 2: 'AE Lock', + 3: 'AE Lock + Exposure Comp.', + 4: 'No AE' + }), + 34: ('ImageStabilization', { + 0: 'Off', + 1: 'On', + 2: 'Shoot Only', + 3: 'Panning', + 4: 'Dynamic', + 256: 'Off', + 257: 'On', + 258: 'Shoot Only', + 259: 'Panning', + 260: 'Dynamic' + }), + 39: ('SpotMeteringMode', { + 0: 'Center', + 1: 'AF Point' + }), + 41: ('ManualFlashOutput', { + 0x0: 'n/a', + 0x500: 'Full', + 0x502: 'Medium', + 0x504: 'Low', + 0x7fff: 'n/a' + }), +} + +# 0x0002 +FOCAL_LENGTH = { + 1: ('FocalType', { + 1: 'Fixed', + 2: 'Zoom', + }), + 2: ('FocalLength', ), +} + +# 0x0004 +SHOT_INFO = { + 7: ('WhiteBalance', { + 0: 'Auto', + 1: 'Sunny', + 2: 'Cloudy', + 3: 'Tungsten', + 4: 'Fluorescent', + 5: 'Flash', + 6: 'Custom' + }), + 8: ('SlowShutter', { + -1: 'n/a', + 0: 'Off', + 1: 'Night Scene', + 2: 'On', + 3: 'None' + }), + 9: ('SequenceNumber', ), + 14: ('AFPointUsed', ), + 15: ('FlashBias', { + 0xFFC0: '-2 EV', + 0xFFCC: '-1.67 EV', + 0xFFD0: '-1.50 EV', + 0xFFD4: '-1.33 EV', + 0xFFE0: '-1 EV', + 0xFFEC: '-0.67 EV', + 0xFFF0: '-0.50 EV', + 0xFFF4: '-0.33 EV', + 0x0000: '0 EV', + 0x000c: '0.33 EV', + 0x0010: '0.50 EV', + 0x0014: '0.67 EV', + 0x0020: '1 EV', + 0x002c: '1.33 EV', + 0x0030: '1.50 EV', + 0x0034: '1.67 EV', + 0x0040: '2 EV' + }), + 19: ('SubjectDistance', ), +} + +# 0x0026 +AF_INFO_2 = { + 2: ('AFAreaMode', { + 0: 'Off (Manual Focus)', + 2: 'Single-point AF', + 4: 'Multi-point AF or AI AF', + 5: 'Face Detect AF', + 6: 'Face + Tracking', + 7: 'Zone AF', + 8: 'AF Point Expansion', + 9: 'Spot AF', + 11: 'Flexizone Multi', + 13: 'Flexizone Single', + }), + 3: ('NumAFPoints', ), + 4: ('ValidAFPoints', ), + 5: ('CanonImageWidth', ), +} + +# 0x0093 +FILE_INFO = { + 1: ('FileNumber', ), + 3: ('BracketMode', { + 0: 'Off', + 1: 'AEB', + 2: 'FEB', + 3: 'ISO', + 4: 'WB', + }), + 4: ('BracketValue', ), + 5: ('BracketShotNumber', ), + 6: ('RawJpgQuality', { + 0xFFFF: 'n/a', + 1: 'Economy', + 2: 'Normal', + 3: 'Fine', + 4: 'RAW', + 5: 'Superfine', + 130: 'Normal Movie' + }), + 7: ('RawJpgSize', { + 0: 'Large', + 1: 'Medium', + 2: 'Small', + 5: 'Medium 1', + 6: 'Medium 2', + 7: 'Medium 3', + 8: 'Postcard', + 9: 'Widescreen', + 10: 'Medium Widescreen', + 14: 'Small 1', + 15: 'Small 2', + 16: 'Small 3', + 128: '640x480 Movie', + 129: 'Medium Movie', + 130: 'Small Movie', + 137: '1280x720 Movie', + 142: '1920x1080 Movie', + }), + 8: ('LongExposureNoiseReduction2', { + 0: 'Off', + 1: 'On (1D)', + 2: 'On', + 3: 'Auto' + }), + 9: ('WBBracketMode', { + 0: 'Off', + 1: 'On (shift AB)', + 2: 'On (shift GM)' + }), + 12: ('WBBracketValueAB', ), + 13: ('WBBracketValueGM', ), + 14: ('FilterEffect', { + 0: 'None', + 1: 'Yellow', + 2: 'Orange', + 3: 'Red', + 4: 'Green' + }), + 15: ('ToningEffect', { + 0: 'None', + 1: 'Sepia', + 2: 'Blue', + 3: 'Purple', + 4: 'Green', + }), + 16: ('MacroMagnification', ), + 19: ('LiveViewShooting', { + 0: 'Off', + 1: 'On' + }), + 25: ('FlashExposureLock', { + 0: 'Off', + 1: 'On' + }) +} + + +def add_one(value): + return value + 1 + + +def subtract_one(value): + return value - 1 + + +def convert_temp(value): + return '%d C' % (value - 128) + +# CameraInfo data structures have variable sized members. Each entry here is: +# byte offset: (item name, data item type, decoding map). +# Note that the data item type is fed directly to struct.unpack at the +# specified offset. +CAMERA_INFO_TAG_NAME = 'MakerNote Tag 0x000D' + +CAMERA_INFO_5D = { + 23: ('CameraTemperature', ' 127: + a = 256 - a + ret_str = '-' + else: + ret_str = '+' + step = seq[2] # Assume third value means the step size + whole = a / step + a = a % step + if whole != 0: + ret_str = '%s%s ' % (ret_str, str(whole)) + if a == 0: + ret_str += 'EV' + else: + r = Ratio(a, step) + ret_str = ret_str + r.__repr__() + ' EV' + return ret_str + +# Nikon E99x MakerNote Tags +NIKON_NEW = { + 0x0001: ('MakernoteVersion', make_string), # Sometimes binary + 0x0002: ('ISOSetting', make_string), + 0x0003: ('ColorMode', ), + 0x0004: ('Quality', ), + 0x0005: ('Whitebalance', ), + 0x0006: ('ImageSharpening', ), + 0x0007: ('FocusMode', ), + 0x0008: ('FlashSetting', ), + 0x0009: ('AutoFlashMode', ), + 0x000B: ('WhiteBalanceBias', ), + 0x000C: ('WhiteBalanceRBCoeff', ), + 0x000D: ('ProgramShift', nikon_ev_bias), + # Nearly the same as the other EV vals, but step size is 1/12 EV (?) + 0x000E: ('ExposureDifference', nikon_ev_bias), + 0x000F: ('ISOSelection', ), + 0x0010: ('DataDump', ), + 0x0011: ('NikonPreview', ), + 0x0012: ('FlashCompensation', nikon_ev_bias), + 0x0013: ('ISOSpeedRequested', ), + 0x0016: ('PhotoCornerCoordinates', ), + 0x0017: ('ExternalFlashExposureComp', nikon_ev_bias), + 0x0018: ('FlashBracketCompensationApplied', nikon_ev_bias), + 0x0019: ('AEBracketCompensationApplied', ), + 0x001A: ('ImageProcessing', ), + 0x001B: ('CropHiSpeed', ), + 0x001C: ('ExposureTuning', ), + 0x001D: ('SerialNumber', ), # Conflict with 0x00A0 ? + 0x001E: ('ColorSpace', ), + 0x001F: ('VRInfo', ), + 0x0020: ('ImageAuthentication', ), + 0x0022: ('ActiveDLighting', ), + 0x0023: ('PictureControl', ), + 0x0024: ('WorldTime', ), + 0x0025: ('ISOInfo', ), + 0x0080: ('ImageAdjustment', ), + 0x0081: ('ToneCompensation', ), + 0x0082: ('AuxiliaryLens', ), + 0x0083: ('LensType', ), + 0x0084: ('LensMinMaxFocalMaxAperture', ), + 0x0085: ('ManualFocusDistance', ), + 0x0086: ('DigitalZoomFactor', ), + 0x0087: ('FlashMode', { + 0x00: 'Did Not Fire', + 0x01: 'Fired, Manual', + 0x07: 'Fired, External', + 0x08: 'Fired, Commander Mode ', + 0x09: 'Fired, TTL Mode', + }), + 0x0088: ('AFFocusPosition', { + 0x0000: 'Center', + 0x0100: 'Top', + 0x0200: 'Bottom', + 0x0300: 'Left', + 0x0400: 'Right', + }), + 0x0089: ('BracketingMode', { + 0x00: 'Single frame, no bracketing', + 0x01: 'Continuous, no bracketing', + 0x02: 'Timer, no bracketing', + 0x10: 'Single frame, exposure bracketing', + 0x11: 'Continuous, exposure bracketing', + 0x12: 'Timer, exposure bracketing', + 0x40: 'Single frame, white balance bracketing', + 0x41: 'Continuous, white balance bracketing', + 0x42: 'Timer, white balance bracketing' + }), + 0x008A: ('AutoBracketRelease', ), + 0x008B: ('LensFStops', ), + 0x008C: ('NEFCurve1', ), # ExifTool calls this 'ContrastCurve' + 0x008D: ('ColorMode', ), + 0x008F: ('SceneMode', ), + 0x0090: ('LightingType', ), + 0x0091: ('ShotInfo', ), # First 4 bytes are a version number in ASCII + 0x0092: ('HueAdjustment', ), + # ExifTool calls this 'NEFCompression', should be 1-4 + 0x0093: ('Compression', ), + 0x0094: ('Saturation', { + -3: 'B&W', + -2: '-2', + -1: '-1', + 0: '0', + 1: '1', + 2: '2', + }), + 0x0095: ('NoiseReduction', ), + 0x0096: ('NEFCurve2', ), # ExifTool calls this 'LinearizationTable' + 0x0097: ('ColorBalance', ), # First 4 bytes are a version number in ASCII + 0x0098: ('LensData', ), # First 4 bytes are a version number in ASCII + 0x0099: ('RawImageCenter', ), + 0x009A: ('SensorPixelSize', ), + 0x009C: ('Scene Assist', ), + 0x009E: ('RetouchHistory', ), + 0x00A0: ('SerialNumber', ), + 0x00A2: ('ImageDataSize', ), + # 00A3: unknown - a single byte 0 + # 00A4: In NEF, looks like a 4 byte ASCII version number ('0200') + 0x00A5: ('ImageCount', ), + 0x00A6: ('DeletedImageCount', ), + 0x00A7: ('TotalShutterReleases', ), + # First 4 bytes are a version number in ASCII, with version specific + # info to follow. Its hard to treat it as a string due to embedded nulls. + 0x00A8: ('FlashInfo', ), + 0x00A9: ('ImageOptimization', ), + 0x00AA: ('Saturation', ), + 0x00AB: ('DigitalVariProgram', ), + 0x00AC: ('ImageStabilization', ), + 0x00AD: ('AFResponse', ), + 0x00B0: ('MultiExposure', ), + 0x00B1: ('HighISONoiseReduction', ), + 0x00B6: ('PowerUpTime', ), + 0x00B7: ('AFInfo2', ), + 0x00B8: ('FileInfo', ), + 0x00B9: ('AFTune', ), + 0x0100: ('DigitalICE', ), + 0x0103: ('PreviewCompression', { + 1: 'Uncompressed', + 2: 'CCITT 1D', + 3: 'T4/Group 3 Fax', + 4: 'T6/Group 4 Fax', + 5: 'LZW', + 6: 'JPEG (old-style)', + 7: 'JPEG', + 8: 'Adobe Deflate', + 9: 'JBIG B&W', + 10: 'JBIG Color', + 32766: 'Next', + 32769: 'Epson ERF Compressed', + 32771: 'CCIRLEW', + 32773: 'PackBits', + 32809: 'Thunderscan', + 32895: 'IT8CTPAD', + 32896: 'IT8LW', + 32897: 'IT8MP', + 32898: 'IT8BL', + 32908: 'PixarFilm', + 32909: 'PixarLog', + 32946: 'Deflate', + 32947: 'DCS', + 34661: 'JBIG', + 34676: 'SGILog', + 34677: 'SGILog24', + 34712: 'JPEG 2000', + 34713: 'Nikon NEF Compressed', + 65000: 'Kodak DCR Compressed', + 65535: 'Pentax PEF Compressed', + }), + 0x0201: ('PreviewImageStart', ), + 0x0202: ('PreviewImageLength', ), + 0x0213: ('PreviewYCbCrPositioning', { + 1: 'Centered', + 2: 'Co-sited', + }), + 0x0E09: ('NikonCaptureVersion', ), + 0x0E0E: ('NikonCaptureOffsets', ), + 0x0E10: ('NikonScan', ), + 0x0E22: ('NEFBitDepth', ), +} + +NIKON_OLD = { + 0x0003: ('Quality', { + 1: 'VGA Basic', + 2: 'VGA Normal', + 3: 'VGA Fine', + 4: 'SXGA Basic', + 5: 'SXGA Normal', + 6: 'SXGA Fine', + }), + 0x0004: ('ColorMode', { + 1: 'Color', + 2: 'Monochrome', + }), + 0x0005: ('ImageAdjustment', { + 0: 'Normal', + 1: 'Bright+', + 2: 'Bright-', + 3: 'Contrast+', + 4: 'Contrast-', + }), + 0x0006: ('CCDSpeed', { + 0: 'ISO 80', + 2: 'ISO 160', + 4: 'ISO 320', + 5: 'ISO 100', + }), + 0x0007: ('WhiteBalance', { + 0: 'Auto', + 1: 'Preset', + 2: 'Daylight', + 3: 'Incandescent', + 4: 'Fluorescent', + 5: 'Cloudy', + 6: 'Speed Light', + }), +} + + +def olympus_special_mode(v): + """decode Olympus SpecialMode tag in MakerNote""" + mode1 = { + 0: 'Normal', + 1: 'Unknown', + 2: 'Fast', + 3: 'Panorama', + } + mode2 = { + 0: 'Non-panoramic', + 1: 'Left to right', + 2: 'Right to left', + 3: 'Bottom to top', + 4: 'Top to bottom', + } + if not v or (v[0] not in mode1 or v[2] not in mode2): + return v + return '%s - sequence %d - %s' % (mode1[v[0]], v[1], mode2[v[2]]) + + +OLYMPUS = { + # ah HAH! those sneeeeeaky bastids! this is how they get past the fact + # that a JPEG thumbnail is not allowed in an uncompressed TIFF file + 0x0100: ('JPEGThumbnail', ), + 0x0200: ('SpecialMode', olympus_special_mode), + 0x0201: ('JPEGQual', { + 1: 'SQ', + 2: 'HQ', + 3: 'SHQ', + }), + 0x0202: ('Macro', { + 0: 'Normal', + 1: 'Macro', + 2: 'SuperMacro' + }), + 0x0203: ('BWMode', { + 0: 'Off', + 1: 'On' + }), + 0x0204: ('DigitalZoom', ), + 0x0205: ('FocalPlaneDiagonal', ), + 0x0206: ('LensDistortionParams', ), + 0x0207: ('SoftwareRelease', ), + 0x0208: ('PictureInfo', ), + 0x0209: ('CameraID', make_string), # print as string + 0x0F00: ('DataDump', ), + 0x0300: ('PreCaptureFrames', ), + 0x0404: ('SerialNumber', ), + 0x1000: ('ShutterSpeedValue', ), + 0x1001: ('ISOValue', ), + 0x1002: ('ApertureValue', ), + 0x1003: ('BrightnessValue', ), + 0x1004: ('FlashMode', { + 2: 'On', + 3: 'Off' + }), + 0x1005: ('FlashDevice', { + 0: 'None', + 1: 'Internal', + 4: 'External', + 5: 'Internal + External' + }), + 0x1006: ('ExposureCompensation', ), + 0x1007: ('SensorTemperature', ), + 0x1008: ('LensTemperature', ), + 0x100b: ('FocusMode', { + 0: 'Auto', + 1: 'Manual' + }), + 0x1017: ('RedBalance', ), + 0x1018: ('BlueBalance', ), + 0x101a: ('SerialNumber', ), + 0x1023: ('FlashExposureComp', ), + 0x1026: ('ExternalFlashBounce', { + 0: 'No', + 1: 'Yes' + }), + 0x1027: ('ExternalFlashZoom', ), + 0x1028: ('ExternalFlashMode', ), + 0x1029: ('Contrast int16u', { + 0: 'High', + 1: 'Normal', + 2: 'Low' + }), + 0x102a: ('SharpnessFactor', ), + 0x102b: ('ColorControl', ), + 0x102c: ('ValidBits', ), + 0x102d: ('CoringFilter', ), + 0x102e: ('OlympusImageWidth', ), + 0x102f: ('OlympusImageHeight', ), + 0x1034: ('CompressionRatio', ), + 0x1035: ('PreviewImageValid', { + 0: 'No', + 1: 'Yes' + }), + 0x1036: ('PreviewImageStart', ), + 0x1037: ('PreviewImageLength', ), + 0x1039: ('CCDScanMode', { + 0: 'Interlaced', + 1: 'Progressive' + }), + 0x103a: ('NoiseReduction', { + 0: 'Off', + 1: 'On' + }), + 0x103b: ('InfinityLensStep', ), + 0x103c: ('NearLensStep', ), + + # TODO - these need extra definitions + # http://search.cpan.org/src/EXIFTOOL/Image-ExifTool-6.90/html/TagNames/Olympus.html + 0x2010: ('Equipment', ), + 0x2020: ('CameraSettings', ), + 0x2030: ('RawDevelopment', ), + 0x2040: ('ImageProcessing', ), + 0x2050: ('FocusInfo', ), + 0x3000: ('RawInfo ', ), +} + +# 0x2020 CameraSettings +OLYMPUS_TAG_0x2020 = { + 0x0100: ('PreviewImageValid', { + 0: 'No', + 1: 'Yes' + }), + 0x0101: ('PreviewImageStart', ), + 0x0102: ('PreviewImageLength', ), + 0x0200: ('ExposureMode', { + 1: 'Manual', + 2: 'Program', + 3: 'Aperture-priority AE', + 4: 'Shutter speed priority AE', + 5: 'Program-shift' + }), + 0x0201: ('AELock', { + 0: 'Off', + 1: 'On' + }), + 0x0202: ('MeteringMode', { + 2: 'Center Weighted', + 3: 'Spot', + 5: 'ESP', + 261: 'Pattern+AF', + 515: 'Spot+Highlight control', + 1027: 'Spot+Shadow control' + }), + 0x0300: ('MacroMode', { + 0: 'Off', + 1: 'On' + }), + 0x0301: ('FocusMode', { + 0: 'Single AF', + 1: 'Sequential shooting AF', + 2: 'Continuous AF', + 3: 'Multi AF', + 10: 'MF' + }), + 0x0302: ('FocusProcess', { + 0: 'AF Not Used', + 1: 'AF Used' + }), + 0x0303: ('AFSearch', { + 0: 'Not Ready', + 1: 'Ready' + }), + 0x0304: ('AFAreas', ), + 0x0401: ('FlashExposureCompensation', ), + 0x0500: ('WhiteBalance2', { + 0: 'Auto', + 16: '7500K (Fine Weather with Shade)', + 17: '6000K (Cloudy)', + 18: '5300K (Fine Weather)', + 20: '3000K (Tungsten light)', + 21: '3600K (Tungsten light-like)', + 33: '6600K (Daylight fluorescent)', + 34: '4500K (Neutral white fluorescent)', + 35: '4000K (Cool white fluorescent)', + 48: '3600K (Tungsten light-like)', + 256: 'Custom WB 1', + 257: 'Custom WB 2', + 258: 'Custom WB 3', + 259: 'Custom WB 4', + 512: 'Custom WB 5400K', + 513: 'Custom WB 2900K', + 514: 'Custom WB 8000K', + }), + 0x0501: ('WhiteBalanceTemperature', ), + 0x0502: ('WhiteBalanceBracket', ), + 0x0503: ('CustomSaturation', ), # (3 numbers: 1. CS Value, 2. Min, 3. Max) + 0x0504: ('ModifiedSaturation', { + 0: 'Off', + 1: 'CM1 (Red Enhance)', + 2: 'CM2 (Green Enhance)', + 3: 'CM3 (Blue Enhance)', + 4: 'CM4 (Skin Tones)', + }), + 0x0505: ('ContrastSetting', ), # (3 numbers: 1. Contrast, 2. Min, 3. Max) + 0x0506: ('SharpnessSetting', ), # (3 numbers: 1. Sharpness, 2. Min, 3. Max) + 0x0507: ('ColorSpace', { + 0: 'sRGB', + 1: 'Adobe RGB', + 2: 'Pro Photo RGB' + }), + 0x0509: ('SceneMode', { + 0: 'Standard', + 6: 'Auto', + 7: 'Sport', + 8: 'Portrait', + 9: 'Landscape+Portrait', + 10: 'Landscape', + 11: 'Night scene', + 13: 'Panorama', + 16: 'Landscape+Portrait', + 17: 'Night+Portrait', + 19: 'Fireworks', + 20: 'Sunset', + 22: 'Macro', + 25: 'Documents', + 26: 'Museum', + 28: 'Beach&Snow', + 30: 'Candle', + 35: 'Underwater Wide1', + 36: 'Underwater Macro', + 39: 'High Key', + 40: 'Digital Image Stabilization', + 44: 'Underwater Wide2', + 45: 'Low Key', + 46: 'Children', + 48: 'Nature Macro', + }), + 0x050a: ('NoiseReduction', { + 0: 'Off', + 1: 'Noise Reduction', + 2: 'Noise Filter', + 3: 'Noise Reduction + Noise Filter', + 4: 'Noise Filter (ISO Boost)', + 5: 'Noise Reduction + Noise Filter (ISO Boost)' + }), + 0x050b: ('DistortionCorrection', { + 0: 'Off', + 1: 'On' + }), + 0x050c: ('ShadingCompensation', { + 0: 'Off', + 1: 'On' + }), + 0x050d: ('CompressionFactor', ), + 0x050f: ('Gradation', { + '-1 -1 1': 'Low Key', + '0 -1 1': 'Normal', + '1 -1 1': 'High Key' + }), + 0x0520: ('PictureMode', { + 1: 'Vivid', + 2: 'Natural', + 3: 'Muted', + 256: 'Monotone', + 512: 'Sepia' + }), + 0x0521: ('PictureModeSaturation', ), + 0x0522: ('PictureModeHue?', ), + 0x0523: ('PictureModeContrast', ), + 0x0524: ('PictureModeSharpness', ), + 0x0525: ('PictureModeBWFilter', { + 0: 'n/a', + 1: 'Neutral', + 2: 'Yellow', + 3: 'Orange', + 4: 'Red', + 5: 'Green' + }), + 0x0526: ('PictureModeTone', { + 0: 'n/a', + 1: 'Neutral', + 2: 'Sepia', + 3: 'Blue', + 4: 'Purple', + 5: 'Green' + }), + 0x0600: ('Sequence', ), # 2 or 3 numbers: 1. Mode, 2. Shot number, 3. Mode bits + 0x0601: ('PanoramaMode', ), # (2 numbers: 1. Mode, 2. Shot number) + 0x0603: ('ImageQuality2', { + 1: 'SQ', + 2: 'HQ', + 3: 'SHQ', + 4: 'RAW', + }), + 0x0901: ('ManometerReading', ), +} + +CASIO = { + 0x0001: ('RecordingMode', { + 1: 'Single Shutter', + 2: 'Panorama', + 3: 'Night Scene', + 4: 'Portrait', + 5: 'Landscape', + }), + 0x0002: ('Quality', { + 1: 'Economy', + 2: 'Normal', + 3: 'Fine' + }), + 0x0003: ('FocusingMode', { + 2: 'Macro', + 3: 'Auto Focus', + 4: 'Manual Focus', + 5: 'Infinity' + }), + 0x0004: ('FlashMode', { + 1: 'Auto', + 2: 'On', + 3: 'Off', + 4: 'Red Eye Reduction', + }), + 0x0005: ('FlashIntensity', { + 11: 'Weak', + 13: 'Normal', + 15: 'Strong' + }), + 0x0006: ('Object Distance', ), + 0x0007: ('WhiteBalance', { + 1: 'Auto', + 2: 'Tungsten', + 3: 'Daylight', + 4: 'Fluorescent', + 5: 'Shade', + 129: 'Manual' + }), + 0x000B: ('Sharpness', { + 0: 'Normal', + 1: 'Soft', + 2: 'Hard', + }), + 0x000C: ('Contrast', { + 0: 'Normal', + 1: 'Low', + 2: 'High', + }), + 0x000D: ('Saturation', { + 0: 'Normal', + 1: 'Low', + 2: 'High', + }), + 0x0014: ('CCDSpeed', { + 64: 'Normal', + 80: 'Normal', + 100: 'High', + 125: '+1.0', + 244: '+3.0', + 250: '+2.0' + }), +} diff -Nru metamorphose2-0.8.4/src/exif/.git metamorphose2-0.8.4+git20160722/src/exif/.git --- metamorphose2-0.8.4/src/exif/.git 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/.git 2017-01-25 12:35:16.000000000 +0000 @@ -0,0 +1 @@ +gitdir: ../../.git/modules/exif-py diff -Nru metamorphose2-0.8.4/src/exif/.gitattributes metamorphose2-0.8.4+git20160722/src/exif/.gitattributes --- metamorphose2-0.8.4/src/exif/.gitattributes 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/.gitattributes 2017-01-25 12:35:16.000000000 +0000 @@ -0,0 +1,11 @@ +# +# Git normalization +# + +.gitattributes export-ignore +.gitignore export-ignore + +*.py text eol=lf diff=python whitespace=blank-at-eol,space-before-tab,tab-in-indent,tabwidth=4 +*.txt text eol=lf whitespace=blank-at-eol +*.rst text eol=lf whitespace=blank-at-eol +*.in text eol=lf whitespace=blank-at-eol diff -Nru metamorphose2-0.8.4/src/exif/.gitignore metamorphose2-0.8.4+git20160722/src/exif/.gitignore --- metamorphose2-0.8.4/src/exif/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/.gitignore 2017-01-25 12:35:16.000000000 +0000 @@ -0,0 +1,53 @@ +*.py[co] + +# OS +.directory + +# Images +*.jpg +*.jpeg +*.tif +*.tiff + +# Archives +*.gz +*.zip + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +MANIFEST + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox +exif-samples* + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg + +# PyCharm +.idea + +# Eclipse +.project +.pydevproject +.settings + +# Misc +*swp diff -Nru metamorphose2-0.8.4/src/exif/.travis.yml metamorphose2-0.8.4+git20160722/src/exif/.travis.yml --- metamorphose2-0.8.4/src/exif/.travis.yml 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/exif/.travis.yml 2017-01-25 12:35:16.000000000 +0000 @@ -0,0 +1,16 @@ +language: python +python: + - "2.6" + - "2.7" + - "3.2" + - "3.3" + - "3.4" +install: + - "pip install ." +# get the test images +before_script: + - "wget https://github.com/ianare/exif-samples/archive/master.tar.gz" + - "tar -xzf master.tar.gz" +script: + - "find exif-samples-master -name *.tiff -o -name *.jpg | xargs EXIF.py" + - "find exif-samples-master -name *.tiff -o -name *.jpg | xargs EXIF.py -dc" diff -Nru metamorphose2-0.8.4/src/langSelect.py metamorphose2-0.8.4+git20160722/src/langSelect.py --- metamorphose2-0.8.4/src/langSelect.py 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/langSelect.py 2017-01-25 12:35:14.000000000 +0000 @@ -88,6 +88,7 @@ self.ok = wx.Button(id=wx.ID_OK, name=u'ok', parent=self, pos=wx.Point(20, 300), style=0) + self.ok.SetDefault() self.cancel = wx.Button(id=wx.ID_CANCEL, name=u'cancel', parent=self, pos=wx.Point(120, 300), style=0) diff -Nru metamorphose2-0.8.4/src/MainWindow/__init__.py metamorphose2-0.8.4+git20160722/src/MainWindow/__init__.py --- metamorphose2-0.8.4/src/MainWindow/__init__.py 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/MainWindow/__init__.py 2017-01-25 12:35:14.000000000 +0000 @@ -389,6 +389,7 @@ name=u'statusBar1', parent=self) self.SetStatusBar(self.statusBar1) + self.statusImage = wx.StaticBitmap(bitmap=self.statusImages[u'eyes'], id=wxID_MAIN_WINDOWSTATUSIMAGE, name=u'statusImage', parent=self.statusBar1, size=wx.Size(-1, 16), style=0) @@ -421,6 +422,7 @@ or neither. Apply language to interface. """ + app.debug_print("== Interface Localization ==") # reference: locales = { @@ -474,7 +476,7 @@ # set locale and language wx.Locale(locales[language][0], wx.LOCALE_LOAD_DEFAULT) - + try: Lang = gettext.translation(u'metamorphose2', app.locale_path(language), languages=[locales[language][1]]) @@ -482,7 +484,7 @@ print("Could not find the translation file for '%s'." % language) print("Try running messages/update_langs.sh\n") sys.exit(1) - + Lang.install(unicode=True) # set some globals @@ -493,7 +495,10 @@ self.langLTR = False self.alignment = wx.ALIGN_RIGHT app.language = language + app.debug_print("Set language: " + app.language) + self.encoding = unicode(locale.getlocale()[1]) + app.debug_print("Set encoding: " + self.encoding) # to get some language settings to display properly: if platform.system() in ('Linux', 'FreeBSD'): @@ -501,6 +506,9 @@ os.environ['LANG'] = locales[language][1] except (ValueError, KeyError): pass + app.debug_print("============================") + app.debug_print("") + def __init__(self, prnt, options): # Important variables needed throughout the application classes @@ -509,21 +517,37 @@ self.errorLog = [] # all errors go here self.items = [] # items to rename self.spacer = u" " * 6 # spacer for status messages (to clear image) + # icons used for status bar messages + self.statusImages = { + u'failed': wx.Bitmap(utils.icon_path(u'failed_sb.ico'), + wx.BITMAP_TYPE_ICO), + u'wait': wx.Bitmap(utils.icon_path(u'wait.png'), + wx.BITMAP_TYPE_PNG), + u'warn': wx.Bitmap(utils.icon_path(u'warn_sb.ico'), + wx.BITMAP_TYPE_ICO), + u'complete': wx.Bitmap(utils.icon_path(u'complete.ico'), + wx.BITMAP_TYPE_ICO), + u'eyes': wx.Bitmap(utils.icon_path(u'eyes.png'), + wx.BITMAP_TYPE_PNG), + } + app.debug_print("Init MainWindow") wx.Frame.__init__(self, id=wxID_MAIN_WINDOW, name=u'MainWindow', parent=prnt, style=wx.DEFAULT_FRAME_STYLE) + app.debug_print("") + + app.debug_print("======== System Info =======") + app.debug_print("Operating System: %s - %s - %s" % (platform.system(), platform.release(), platform.version())) + app.debug_print("Python version: %s" % platform.python_version()) + app.debug_print("wxPython version: %s" % wx.version()) + app.debug_print("============================") + app.debug_print("") # first run? utils.init_environment() self.set_language() - app.debug_print("Operating System: %s - %s - %s" % (platform.system(), platform.release(), platform.version())) - app.debug_print("System encoding: " + self.encoding) - app.debug_print("Python version: " + platform.python_version()) - app.debug_print("wxPython version: " + utils.get_wxversion()) - app.debug_print("Interface language: " + app.language) - # import these modules here since they need language settings activated global renamer import renamer @@ -535,21 +559,11 @@ import bottomWindow # initialize preferences + app.debug_print("======== Preferences =======") app.prefs = preferences.Methods() + app.debug_print("============================") + app.debug_print("") - # icons used for status bar messages - self.statusImages = { - u'failed': wx.Bitmap(utils.icon_path(u'failed_sb.ico'), - wx.BITMAP_TYPE_ICO), - u'wait': wx.Bitmap(utils.icon_path(u'wait.png'), - wx.BITMAP_TYPE_PNG), - u'warn': wx.Bitmap(utils.icon_path(u'warn_sb.ico'), - wx.BITMAP_TYPE_ICO), - u'complete': wx.Bitmap(utils.icon_path(u'complete.ico'), - wx.BITMAP_TYPE_ICO), - u'eyes': wx.Bitmap(utils.icon_path(u'eyes.png'), - wx.BITMAP_TYPE_PNG), - } # build main GUI self.__init_ctrls(prnt) @@ -650,7 +664,7 @@ """Set status bar text and image.""" self.statusImage.SetBitmap(self.statusImages[img]) self.SetStatusText(self.make_space(msg)) - app.debug_print(u"status message : '%s'" % msg) + app.debug_print(u"status message: '%s'" % msg) # #--- MENU ACTIONS: -----------------------------------------------------------# diff -Nru metamorphose2-0.8.4/src/metamorphose2.py metamorphose2-0.8.4+git20160722/src/metamorphose2.py --- metamorphose2-0.8.4/src/metamorphose2.py 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/metamorphose2.py 2017-01-25 12:35:14.000000000 +0000 @@ -30,7 +30,9 @@ from __future__ import print_function import sys -import getopt +import os +import platform +from getopt import GetoptError, getopt import app @@ -42,8 +44,6 @@ except ImportError: print("\nwxPython required!\n") sys.exit() -import os -import platform def usage(): @@ -97,8 +97,8 @@ short_options = "htdp:vc:va:vl:vw:v" long_options = ["help", "timer", "debug", "path=", "config=", "auto=", "language=", "wx="] try: - opts, args = getopt.getopt(sys.argv[1:], short_options, long_options) - except getopt.GetoptError as err: + opts, args = getopt(sys.argv[1:], short_options, long_options) + except GetoptError as err: print(str(err)) sys.exit(2) @@ -107,7 +107,7 @@ 'configFilePath': False, } - wx_version = '2.8' + wx_version = ('2.8', '3.0') if sys.argv[1:] != [] and opts == []: options['path'] = '' @@ -121,7 +121,8 @@ elif o in ("-d", "--debug"): app.debug = True print("Running in debug mode") - print("Version: " + app.version) + print("Application Version: %s" % app.version) + print("Preferences Version: %s" % app.prefsVersion) elif o in ("-p", "--path"): options['path'] = strip_leading(a) elif o in ("-h", "--help"): @@ -142,9 +143,6 @@ elif not hasattr(sys, "frozen") and o in ("-w", "--wxversion"): wx_version = strip_leading(a) - if wx_version != '2.8': - print("\nWarning: Metamorphose has only been tested on wxPython version 2.8!\n") - return wx_version, options @@ -157,11 +155,12 @@ except (ValueError, KeyError): pass - try: - wxversion.select(wx_version) - except wxversion.VersionError: - print("\nFailed to load wxPython version %s!\n" % wx_version) - sys.exit() + if not hasattr(sys, "frozen"): + try: + wxversion.select(wx_version) + except wxversion.VersionError: + print("\nFailed to load wxPython version %s!\n" % wx_version) + sys.exit() import wx if 'unicode' not in wx.PlatformInfo: @@ -175,7 +174,6 @@ class BoaApp(wx.App): def OnInit(self): - wx.InitAllImageHandlers() self.main = MainWindow.create(None, cli_options) self.main.Show() self.SetTopWindow(self.main) diff -Nru metamorphose2-0.8.4/src/preferences/default.ini metamorphose2-0.8.4+git20160722/src/preferences/default.ini --- metamorphose2-0.8.4/src/preferences/default.ini 1970-01-01 00:00:00.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/preferences/default.ini 2017-01-25 12:35:14.000000000 +0000 @@ -0,0 +1,44 @@ +Version=0.9.0 (beta) + +[General] +clearUndo=0 +useDirTree=1 +showHiddenDirs=0 +encodingGroup=0 +encodingSelect=None + +[Display] +showPreviewIcons=1 +onlyShowChangedItems=0 +showPreviewHighlight=1 +renRefreshMin=80 +showProgressDialog=1 +itemCountForProgDialog=200 + +[Colors] +willChangeColor=#E5FFE5 +renamedColor=#97F27F +errorColor=#FF1616 +warnColor=#FDEB22 + +[Automate] +autoSelectAll=1 +reloadAfterRename=0 +alwaysMakeLog=0 +previewOnConfig=1 +autoShowError=0 + +[Logging] +logLocation=/home/ianare/.metamorphose2/undo +logSeparator=::: +logEnclose= +logFextension=log + +[Error Checks] +useWinChars=1 +markWarning=1 +markBadChars=0 +deleteBadChars=0 +useWinNames=0 +winNamesWarn=1 +winNamesBad=0 diff -Nru metamorphose2-0.8.4/src/preferences/dialog.py metamorphose2-0.8.4+git20160722/src/preferences/dialog.py --- metamorphose2-0.8.4/src/preferences/dialog.py 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/preferences/dialog.py 2017-01-25 12:35:14.000000000 +0000 @@ -26,7 +26,9 @@ class Notebook(wx.Toolbook): - """Notebook for preferences.""" + """ + Notebook for preferences. + """ def __init__(self, parent, id, name): wx.Toolbook.__init__(self, parent, id, name=name, style=wx.BK_TOP) @@ -53,8 +55,7 @@ page = page(self) self.AddPage(page, pane[1], imageId=pane[2]) notebookPage = self.GetPage(i) - if not parent.initial: - parent.load_prefs(notebookPage) + parent.load_prefs(notebookPage) if hasattr(notebookPage, 'init_enabled'): notebookPage.init_enabled() i += 1 @@ -81,7 +82,6 @@ self.buttons = wx.BoxSizer(orient=wx.HORIZONTAL) self.__init_mainsizer_items(self.mainSizer) self.__init_buttons_items(self.buttons) - utils.set_min_size(self, ignoreClasses=( wx.TextCtrl, wx.Button, wx.Choice, wx.SpinCtrl, wx.FilePickerCtrl, wx.DirPickerCtrl, wx.ColourPickerCtrl)) @@ -89,62 +89,77 @@ def __init_ctrls(self, parent): wx.Dialog.__init__(self, name=u'dialog', parent=parent, - style=wx.CAPTION, title=u'Preferences') + style=wx.CAPTION | wx.STAY_ON_TOP, title=_(u"Preferences")) self.SetIcon(wx.Icon(utils.icon_path(u'preferences.ico'), wx.BITMAP_TYPE_ICO)) - self.notebook = Notebook(id=-1, name=u'notebook', parent=self) - self.apply = wx.Button(id=wx.ID_APPLY, name=u'apply', parent=self, style=0) self.apply.Bind(wx.EVT_BUTTON, self.__on_apply_button) self.ok = wx.Button(id=wx.ID_OK, name=u'ok', parent=self, style=0) + self.ok.SetDefault() self.ok.Bind(wx.EVT_BUTTON, self.__on_ok_button) self.close = wx.Button(id=wx.ID_CANCEL, name=u'close', parent=self, style=0) self.close.Bind(wx.EVT_BUTTON, self.__close_diag) + self.notebook = Notebook(id=-1, name=u'notebook', parent=self) + self.__init_sizers() - def __init__(self, parent, prefs, initial): + def __init__(self, parent, methods, initial): + app.debug_print("Open preferences dialog") global main main = parent - self.initial = initial - self.prefs = prefs + self.prefs = methods self.__init_ctrls(parent) - if initial: - self.close.Enable(False) - self.apply.Enable(False) - + self.CentreOnScreen() # to see if these change when applying - if not initial: - self.oldDirTree = self.prefs.get(u'useDirTree') - self.oldSHowHiddenDirs = self.prefs.get(u'showHiddenDirs') + self.oldDirTree = self.prefs.get(u'useDirTree') + self.oldSHowHiddenDirs = self.prefs.get(u'showHiddenDirs') def __on_apply_button(self, event): + app.debug_print("Save preferences from dialog") self.prefs.set_prefs(self) prefs = app.prefs = self.prefs - if not self.initial: - if prefs.get(u'useDirTree') != self.oldDirTree: - main.picker.set_tree() - if prefs.get(u'showHiddenDirs') != self.oldSHowHiddenDirs: - main.picker.dirPicker.ShowHidden(prefs.get(u'showHiddenDirs')) - self.oldDirTree = prefs.get(u'useDirTree') - self.oldSHowHiddenDirs = prefs.get(u'showHiddenDirs') - main.bottomWindow.display.set_preferences() - main.show_preview(True) + if prefs.get(u'useDirTree') != self.oldDirTree: + main.picker.set_tree() + if prefs.get(u'showHiddenDirs') != self.oldSHowHiddenDirs: + main.picker.dirPicker.ShowHidden(prefs.get(u'showHiddenDirs')) + self.oldDirTree = prefs.get(u'useDirTree') + self.oldSHowHiddenDirs = prefs.get(u'showHiddenDirs') + main.bottomWindow.display.set_preferences() + main.show_preview(True) def load_prefs(self, panel): - """load preferences from file and apply them to a panel.""" - app.debug_print('Loading %s preferences ...' % panel.GetName()) + """ + load preferences from file and apply them to a panel. + """ + app.debug_print('Load preferences from file into %s' % panel.GetName()) + object_types = ( + wx.CheckBox, + wx.RadioButton, + wx.SpinCtrl, + wx.ComboBox, + wx.TextCtrl, + wx.Choice, + wx.DirPickerCtrl, + wx.FilePickerCtrl, + wx.ColourPickerCtrl + ) for child in panel.GetChildren(): + if not isinstance(child, object_types): + continue + child_name = child.GetName() try: - v = self.prefs.get(child.GetName(), False) + v = self.prefs.get(child_name) except KeyError: - pass + app.debug_print("Could not find value for: '%s'" % (child_name)) + # forces the user to apply prefs, hopefully fixing the file + self.close.Enable(False) else: - app.debug_print(" %s = %s" % (child.GetName(), v)) + app.debug_print(" %s = %s" % (child_name, v)) if isinstance(child, wx.CheckBox) or isinstance(child, wx.RadioButton)\ or isinstance(child, wx.SpinCtrl): child.SetValue(v) @@ -158,11 +173,8 @@ child.SetColour(v) def __close_diag(self, event): - self.Close() + self.Destroy() def __on_ok_button(self, event): self.__on_apply_button(event) - self.Close() - - - + self.Destroy() diff -Nru metamorphose2-0.8.4/src/preferences/__init__.py metamorphose2-0.8.4+git20160722/src/preferences/__init__.py --- metamorphose2-0.8.4/src/preferences/__init__.py 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/preferences/__init__.py 2017-01-25 12:35:14.000000000 +0000 @@ -25,11 +25,15 @@ import errorCheck import general import utils +import sys import wx +import platform def create_dialog(parent, initial=False): - """Create and return the preferences dialog.""" + """ + Create and return the preferences dialog. + """ return Dialog(parent, Methods(), initial) @@ -37,39 +41,49 @@ """ Preference methods. """ - def __init__(self): + def __init__(self,): self.header = u'Version=%s\n' % app.version self.prefs = False + self.key_error = False + self.prefFilePath = self.__find_pref_file() + self.__load_preferences() def __find_pref_file(self): prefFile = utils.get_user_path(u'preferences.ini') return prefFile - def __open_pref_file(self, type): - prefFile = self.__find_pref_file() - app.debug_print("Opening as '%s' : %s" % (type, prefFile)) - prefFile = codecs.open(prefFile, type, 'utf-8') + def __open_pref_file(self, path, mode): + app.debug_print("Opening as '%s': %s" % (mode, path)) + prefFile = codecs.open(path, mode, 'utf-8') return prefFile - def __create_new(self): - """Create default preferences file.""" - msg = _(u"Please take a moment to set your preferences.\n\n") - title = _(u"Preferences") - utils.make_warn_msg(msg, title) + def __use_defaults(self): + """ + Use the default preferences file. + """ + app.debug_print("Using default preferences") # show preferences prefDiag = Dialog(None, self, initial=True) prefDiag.ShowModal() - prefDiag.Destroy() + try: + prefDiag.Destroy() + except wx._core.PyDeadObjectError: + app.debug_print("=======================") + pass - def __read_file(self): - """Process file and return preferences dictionary.""" - prefFile = self.__open_pref_file('r') + def __read_file(self, path): + """ + Process file and return preferences dictionary. + """ + prefFile = self.__open_pref_file(path, 'r') prefFile.seek(0) version = prefFile.readline().strip()[8:] - # preferences are from prior version, create new file - if version[:4] != app.version[:4]: - prefs = self.__create_new() + + # TODO preferences from a prior version + if version != app.prefsVersion: + app.debug_print("Old version found") + prefFile.seek(0) prefs = {} for line in prefFile: @@ -87,17 +101,24 @@ return prefs def __load_preferences(self): - """Get values from file (one way or another)""" + """ + Get values from file (one way or another) + """ prefFile = self.__find_pref_file() + app.debug_print("Try to load preferences from file") # make sure the file exist and is filled: if not os.path.exists(prefFile) or os.path.getsize(prefFile) < 5: - self.__create_new() - prefs = self.__read_file() - - # windows-compatible ? - if prefs[u'useWinChars']: + app.debug_print("File does not exist or is empty: Using default preferences") + prefFile = app.get_real_path(os.path.join('preferences', 'default.ini')) + self.prefFilePath = prefFile + prefs = self.__read_file(prefFile) + + # windows-compatible? + if platform.system() != 'Windows': + win_compatible = False + if prefs.get(u'useWinChars', win_compatible): prefs[u'bad_chars'] = (u'\\', u'/', u':', u'*', u'?', u'"', u'>', u'<', u'|') - if prefs[u'useWinNames']: + if prefs.get(u'useWinNames', win_compatible): prefs[u'bad_win_words'] = (u'con', u'prn', u'aux', u'clock$', u'nul', u'com1', u'com2', u'com3', u'com4', u'com5', u'com6', u'com7', u'com8', u'com9', u'lpt1', u'lpt2', u'lpt3', u'lpt4', u'lpt5', u'lpt6', @@ -107,13 +128,18 @@ prefs[u'highlightColor'] = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHT) prefs[u'highlightTextColor'] = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT) prefs[u'textColor'] = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT) - + app.debug_print("Loaded %s preferences" % len(prefs)) self.prefs = prefs def set_prefs(self, prefDialog): - """Get values from panels and set to file.""" - prefFile = self.__open_pref_file('w') + """ + Get values from panels and set to file. + """ + self.prefFilePath = self.__find_pref_file() + prefFile = self.__open_pref_file(self.prefFilePath, 'w') options = self.header + + app.debug_print("Preferences to save:") # get all pages in notebook for i in range(prefDialog.notebook.GetPageCount()): # section header is page name @@ -154,34 +180,30 @@ if value is not None: name = child.GetName() options += u'%s=%s\n' % (name, value) - app.debug_print("%s (%s) = %s" % (name, type, value)) + app.debug_print(" %s (%s) = %s" % (name, type, value)) prefFile.write(options) prefFile.close() self.__load_preferences() - def get(self, preference, strict=True): - """Attempt to load a preference setting - + def get(self, preference): + """ + Attempt to load a preference setting Load or recreate preference file if needed. """ - if not self.prefs: - self.__load_preferences() try: return self.prefs[preference] except KeyError: - if not strict: - pass - else: + if not self.key_error: msg = _(u"\nThe preferences file is outdated or corrupt.") - msg += _(u"\nWill now recreate the preferences file.") + msg += u"\n%s" % self.prefFilePath utils.make_err_msg(msg, _(u"Problem with preferences")) - self.__create_new() - self.__load_preferences() - return self.get(preference) + # set this here so we don't see the message for evey missing key + self.key_error = True + raise KeyError def get_all(self): - """Get all preferences. - + """ + Get all preferences. Will attempt to load from file if no preferences are defined. """ if not self.prefs: diff -Nru metamorphose2-0.8.4/src/preferences/logging.py metamorphose2-0.8.4+git20160722/src/preferences/logging.py --- metamorphose2-0.8.4/src/preferences/logging.py 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/preferences/logging.py 2017-01-25 12:35:14.000000000 +0000 @@ -23,7 +23,9 @@ class Panel(wx.Panel): - """Logging preferences panel.""" + """ + Logging preferences panel + """ def __init_itemsizer_items(self, parent): parent.AddSpacer(wx.Size(8, 8), border=0, flag=0) parent.AddWindow(self.staticText5, 0, border=5, flag=wx.ALL) @@ -49,7 +51,7 @@ parent.AddWindow(self.logFextension, 0, border=0, flag=0) def __init_sizers(self): - self.logOptionsSizer = wx.FlexGridSizer(cols=2, hgap=0, rows=1, vgap=3) + self.logOptionsSizer = wx.FlexGridSizer(cols=2, hgap=0, rows=3, vgap=3) self.__init_logoptions_sizer(self.logOptionsSizer) self.itemSizer = wx.BoxSizer(orient=wx.VERTICAL) self.__init_itemsizer_items(self.itemSizer) @@ -94,7 +96,6 @@ self.staticText5 = wx.StaticText(id=wxID_PANELSTATICTEXT5, label=_(u'These settings apply to loading and saving of log files.'), name='staticText5', parent=self) - self.__init_sizers() def __init__(self, parent): diff -Nru metamorphose2-0.8.4/src/utils.py metamorphose2-0.8.4+git20160722/src/utils.py --- metamorphose2-0.8.4/src/utils.py 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/utils.py 2017-01-25 12:35:14.000000000 +0000 @@ -32,15 +32,6 @@ pass -def get_wxversion(): - """Get the wxPython Version.""" - wxVer = "" - for x in wx.VERSION: - wxVer = wxVer + str(x) + "." - wxVer = wxVer.rstrip(".") - return wxVer - - def is_pil_loaded(): """Determine if the python imaging library is loaded.""" try: diff -Nru metamorphose2-0.8.4/src/version metamorphose2-0.8.4+git20160722/src/version --- metamorphose2-0.8.4/src/version 2015-08-11 21:44:49.000000000 +0000 +++ metamorphose2-0.8.4+git20160722/src/version 2017-01-25 12:35:14.000000000 +0000 @@ -1 +1,2 @@ -0.8.4 \ No newline at end of file +0.9.0 (beta) +0.1.1 \ No newline at end of file