photoshop_paths.config 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #------------------------------------------------------------------------------
  2. # File: photoshop_paths.config
  3. #
  4. # Description: This config file generates user-defined tags for Photoshop
  5. # paths, and may be used to extract path names or copy path
  6. # information from one file to another.
  7. #
  8. # An "AllPaths" shortcut tag is also provided represent all
  9. # Photoshop path tags. This shortcut must be used when copying
  10. # because these tags are marked as "Protected" so they won't be
  11. # copied by default.
  12. #
  13. # Note: Print conversion must be disabled to be able to copy these tags
  14. # (via either the -n option, or by adding a "#" to the tag name,
  15. # eg. "-tagsfromfile SRC -allpaths#").
  16. #
  17. # Usage:
  18. #
  19. # 1) Extract Photoshop path names:
  20. #
  21. # exiftool -config photoshop_paths.config -allpaths FILE
  22. #
  23. # 2) Copy all Photoshop paths from one file (SRC) to another (DST):
  24. #
  25. # exiftool -config photoshop_paths.config -tagsfromfile SRC -allpaths# DST
  26. #
  27. # Requires: ExifTool version 9.95 or later
  28. #
  29. # Revisions: 2015/05/07 - P. Harvey Created
  30. #
  31. # References: http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,1621.0.html
  32. # http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3910.0.html
  33. #------------------------------------------------------------------------------
  34. %Image::ExifTool::Shortcuts::UserDefined = (
  35. # create "AllPaths" shortcut for all Photoshop path tags
  36. AllPaths => [
  37. map { sprintf "Path%x", $_ } (0x7d0 .. 0xbb5),
  38. ],
  39. );
  40. %Image::ExifTool::UserDefined = (
  41. 'Image::ExifTool::Photoshop::Main' => {
  42. # generate tags for each of the 998 possible Photoshop paths
  43. map { $_ => {
  44. Name => sprintf('Path%x', $_),
  45. Description => sprintf('Path %x', $_),
  46. Flags => [ qw(Writable Protected Binary ConvertBinary SetResourceName) ],
  47. PrintConv => '$$val =~ m{/#(.*?)#/$}s ? $1 : "<none>"',
  48. } } (0x7d0 .. 0xbb5),
  49. },
  50. );
  51. 1; #end