- Timestamp:
- 2011-06-01T12:33:42+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/cpan/Image/ExifTool/Casio.pm
r16842 r24107 11 11 # 3) http://homepage3.nifty.com/kamisaka/makernote/makernote_casio.htm 12 12 # 4) http://www.gvsoft.homedns.org/exif/makernote-casio.html 13 # 5) Robert Chi private communication (EX-F1) 14 # JD) Jens Duttke private communication 13 15 #------------------------------------------------------------------------------ 14 16 … … 19 21 use Image::ExifTool::Exif; 20 22 21 $VERSION = '1. 21';23 $VERSION = '1.32'; 22 24 23 25 # older Casio maker notes (ref 1) … … 61 63 { 62 64 Name => 'FlashMode', 63 Condition => '$self->{ CameraModel} =~ /^QV-(3500EX|8000SX)/',65 Condition => '$self->{Model} =~ /^QV-(3500EX|8000SX)/', 64 66 Writable => 'int16u', 65 67 PrintConv => { … … 168 170 Priority => 0, 169 171 }, 172 0x0015 => { #JD (Similar to Type2 0x2001) 173 Name => 'FirmwareDate', 174 Writable => 'string', 175 Format => 'undef', # the 'string' contains nulls 176 Count => 18, 177 PrintConv => q{ 178 $_ = $val; 179 if (/^(\d{2})(\d{2})\0\0(\d{2})(\d{2})\0\0(\d{2})(.{2})\0{2}$/) { 180 my $yr = $1 + ($1 < 70 ? 2000 : 1900); 181 my $sec = $6; 182 $val = "$yr:$2:$3 $4:$5"; 183 $val .= ":$sec" if $sec=~/^\d{2}$/; 184 return $val; 185 } 186 tr/\0/./; s/\.+$//; 187 return "Unknown ($_)"; 188 }, 189 PrintConvInv => q{ 190 $_ = $val; 191 if (/^(19|20)(\d{2}):(\d{2}):(\d{2}) (\d{2}):(\d{2})$/) { 192 return "$2$3\0\0$4$5\0\0$6\0\0\0\0"; 193 } elsif (/^Unknown\s*\((.*)\)$/i) { 194 $_ = $1; tr/./\0/; 195 return $_; 196 } else { 197 return undef; 198 } 199 }, 200 }, 170 201 0x0016 => { #4 171 202 Name => 'Enhancement', … … 197 228 Name => 'AFPoint', 198 229 Writable => 'int16u', 230 Notes => 'may not be valid for all models', #JD 199 231 PrintConv => { 200 232 1 => 'Center', … … 327 359 Name => 'FocalLength', 328 360 Writable => 'rational64u', 329 PrintConv => 'sprintf("%.1f mm",$val)',330 PrintConvInv => '$val=~s/ mm$//;$val',361 PrintConv => 'sprintf("%.1f mm",$val)', 362 PrintConvInv => '$val=~s/\s*mm$//;$val', 331 363 }, 332 364 0x001f => { … … 413 445 4 => 'Flash?', 414 446 6 => 'Fluorescent', #3 447 9 => 'Tungsten?', #PH (EX-Z77) 415 448 10 => 'Tungsten', #3 416 449 12 => 'Flash', 450 }, 451 }, 452 0x2021 => { #JD (guess) 453 Name => 'AFPointPosition', 454 Writable => 'int16u', 455 Count => 4, 456 PrintConv => q{ 457 my @v = split ' ', $val; 458 return 'n/a' if $v[0] == 65535 or not $v[1] or not $v[3]; 459 sprintf "%.2g %.2g", $v[0]/$v[1], $v[2]/$v[3]; 417 460 }, 418 461 }, … … 426 469 }, 427 470 # 0x2023 looks interesting (values 0,1,2,3,5 in samples) - PH 471 # - 1 for makeup mode shots (portrait?) (EX-Z450) 428 472 0x2034 => { 429 473 Name => 'FlashDistance', 430 474 Writable => 'int16u', 475 }, 476 # 0x203e - normally 62000, but 62001 for anti-shake mode - PH 477 0x2076 => { #PH (EX-Z450) 478 # ("Enhancement" was taken already, so call this "SpecialEffect" for lack of a better name) 479 Name => 'SpecialEffectMode', 480 Writable => 'int8u', 481 Count => 3, 482 PrintConv => { 483 '0 0 0' => 'Off', 484 '1 0 0' => 'Makeup', 485 '2 0 0' => 'Mist Removal', 486 '3 0 0' => 'Vivid Landscape', 487 # have also seen '1 1 1', '2 2 4', '4 3 3', '4 4 4' 488 # '0 0 14' and '0 0 42' - premium auto night shot (EX-Z2300) 489 }, 490 }, 491 0x2089 => [ #PH 492 { 493 Name => 'FaceInfo1', 494 Condition => '$$valPt =~ /^(\0\0|.\x02\x80\x01\xe0)/s', # (EX-H5) 495 SubDirectory => { 496 TagTable => 'Image::ExifTool::Casio::FaceInfo1', 497 ByteOrder => 'BigEndian', 498 }, 499 },{ 500 Name => 'FaceInfo2', 501 Condition => '$$valPt =~ /^\x02\x01/', # (EX-H20G,EX-ZR100) 502 SubDirectory => { 503 TagTable => 'Image::ExifTool::Casio::FaceInfo2', 504 ByteOrder => 'LittleEndian', 505 }, 506 },{ 507 Name => 'FaceInfoUnknown', 508 Unknown => 1, 509 }, 510 ], 511 # 0x208a - also some sort of face detection information - PH 512 0x211c => { #PH 513 Name => 'FacesDetected', 514 Format => 'int8u', 431 515 }, 432 516 0x3000 => { … … 439 523 5 => 'Manual', #3 440 524 6 => 'Best Shot', #3 441 }, 442 }, 443 # 0x3001 is ShutterMode according to ref 3! 444 0x3001 => { 445 Name => 'SelfTimer', 446 Writable => 'int16u', 447 PrintConv => { 1 => 'Off' }, 525 17 => 'Movie', #PH (UHQ?) 526 19 => 'Movie (19)', #PH (HQ?, EX-P505) 527 20 => 'YouTube Movie', #PH 528 '2 0' => 'Program AE', #PH (NC) 529 '3 0' => 'Shutter Priority', #PH (NC) 530 '4 0' => 'Aperture Priority', #PH (NC) 531 '5 0' => 'Manual', #PH (NC) 532 '6 0' => 'Best Shot', #PH (NC) 533 }, 534 }, 535 0x3001 => { #3 536 Name => 'ReleaseMode', 537 Writable => 'int16u', 538 PrintConv => { 539 1 => 'Normal', 540 3 => 'AE Bracketing', 541 11 => 'WB Bracketing', 542 13 => 'Contrast Bracketing', #(not sure about translation - PH) 543 19 => 'High Speed Burst', #PH (EX-FH25, 40fps) 544 # have also seen: 2, 7(common), 14, 18 - PH 545 }, 448 546 }, 449 547 0x3002 => { … … 460 558 Writable => 'int16u', 461 559 PrintConv => { 462 0 => 'Manual ?',463 1 => 'F ixation?',560 0 => 'Manual', #(guess at translation) 561 1 => 'Focus Lock', #(guess at translation) 464 562 2 => 'Macro', #3 465 563 3 => 'Single-Area Auto Focus', 564 5 => 'Infinity', #PH 466 565 6 => 'Multi-Area Auto Focus', 566 8 => 'Super Macro', #PH (EX-Z2300) 467 567 }, 468 568 }, … … 474 574 Name => 'BestShotMode', 475 575 Writable => 'int16u', 476 PrintConv => {477 0 => 'Off',478 1 => 'On?',479 },576 # unfortunately these numbers are model-dependent, 577 # so we can't use a lookup as usual - PH 578 PrintConv => '$val ? $val : "Off"', 579 PrintConvInv => '$val=~/(\d+)/ ? $1 : 0', 480 580 }, 481 581 0x3008 => { #3 482 582 Name => 'AutoISO', 483 583 Writable => 'int16u', 484 PrintConv => { 1 => 'On', 2 => 'Off' }, 584 PrintConv => { 585 1 => 'On', 586 2 => 'Off', 587 7 => 'On (high sensitivity)', #PH 588 8 => 'On (anti-shake)', #PH 589 10 => 'High Speed', #PH (EX-FC150) 590 }, 591 }, 592 0x3009 => { #PH (EX-Z77) 593 Name => 'AFMode', 594 Writable => 'int16u', 595 PrintConv => { 596 0 => 'Off', 597 1 => 'On', 598 # have seen 2(EX-Z35 macro/portrait), 3(portrait) and 5(auto mode) 599 4 => 'Face Recognition', # "Family First" 600 }, 485 601 }, 486 602 0x3011 => { #3 … … 507 623 Name => 'ColorMode', 508 624 Writable => 'int16u', 509 PrintConv => { 0 => 'Off' }, 625 PrintConv => { 626 0 => 'Off', 627 2 => 'Black & White', #PH (EX-Z400,FH20) 628 3 => 'Sepia', #PH (EX-Z400) 629 }, 510 630 }, 511 631 0x3016 => { 512 632 Name => 'Enhancement', 513 633 Writable => 'int16u', 514 PrintConv => { 0 => 'Off' }, 634 PrintConv => { 635 0 => 'Off', 636 1 => 'Scenery', #PH (NC) (EX-Z77) 637 3 => 'Green', #PH (EX-Z77) 638 5 => 'Underwater', #PH (NC) (EX-Z77) 639 9 => 'Flesh Tones', #PH (EX-Z77) 640 }, 515 641 }, 516 642 0x3017 => { 517 Name => 'Filter', 518 Writable => 'int16u', 519 PrintConv => { 0 => 'Off' }, 643 Name => 'ColorFilter', 644 Writable => 'int16u', 645 PrintConv => { 646 0 => 'Off', 647 1 => 'Blue', #PH (FH20,Z400) 648 3 => 'Green', #PH (FH20) 649 4 => 'Yellow', #PH (FH20) 650 5 => 'Red', #PH (FH20,Z77) 651 6 => 'Purple', #PH (FH20,Z77,Z400) 652 7 => 'Pink', #PH (FH20) 653 }, 654 }, 655 0x301b => { #PH 656 Name => 'UnknownMode', 657 Writable => 'int16u', 658 Unknown => 1, 659 PrintConv => { 660 0 => 'Normal', 661 8 => 'Silent Movie', 662 39 => 'HDR', # (EX-ZR10) 663 45 => 'Premium Auto', # (EX-2300) 664 47 => 'Painting', # (EX-2300) 665 49 => 'Crayon Drawing', # (EX-2300) 666 51 => 'Panorama', # (EX-ZR10) 667 52 => 'Art HDR', # (EX-ZR10) 668 }, 520 669 }, 521 670 0x301c => { #3 … … 536 685 1 => 'On', 537 686 2 => 'Best Shot', 687 # 3 observed in MOV videos (EX-V7) 688 # (newer models write 2 numbers here - PH) 689 '0 0' => 'Off', #PH 690 # have seen '0 1' for EX-Z2000 which has 5 modes: Auto, Camera AS, Image AS, DEMO, Off 691 '16 0' => 'Slow Shutter', #PH (EX-Z77) 692 '18 0' => 'Anti-Shake', #PH (EX-Z77) 693 '20 0' => 'High Sensitivity', #PH (EX-Z77) 694 '0 3' => 'CCD Shift', #PH (guess) 695 '2 3' => 'High Speed Anti-Shake', #PH (EX-FC150) 696 }, 697 }, 698 0x302a => { #PH (EX-Z450) 699 Name => 'LightingMode', #(just guessing here) 700 Writable => 'int16u', 701 PrintConv => { 702 0 => 'Off', 703 1 => 'High Dynamic Range', # (EX-Z77 anti-blur shot) 704 5 => 'Shadow Enhance Low', #(NC) 705 6 => 'Shadow Enhance High', #(NC) 706 }, 707 }, 708 0x302b => { #PH (EX-Z77) 709 Name => 'PortraitRefiner', 710 Writable => 'int16u', 711 PrintConv => { 712 0 => 'Off', 713 1 => '+1', 714 2 => '+2', 715 }, 716 }, 717 0x3030 => { #PH (EX-Z450) 718 Name => 'SpecialEffectLevel', 719 Writable => 'int16u', 720 }, 721 0x3031 => { #PH (EX-Z450) 722 Name => 'SpecialEffectSetting', 723 Writable => 'int16u', 724 PrintConv => { 725 0 => 'Off', 726 1 => 'Makeup', 727 2 => 'Mist Removal', 728 3 => 'Vivid Landscape', 729 16 => 'Art Shot', # (EX-Z2300) 730 }, 731 }, 732 0x3103 => { #5 733 Name => 'DriveMode', 734 Writable => 'int16u', 735 PrintConvColumns => 2, 736 PrintConv => { 737 OTHER => sub { 738 # handle new values of future models 739 my ($val, $inv) = @_; 740 return $val =~ /(\d+)/ ? $1 : undef if $inv; 741 return "Continuous ($val fps)"; 742 }, 743 0 => 'Single Shot', #PH (NC) 744 1 => 'Continuous Shooting', # (1 fps for the EX-F1) 745 2 => 'Continuous (2 fps)', 746 3 => 'Continuous (3 fps)', 747 4 => 'Continuous (4 fps)', 748 5 => 'Continuous (5 fps)', 749 6 => 'Continuous (6 fps)', 750 7 => 'Continuous (7 fps)', 751 10 => 'Continuous (10 fps)', 752 12 => 'Continuous (12 fps)', 753 15 => 'Continuous (15 fps)', 754 20 => 'Continuous (20 fps)', 755 30 => 'Continuous (30 fps)', 756 40 => 'Continuous (40 fps)', #PH (EX-FH25) 757 60 => 'Continuous (60 fps)', 758 240 => 'Auto-N', 759 }, 760 }, 761 0x4001 => { #PH (AVI videos) 762 Name => 'CaptureFrameRate', 763 Writable => 'int16u', 764 Count => -1, 765 ValueConv => q{ 766 my @v=split(" ",$val); 767 return $val / 1000 if @v == 1; 768 return $v[1] ? "$v[1]-$v[0]" : ($v[0] > 10000 ? $v[0] / 1000 : $v[0]); 769 }, 770 ValueConvInv => '$val <= 60 ? $val * 1000 : int($val) . " 0"', 771 }, 772 # 0x4002 - AVI videos, related to video quality or size - PH 773 0x4003 => { #PH (AVI and MOV videos) 774 Name => 'VideoQuality', 775 Writable => 'int16u', 776 PrintConv => { 777 1 => 'Standard', 778 # 2 - could this be LP? 779 3 => 'HD (720p)', 780 4 => 'Full HD (1080p)', # (EX-ZR10, 30fps 1920x1080) 781 5 => 'Low', # used in High Speed modes 538 782 }, 539 783 }, 540 784 ); 785 786 # face detection information (ref PH) (EX-H5) 787 %Image::ExifTool::Casio::FaceInfo1 = ( 788 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 789 WRITE_PROC => \&Image::ExifTool::WriteBinaryData, 790 CHECK_PROC => \&Image::ExifTool::CheckBinaryData, 791 GROUPS => { 0 => 'MakerNotes', 2 => 'Image' }, 792 WRITABLE => 1, 793 FIRST_ENTRY => 0, 794 DATAMEMBER => [ 0 ], 795 NOTES => 'Face-detect tags extracted from models such as the EX-H5.', 796 0x00 => { # (NC) 797 Name => 'FacesDetected', 798 DataMember => 'FacesDetected', 799 RawConv => '$$self{FacesDetected} = $val', 800 }, 801 0x01 => { 802 Name => 'FaceDetectFrameSize', 803 Condition => '$$self{FacesDetected} >= 1', # (otherwise zeros) 804 Format => 'int16u[2]', 805 }, 806 0x0d => { 807 Name => 'Face1Position', 808 Condition => '$$self{FacesDetected} >= 1', 809 Format => 'int16u[4]', 810 Notes => q{ 811 left, top, right and bottom of detected face in coordinates of 812 FaceDetectFrameSize, with increasing Y downwards 813 }, 814 }, 815 # decoding NOT CONFIRMED (NC) for faces 2-10! 816 0x7c => { 817 Name => 'Face2Position', 818 Condition => '$$self{FacesDetected} >= 2', 819 Format => 'int16u[4]', 820 }, 821 0xeb => { 822 Name => 'Face3Position', 823 Condition => '$$self{FacesDetected} >= 3', 824 Format => 'int16u[4]', 825 }, 826 0x15a => { 827 Name => 'Face4Position', 828 Condition => '$$self{FacesDetected} >= 4', 829 Format => 'int16u[4]', 830 }, 831 0x1c9 => { 832 Name => 'Face5Position', 833 Condition => '$$self{FacesDetected} >= 5', 834 Format => 'int16u[4]', 835 }, 836 0x238 => { 837 Name => 'Face6Position', 838 Condition => '$$self{FacesDetected} >= 6', 839 Format => 'int16u[4]', 840 }, 841 0x2a7 => { 842 Name => 'Face7Position', 843 Condition => '$$self{FacesDetected} >= 7', 844 Format => 'int16u[4]', 845 }, 846 0x316 => { 847 Name => 'Face8Position', 848 Condition => '$$self{FacesDetected} >= 8', 849 Format => 'int16u[4]', 850 }, 851 0x385 => { 852 Name => 'Face9Position', 853 Condition => '$$self{FacesDetected} >= 9', 854 Format => 'int16u[4]', 855 }, 856 0x3f4 => { 857 Name => 'Face10Position', 858 Condition => '$$self{FacesDetected} >= 10', 859 Format => 'int16u[4]', 860 }, 861 ); 862 863 # face detection information (ref PH) (EX-ZR100) 864 %Image::ExifTool::Casio::FaceInfo2 = ( 865 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 866 WRITE_PROC => \&Image::ExifTool::WriteBinaryData, 867 CHECK_PROC => \&Image::ExifTool::CheckBinaryData, 868 GROUPS => { 0 => 'MakerNotes', 2 => 'Image' }, 869 WRITABLE => 1, 870 FIRST_ENTRY => 0, 871 DATAMEMBER => [ 2 ], 872 NOTES => 'Face-detect tags extracted from models such as the EX-H20G and EX-ZR100.', 873 0x02 => { 874 Name => 'FacesDetected', 875 DataMember => 'FacesDetected', 876 RawConv => '$$self{FacesDetected} = $val', 877 }, 878 0x04 => { 879 Name => 'FaceDetectFrameSize', 880 Condition => '$$self{FacesDetected} >= 1', 881 Format => 'int16u[2]', 882 }, 883 0x08 => { 884 Name => 'FaceOrientation', 885 Condition => '$$self{FacesDetected} >= 1', 886 PrintConv => { 887 0 => 'Horizontal (normal)', 888 1 => 'Rotate 90 CW', 889 2 => 'Rotate 270 CW', 890 3 => 'Rotate 180', # (NC) 891 }, 892 Notes => 'orientation of face relative to unrotated image', 893 }, 894 # 0x0a - FaceDetectFrameSize again 895 # 0x11 - Face1Detected flag (1=detected) 896 0x18 => { 897 Name => 'Face1Position', 898 Condition => '$$self{FacesDetected} >= 1', 899 Format => 'int16u[4]', 900 Notes => q{ 901 left, top, right and bottom of detected face in coordinates of 902 FaceDetectFrameSize, with increasing Y downwards 903 }, 904 }, 905 # 0x45 - Face2Detected, etc... 906 0x4c => { 907 Name => 'Face2Position', 908 Condition => '$$self{FacesDetected} >= 2', 909 Format => 'int16u[4]', 910 }, 911 0x80 => { 912 Name => 'Face3Position', 913 Condition => '$$self{FacesDetected} >= 3', 914 Format => 'int16u[4]', 915 }, 916 0xb4 => { 917 Name => 'Face4Position', 918 Condition => '$$self{FacesDetected} >= 4', 919 Format => 'int16u[4]', 920 }, 921 0xe8 => { 922 Name => 'Face5Position', 923 Condition => '$$self{FacesDetected} >= 5', 924 Format => 'int16u[4]', 925 }, 926 0x11c => { 927 Name => 'Face6Position', 928 Condition => '$$self{FacesDetected} >= 6', 929 Format => 'int16u[4]', 930 }, 931 0x150 => { 932 Name => 'Face7Position', 933 Condition => '$$self{FacesDetected} >= 7', 934 Format => 'int16u[4]', 935 }, 936 0x184 => { 937 Name => 'Face8Position', 938 Condition => '$$self{FacesDetected} >= 8', 939 Format => 'int16u[4]', 940 }, 941 0x1b8 => { 942 Name => 'Face9Position', 943 Condition => '$$self{FacesDetected} >= 9', 944 Format => 'int16u[4]', 945 }, 946 0x1ec => { 947 Name => 'Face10Position', 948 Condition => '$$self{FacesDetected} >= 10', 949 Format => 'int16u[4]', 950 }, 951 ); 952 953 # Casio APP1 QVCI segment found in QV-7000SX images (ref PH) 954 %Image::ExifTool::Casio::QVCI = ( 955 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 956 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' }, 957 FIRST_ENTRY => 0, 958 NOTES => q{ 959 This information is found in the APP1 QVCI segment of JPEG images from the 960 Casio QV-7000SX. 961 }, 962 0x2c => { 963 Name => 'CasioQuality', 964 PrintConv => { 965 1 => 'Economy', 966 2 => 'Normal', 967 3 => 'Fine', 968 4 => 'Super Fine', 969 }, 970 }, 971 0x37 => { 972 Name => 'FocalRange', 973 Unknown => 1, 974 }, 975 0x4d => { 976 Name => 'DateTimeOriginal', 977 Description => 'Date/Time Original', 978 Format => 'string[20]', 979 Groups => { 2 => 'Time' }, 980 ValueConv => '$val=~tr/./:/; $val=~s/(\d+:\d+:\d+):/$1 /; $val', 981 PrintConv => '$self->ConvertDateTime($val)', 982 }, 983 0x62 => { 984 Name => 'ModelType', 985 Format => 'string[7]', 986 }, 987 0x72 => { # could be serial number or manufacture date in form YYMMDDxx ? 988 Name => 'ManufactureIndex', 989 Format => 'string[9]', 990 }, 991 0x7c => { 992 Name => 'ManufactureCode', 993 Format => 'string[9]', 994 }, 995 ); 996 997 # tags in Casio AVI videos (ref PH) 998 %Image::ExifTool::Casio::AVI = ( 999 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 1000 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' }, 1001 FIRST_ENTRY => 0, 1002 NOTES => 'This information is found in Casio GV-10 AVI videos.', 1003 0 => { 1004 Name => 'Software', # (equivalent to RIFF Software tag) 1005 Format => 'string', 1006 }, 1007 ); 1008 541 1009 542 1010 1; # end … … 559 1027 =head1 AUTHOR 560 1028 561 Copyright 2003-20 07, Phil Harvey (phil at owl.phy.queensu.ca)1029 Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca) 562 1030 563 1031 This library is free software; you can redistribute it and/or modify it … … 574 1042 =head1 ACKNOWLEDGEMENTS 575 1043 576 Thanks to Joachim Loehr for adding support for the type 2 maker notes. 1044 Thanks to Joachim Loehr for adding support for the type 2 maker notes, and 1045 Jens Duttke and Robert Chi for decoding some tags. 577 1046 578 1047 =head1 SEE ALSO
Note:
See TracChangeset
for help on using the changeset viewer.