Ignore:
Timestamp:
2017-10-30T22:46:09+01:00 (8 years ago)
Author:
Don-vip
Message:

fix #15505 - update to metadata-extractor 2.10.1

Location:
trunk/src/com/drew/metadata/exif/makernotes
Files:
21 added
1 deleted
38 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/com/drew/metadata/exif/makernotes/CanonMakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    2626
    2727import java.text.DecimalFormat;
     28import java.util.HashMap;
    2829
    2930import static com.drew.metadata.exif.makernotes.CanonMakernoteDirectory.*;
     
    3435 * @author Drew Noakes https://drewnoakes.com
    3536 */
     37@SuppressWarnings("WeakerAccess")
    3638public class CanonMakernoteDescriptor extends TagDescriptor<CanonMakernoteDirectory>
    3739{
     
    5456            case CameraSettings.TAG_DIGITAL_ZOOM:
    5557                return getDigitalZoomDescription();
     58            case CameraSettings.TAG_RECORD_MODE:
     59                return getRecordModeDescription();
    5660            case CameraSettings.TAG_QUALITY:
    5761                return getQualityDescription();
     
    102106            case FocalLength.TAG_FLASH_BIAS:
    103107                return getFlashBiasDescription();
     108            case AFInfo.TAG_AF_POINTS_IN_FOCUS:
     109                return getTagAfPointsInFocus();
     110            case CameraSettings.TAG_MAX_APERTURE:
     111                return getMaxApertureDescription();
     112            case CameraSettings.TAG_MIN_APERTURE:
     113                return getMinApertureDescription();
     114            case CameraSettings.TAG_FOCUS_CONTINUOUS:
     115                return getFocusContinuousDescription();
     116            case CameraSettings.TAG_AE_SETTING:
     117                return getAESettingDescription();
     118            case CanonMakernoteDirectory.CameraSettings.TAG_DISPLAY_APERTURE:
     119                return getDisplayApertureDescription();
     120            case CanonMakernoteDirectory.CameraSettings.TAG_SPOT_METERING_MODE:
     121                return getSpotMeteringModeDescription();
     122            case CanonMakernoteDirectory.CameraSettings.TAG_PHOTO_EFFECT:
     123                return getPhotoEffectDescription();
     124            case CanonMakernoteDirectory.CameraSettings.TAG_MANUAL_FLASH_OUTPUT:
     125                return getManualFlashOutputDescription();
     126            case CanonMakernoteDirectory.CameraSettings.TAG_COLOR_TONE:
     127                return getColorToneDescription();
     128            case CanonMakernoteDirectory.CameraSettings.TAG_SRAW_QUALITY:
     129                return getSRawQualityDescription();
    104130
    105131            // It turns out that these values are dependent upon the camera model and therefore the below code was
     
    346372        //  0, 0.33,  0.5, 0.66,  1
    347373
    348         return ((isNegative) ? "-" : "") + Float.toString(value / 32f) + " EV";
     374        return (isNegative ? "-" : "") + Float.toString(value / 32f) + " EV";
    349375    }
    350376
     
    364390            return "Unknown (" + value + ")";
    365391        }
     392    }
     393
     394    @Nullable
     395    public String getTagAfPointsInFocus()
     396    {
     397        Integer value = _directory.getInteger(AFInfo.TAG_AF_POINTS_IN_FOCUS);
     398        if (value == null)
     399            return null;
     400
     401        StringBuilder sb = new StringBuilder();
     402
     403        for (int i = 0; i < 16; i++)
     404        {
     405            if ((value & 1 << i) != 0)
     406            {
     407                if (sb.length() != 0)
     408                    sb.append(',');
     409                sb.append(i);
     410            }
     411        }
     412
     413        return sb.length() == 0 ? "None" : sb.toString();
    366414    }
    367415
     
    393441        if (value == null)
    394442            return null;
    395         if (((value >> 14) & 1) > 0) {
     443        if (((value >> 14) & 1) != 0) {
    396444            return "External E-TTL";
    397445        }
    398         if (((value >> 13) & 1) > 0) {
     446        if (((value >> 13) & 1) != 0) {
    399447            return "Internal flash";
    400448        }
    401         if (((value >> 11) & 1) > 0) {
     449        if (((value >> 11) & 1) != 0) {
    402450            return "FP sync used";
    403451        }
    404         if (((value >> 4) & 1) > 0) {
     452        if (((value >> 4) & 1) != 0) {
    405453            return "FP sync enabled";
    406454        }
     
    461509            return null;
    462510
    463         return "Lens type: " + Integer.toString(value);
     511        return _lensTypeById.containsKey(value)
     512            ? _lensTypeById.get(value)
     513            : String.format("Unknown (%d)", value);
     514    }
     515
     516    @Nullable
     517    public String getMaxApertureDescription()
     518    {
     519        Integer value = _directory.getInteger(CameraSettings.TAG_MAX_APERTURE);
     520        if (value == null)
     521            return null;
     522        if (value > 512)
     523            return String.format("Unknown (%d)", value);
     524        return getFStopDescription(Math.exp(decodeCanonEv(value) * Math.log(2.0) / 2.0));
     525    }
     526
     527    @Nullable
     528    public String getMinApertureDescription()
     529    {
     530        Integer value = _directory.getInteger(CameraSettings.TAG_MIN_APERTURE);
     531        if (value == null)
     532            return null;
     533        if (value > 512)
     534            return String.format("Unknown (%d)", value);
     535        return getFStopDescription(Math.exp(decodeCanonEv(value) * Math.log(2.0) / 2.0));
    464536    }
    465537
     
    499571        // Canon PowerShot S3 is special
    500572        int canonMask = 0x4000;
    501         if ((value & canonMask) > 0)
     573        if ((value & canonMask) != 0)
    502574            return "" + (value & ~canonMask);
    503575
     
    700772
    701773    @Nullable
     774    public String getRecordModeDescription()
     775    {
     776        return getIndexedDescription(CameraSettings.TAG_RECORD_MODE, 1, "JPEG", "CRW+THM", "AVI+THM", "TIF", "TIF+JPEG", "CR2", "CR2+JPEG", null, "MOV", "MP4");
     777    }
     778
     779    @Nullable
    702780    public String getFocusTypeDescription()
    703781    {
     
    724802        return getIndexedDescription(CameraSettings.TAG_FLASH_ACTIVITY, "Flash did not fire", "Flash fired");
    725803    }
     804
     805    @Nullable
     806    public String getFocusContinuousDescription()
     807    {
     808        return getIndexedDescription(CameraSettings.TAG_FOCUS_CONTINUOUS, 0,
     809            "Single", "Continuous", null, null, null, null, null, null, "Manual");
     810    }
     811
     812    @Nullable
     813    public String getAESettingDescription()
     814    {
     815        return getIndexedDescription(CameraSettings.TAG_AE_SETTING, 0,
     816            "Normal AE", "Exposure Compensation", "AE Lock", "AE Lock + Exposure Comp.", "No AE");
     817    }
     818
     819    @Nullable
     820    public String getDisplayApertureDescription()
     821    {
     822        Integer value = _directory.getInteger(CameraSettings.TAG_DISPLAY_APERTURE);
     823        if (value == null)
     824            return null;
     825
     826        if (value == 0xFFFF)
     827            return value.toString();
     828        return getFStopDescription(value / 10f);
     829    }
     830
     831    @Nullable
     832    public String getSpotMeteringModeDescription()
     833    {
     834        return getIndexedDescription(CanonMakernoteDirectory.CameraSettings.TAG_SPOT_METERING_MODE, 0,
     835            "Center", "AF Point");
     836    }
     837
     838    @Nullable
     839    public String getPhotoEffectDescription()
     840    {
     841        Integer value = _directory.getInteger(CameraSettings.TAG_PHOTO_EFFECT);
     842        if (value == null)
     843            return null;
     844
     845        switch (value)
     846        {
     847            case 0:
     848                return "Off";
     849            case 1:
     850                return "Vivid";
     851            case 2:
     852                return "Neutral";
     853            case 3:
     854                return "Smooth";
     855            case 4:
     856                return "Sepia";
     857            case 5:
     858                return "B&W";
     859            case 6:
     860                return "Custom";
     861            case 100:
     862                return "My Color Data";
     863            default:
     864                return "Unknown (" + value + ")";
     865        }
     866    }
     867
     868    @Nullable
     869    public String getManualFlashOutputDescription()
     870    {
     871        Integer value = _directory.getInteger(CameraSettings.TAG_MANUAL_FLASH_OUTPUT);
     872        if (value == null)
     873            return null;
     874
     875        switch (value)
     876        {
     877            case 0:
     878                return "n/a";
     879            case 0x500:
     880                return "Full";
     881            case 0x502:
     882                return "Medium";
     883            case 0x504:
     884                return "Low";
     885            case 0x7fff:
     886                return "n/a";   // (EOS models)
     887            default:
     888                return "Unknown (" + value + ")";
     889        }
     890    }
     891
     892    @Nullable
     893    public String getColorToneDescription()
     894    {
     895        Integer value = _directory.getInteger(CameraSettings.TAG_COLOR_TONE);
     896        if (value == null)
     897            return null;
     898
     899        return value == 0x7fff ? "n/a" : value.toString();
     900    }
     901
     902    @Nullable
     903    public String getSRawQualityDescription()
     904    {
     905        return getIndexedDescription(CanonMakernoteDirectory.CameraSettings.TAG_SRAW_QUALITY, 0, "n/a", "sRAW1 (mRAW)", "sRAW2 (sRAW)");
     906    }
     907
     908    /**
     909     * Canon hex-based EV (modulo 0x20) to real number.
     910     *
     911     * Converted from Exiftool version 10.10 created by Phil Harvey
     912     * http://www.sno.phy.queensu.ca/~phil/exiftool/
     913     * lib\Image\ExifTool\Canon.pm
     914     *
     915     *         eg) 0x00 -> 0
     916     *             0x0c -> 0.33333
     917     *             0x10 -> 0.5
     918     *             0x14 -> 0.66666
     919     *             0x20 -> 1   ... etc
     920     */
     921    private double decodeCanonEv(int val)
     922    {
     923        int sign = 1;
     924        if (val < 0)
     925        {
     926            val = -val;
     927            sign = -1;
     928        }
     929
     930        int frac = val & 0x1f;
     931        val -= frac;
     932
     933        if (frac == 0x0c)
     934            frac = 0x20 / 3;
     935        else if (frac == 0x14)
     936            frac = 0x40 / 3;
     937
     938        return sign * (val + frac) / (double)0x20;
     939    }
     940
     941    /**
     942     *  Map from <see cref="CanonMakernoteDirectory.CameraSettings.TagLensType"/> to string descriptions.
     943     *
     944     *  Data sourced from http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html#LensType
     945     *
     946     *  Note that only Canon lenses are listed. Lenses from other manufacturers may identify themselves to the camera
     947     *  as being from this set, but in fact may be quite different. This limits the usefulness of this data,
     948     *  unfortunately.
     949     */
     950    private static final HashMap<Integer, String> _lensTypeById = new HashMap<Integer, String>();
     951
     952    static {
     953        _lensTypeById.put(1, "Canon EF 50mm f/1.8");
     954        _lensTypeById.put(2, "Canon EF 28mm f/2.8");
     955        _lensTypeById.put(3, "Canon EF 135mm f/2.8 Soft");
     956        _lensTypeById.put(4, "Canon EF 35-105mm f/3.5-4.5 or Sigma Lens");
     957        _lensTypeById.put(5, "Canon EF 35-70mm f/3.5-4.5");
     958        _lensTypeById.put(6, "Canon EF 28-70mm f/3.5-4.5 or Sigma or Tokina Lens");
     959        _lensTypeById.put(7, "Canon EF 100-300mm f/5.6L");
     960        _lensTypeById.put(8, "Canon EF 100-300mm f/5.6 or Sigma or Tokina Lens");
     961        _lensTypeById.put(9, "Canon EF 70-210mm f/4");
     962        _lensTypeById.put(10, "Canon EF 50mm f/2.5 Macro or Sigma Lens");
     963        _lensTypeById.put(11, "Canon EF 35mm f/2");
     964        _lensTypeById.put(13, "Canon EF 15mm f/2.8 Fisheye");
     965        _lensTypeById.put(14, "Canon EF 50-200mm f/3.5-4.5L");
     966        _lensTypeById.put(15, "Canon EF 50-200mm f/3.5-4.5");
     967        _lensTypeById.put(16, "Canon EF 35-135mm f/3.5-4.5");
     968        _lensTypeById.put(17, "Canon EF 35-70mm f/3.5-4.5A");
     969        _lensTypeById.put(18, "Canon EF 28-70mm f/3.5-4.5");
     970        _lensTypeById.put(20, "Canon EF 100-200mm f/4.5A");
     971        _lensTypeById.put(21, "Canon EF 80-200mm f/2.8L");
     972        _lensTypeById.put(22, "Canon EF 20-35mm f/2.8L or Tokina Lens");
     973        _lensTypeById.put(23, "Canon EF 35-105mm f/3.5-4.5");
     974        _lensTypeById.put(24, "Canon EF 35-80mm f/4-5.6 Power Zoom");
     975        _lensTypeById.put(25, "Canon EF 35-80mm f/4-5.6 Power Zoom");
     976        _lensTypeById.put(26, "Canon EF 100mm f/2.8 Macro or Other Lens");
     977        _lensTypeById.put(27, "Canon EF 35-80mm f/4-5.6");
     978        _lensTypeById.put(28, "Canon EF 80-200mm f/4.5-5.6 or Tamron Lens");
     979        _lensTypeById.put(29, "Canon EF 50mm f/1.8 II");
     980        _lensTypeById.put(30, "Canon EF 35-105mm f/4.5-5.6");
     981        _lensTypeById.put(31, "Canon EF 75-300mm f/4-5.6 or Tamron Lens");
     982        _lensTypeById.put(32, "Canon EF 24mm f/2.8 or Sigma Lens");
     983        _lensTypeById.put(33, "Voigtlander or Carl Zeiss Lens");
     984        _lensTypeById.put(35, "Canon EF 35-80mm f/4-5.6");
     985        _lensTypeById.put(36, "Canon EF 38-76mm f/4.5-5.6");
     986        _lensTypeById.put(37, "Canon EF 35-80mm f/4-5.6 or Tamron Lens");
     987        _lensTypeById.put(38, "Canon EF 80-200mm f/4.5-5.6");
     988        _lensTypeById.put(39, "Canon EF 75-300mm f/4-5.6");
     989        _lensTypeById.put(40, "Canon EF 28-80mm f/3.5-5.6");
     990        _lensTypeById.put(41, "Canon EF 28-90mm f/4-5.6");
     991        _lensTypeById.put(42, "Canon EF 28-200mm f/3.5-5.6 or Tamron Lens");
     992        _lensTypeById.put(43, "Canon EF 28-105mm f/4-5.6");
     993        _lensTypeById.put(44, "Canon EF 90-300mm f/4.5-5.6");
     994        _lensTypeById.put(45, "Canon EF-S 18-55mm f/3.5-5.6 [II]");
     995        _lensTypeById.put(46, "Canon EF 28-90mm f/4-5.6");
     996        _lensTypeById.put(47, "Zeiss Milvus 35mm f/2 or 50mm f/2");
     997        _lensTypeById.put(48, "Canon EF-S 18-55mm f/3.5-5.6 IS");
     998        _lensTypeById.put(49, "Canon EF-S 55-250mm f/4-5.6 IS");
     999        _lensTypeById.put(50, "Canon EF-S 18-200mm f/3.5-5.6 IS");
     1000        _lensTypeById.put(51, "Canon EF-S 18-135mm f/3.5-5.6 IS");
     1001        _lensTypeById.put(52, "Canon EF-S 18-55mm f/3.5-5.6 IS II");
     1002        _lensTypeById.put(53, "Canon EF-S 18-55mm f/3.5-5.6 III");
     1003        _lensTypeById.put(54, "Canon EF-S 55-250mm f/4-5.6 IS II");
     1004        _lensTypeById.put(94, "Canon TS-E 17mm f/4L");
     1005        _lensTypeById.put(95, "Canon TS-E 24.0mm f/3.5 L II");
     1006        _lensTypeById.put(124, "Canon MP-E 65mm f/2.8 1-5x Macro Photo");
     1007        _lensTypeById.put(125, "Canon TS-E 24mm f/3.5L");
     1008        _lensTypeById.put(126, "Canon TS-E 45mm f/2.8");
     1009        _lensTypeById.put(127, "Canon TS-E 90mm f/2.8");
     1010        _lensTypeById.put(129, "Canon EF 300mm f/2.8L");
     1011        _lensTypeById.put(130, "Canon EF 50mm f/1.0L");
     1012        _lensTypeById.put(131, "Canon EF 28-80mm f/2.8-4L or Sigma Lens");
     1013        _lensTypeById.put(132, "Canon EF 1200mm f/5.6L");
     1014        _lensTypeById.put(134, "Canon EF 600mm f/4L IS");
     1015        _lensTypeById.put(135, "Canon EF 200mm f/1.8L");
     1016        _lensTypeById.put(136, "Canon EF 300mm f/2.8L");
     1017        _lensTypeById.put(137, "Canon EF 85mm f/1.2L or Sigma or Tamron Lens");
     1018        _lensTypeById.put(138, "Canon EF 28-80mm f/2.8-4L");
     1019        _lensTypeById.put(139, "Canon EF 400mm f/2.8L");
     1020        _lensTypeById.put(140, "Canon EF 500mm f/4.5L");
     1021        _lensTypeById.put(141, "Canon EF 500mm f/4.5L");
     1022        _lensTypeById.put(142, "Canon EF 300mm f/2.8L IS");
     1023        _lensTypeById.put(143, "Canon EF 500mm f/4L IS or Sigma Lens");
     1024        _lensTypeById.put(144, "Canon EF 35-135mm f/4-5.6 USM");
     1025        _lensTypeById.put(145, "Canon EF 100-300mm f/4.5-5.6 USM");
     1026        _lensTypeById.put(146, "Canon EF 70-210mm f/3.5-4.5 USM");
     1027        _lensTypeById.put(147, "Canon EF 35-135mm f/4-5.6 USM");
     1028        _lensTypeById.put(148, "Canon EF 28-80mm f/3.5-5.6 USM");
     1029        _lensTypeById.put(149, "Canon EF 100mm f/2 USM");
     1030        _lensTypeById.put(150, "Canon EF 14mm f/2.8L or Sigma Lens");
     1031        _lensTypeById.put(151, "Canon EF 200mm f/2.8L");
     1032        _lensTypeById.put(152, "Canon EF 300mm f/4L IS or Sigma Lens");
     1033        _lensTypeById.put(153, "Canon EF 35-350mm f/3.5-5.6L or Sigma or Tamron Lens");
     1034        _lensTypeById.put(154, "Canon EF 20mm f/2.8 USM or Zeiss Lens");
     1035        _lensTypeById.put(155, "Canon EF 85mm f/1.8 USM");
     1036        _lensTypeById.put(156, "Canon EF 28-105mm f/3.5-4.5 USM or Tamron Lens");
     1037        _lensTypeById.put(160, "Canon EF 20-35mm f/3.5-4.5 USM or Tamron or Tokina Lens");
     1038        _lensTypeById.put(161, "Canon EF 28-70mm f/2.8L or Sigma or Tamron Lens");
     1039        _lensTypeById.put(162, "Canon EF 200mm f/2.8L");
     1040        _lensTypeById.put(163, "Canon EF 300mm f/4L");
     1041        _lensTypeById.put(164, "Canon EF 400mm f/5.6L");
     1042        _lensTypeById.put(165, "Canon EF 70-200mm f/2.8 L");
     1043        _lensTypeById.put(166, "Canon EF 70-200mm f/2.8 L + 1.4x");
     1044        _lensTypeById.put(167, "Canon EF 70-200mm f/2.8 L + 2x");
     1045        _lensTypeById.put(168, "Canon EF 28mm f/1.8 USM or Sigma Lens");
     1046        _lensTypeById.put(169, "Canon EF 17-35mm f/2.8L or Sigma Lens");
     1047        _lensTypeById.put(170, "Canon EF 200mm f/2.8L II");
     1048        _lensTypeById.put(171, "Canon EF 300mm f/4L");
     1049        _lensTypeById.put(172, "Canon EF 400mm f/5.6L or Sigma Lens");
     1050        _lensTypeById.put(173, "Canon EF 180mm Macro f/3.5L or Sigma Lens");
     1051        _lensTypeById.put(174, "Canon EF 135mm f/2L or Other Lens");
     1052        _lensTypeById.put(175, "Canon EF 400mm f/2.8L");
     1053        _lensTypeById.put(176, "Canon EF 24-85mm f/3.5-4.5 USM");
     1054        _lensTypeById.put(177, "Canon EF 300mm f/4L IS");
     1055        _lensTypeById.put(178, "Canon EF 28-135mm f/3.5-5.6 IS");
     1056        _lensTypeById.put(179, "Canon EF 24mm f/1.4L");
     1057        _lensTypeById.put(180, "Canon EF 35mm f/1.4L or Other Lens");
     1058        _lensTypeById.put(181, "Canon EF 100-400mm f/4.5-5.6L IS + 1.4x or Sigma Lens");
     1059        _lensTypeById.put(182, "Canon EF 100-400mm f/4.5-5.6L IS + 2x or Sigma Lens");
     1060        _lensTypeById.put(183, "Canon EF 100-400mm f/4.5-5.6L IS or Sigma Lens");
     1061        _lensTypeById.put(184, "Canon EF 400mm f/2.8L + 2x");
     1062        _lensTypeById.put(185, "Canon EF 600mm f/4L IS");
     1063        _lensTypeById.put(186, "Canon EF 70-200mm f/4L");
     1064        _lensTypeById.put(187, "Canon EF 70-200mm f/4L + 1.4x");
     1065        _lensTypeById.put(188, "Canon EF 70-200mm f/4L + 2x");
     1066        _lensTypeById.put(189, "Canon EF 70-200mm f/4L + 2.8x");
     1067        _lensTypeById.put(190, "Canon EF 100mm f/2.8 Macro USM");
     1068        _lensTypeById.put(191, "Canon EF 400mm f/4 DO IS");
     1069        _lensTypeById.put(193, "Canon EF 35-80mm f/4-5.6 USM");
     1070        _lensTypeById.put(194, "Canon EF 80-200mm f/4.5-5.6 USM");
     1071        _lensTypeById.put(195, "Canon EF 35-105mm f/4.5-5.6 USM");
     1072        _lensTypeById.put(196, "Canon EF 75-300mm f/4-5.6 USM");
     1073        _lensTypeById.put(197, "Canon EF 75-300mm f/4-5.6 IS USM");
     1074        _lensTypeById.put(198, "Canon EF 50mm f/1.4 USM or Zeiss Lens");
     1075        _lensTypeById.put(199, "Canon EF 28-80mm f/3.5-5.6 USM");
     1076        _lensTypeById.put(200, "Canon EF 75-300mm f/4-5.6 USM");
     1077        _lensTypeById.put(201, "Canon EF 28-80mm f/3.5-5.6 USM");
     1078        _lensTypeById.put(202, "Canon EF 28-80mm f/3.5-5.6 USM IV");
     1079        _lensTypeById.put(208, "Canon EF 22-55mm f/4-5.6 USM");
     1080        _lensTypeById.put(209, "Canon EF 55-200mm f/4.5-5.6");
     1081        _lensTypeById.put(210, "Canon EF 28-90mm f/4-5.6 USM");
     1082        _lensTypeById.put(211, "Canon EF 28-200mm f/3.5-5.6 USM");
     1083        _lensTypeById.put(212, "Canon EF 28-105mm f/4-5.6 USM");
     1084        _lensTypeById.put(213, "Canon EF 90-300mm f/4.5-5.6 USM or Tamron Lens");
     1085        _lensTypeById.put(214, "Canon EF-S 18-55mm f/3.5-5.6 USM");
     1086        _lensTypeById.put(215, "Canon EF 55-200mm f/4.5-5.6 II USM");
     1087        _lensTypeById.put(217, "Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD");
     1088        _lensTypeById.put(224, "Canon EF 70-200mm f/2.8L IS");
     1089        _lensTypeById.put(225, "Canon EF 70-200mm f/2.8L IS + 1.4x");
     1090        _lensTypeById.put(226, "Canon EF 70-200mm f/2.8L IS + 2x");
     1091        _lensTypeById.put(227, "Canon EF 70-200mm f/2.8L IS + 2.8x");
     1092        _lensTypeById.put(228, "Canon EF 28-105mm f/3.5-4.5 USM");
     1093        _lensTypeById.put(229, "Canon EF 16-35mm f/2.8L");
     1094        _lensTypeById.put(230, "Canon EF 24-70mm f/2.8L");
     1095        _lensTypeById.put(231, "Canon EF 17-40mm f/4L");
     1096        _lensTypeById.put(232, "Canon EF 70-300mm f/4.5-5.6 DO IS USM");
     1097        _lensTypeById.put(233, "Canon EF 28-300mm f/3.5-5.6L IS");
     1098        _lensTypeById.put(234, "Canon EF-S 17-85mm f/4-5.6 IS USM or Tokina Lens");
     1099        _lensTypeById.put(235, "Canon EF-S 10-22mm f/3.5-4.5 USM");
     1100        _lensTypeById.put(236, "Canon EF-S 60mm f/2.8 Macro USM");
     1101        _lensTypeById.put(237, "Canon EF 24-105mm f/4L IS");
     1102        _lensTypeById.put(238, "Canon EF 70-300mm f/4-5.6 IS USM");
     1103        _lensTypeById.put(239, "Canon EF 85mm f/1.2L II");
     1104        _lensTypeById.put(240, "Canon EF-S 17-55mm f/2.8 IS USM");
     1105        _lensTypeById.put(241, "Canon EF 50mm f/1.2L");
     1106        _lensTypeById.put(242, "Canon EF 70-200mm f/4L IS");
     1107        _lensTypeById.put(243, "Canon EF 70-200mm f/4L IS + 1.4x");
     1108        _lensTypeById.put(244, "Canon EF 70-200mm f/4L IS + 2x");
     1109        _lensTypeById.put(245, "Canon EF 70-200mm f/4L IS + 2.8x");
     1110        _lensTypeById.put(246, "Canon EF 16-35mm f/2.8L II");
     1111        _lensTypeById.put(247, "Canon EF 14mm f/2.8L II USM");
     1112        _lensTypeById.put(248, "Canon EF 200mm f/2L IS or Sigma Lens");
     1113        _lensTypeById.put(249, "Canon EF 800mm f/5.6L IS");
     1114        _lensTypeById.put(250, "Canon EF 24mm f/1.4L II or Sigma Lens");
     1115        _lensTypeById.put(251, "Canon EF 70-200mm f/2.8L IS II USM");
     1116        _lensTypeById.put(252, "Canon EF 70-200mm f/2.8L IS II USM + 1.4x");
     1117        _lensTypeById.put(253, "Canon EF 70-200mm f/2.8L IS II USM + 2x");
     1118        _lensTypeById.put(254, "Canon EF 100mm f/2.8L Macro IS USM");
     1119        _lensTypeById.put(255, "Sigma 24-105mm f/4 DG OS HSM | A or Other Sigma Lens");
     1120        _lensTypeById.put(488, "Canon EF-S 15-85mm f/3.5-5.6 IS USM");
     1121        _lensTypeById.put(489, "Canon EF 70-300mm f/4-5.6L IS USM");
     1122        _lensTypeById.put(490, "Canon EF 8-15mm f/4L Fisheye USM");
     1123        _lensTypeById.put(491, "Canon EF 300mm f/2.8L IS II USM");
     1124        _lensTypeById.put(492, "Canon EF 400mm f/2.8L IS II USM");
     1125        _lensTypeById.put(493, "Canon EF 500mm f/4L IS II USM or EF 24-105mm f4L IS USM");
     1126        _lensTypeById.put(494, "Canon EF 600mm f/4.0L IS II USM");
     1127        _lensTypeById.put(495, "Canon EF 24-70mm f/2.8L II USM");
     1128        _lensTypeById.put(496, "Canon EF 200-400mm f/4L IS USM");
     1129        _lensTypeById.put(499, "Canon EF 200-400mm f/4L IS USM + 1.4x");
     1130        _lensTypeById.put(502, "Canon EF 28mm f/2.8 IS USM");
     1131        _lensTypeById.put(503, "Canon EF 24mm f/2.8 IS USM");
     1132        _lensTypeById.put(504, "Canon EF 24-70mm f/4L IS USM");
     1133        _lensTypeById.put(505, "Canon EF 35mm f/2 IS USM");
     1134        _lensTypeById.put(506, "Canon EF 400mm f/4 DO IS II USM");
     1135        _lensTypeById.put(507, "Canon EF 16-35mm f/4L IS USM");
     1136        _lensTypeById.put(508, "Canon EF 11-24mm f/4L USM");
     1137        _lensTypeById.put(747, "Canon EF 100-400mm f/4.5-5.6L IS II USM");
     1138        _lensTypeById.put(750, "Canon EF 35mm f/1.4L II USM");
     1139        _lensTypeById.put(4142, "Canon EF-S 18-135mm f/3.5-5.6 IS STM");
     1140        _lensTypeById.put(4143, "Canon EF-M 18-55mm f/3.5-5.6 IS STM or Tamron Lens");
     1141        _lensTypeById.put(4144, "Canon EF 40mm f/2.8 STM");
     1142        _lensTypeById.put(4145, "Canon EF-M 22mm f/2 STM");
     1143        _lensTypeById.put(4146, "Canon EF-S 18-55mm f/3.5-5.6 IS STM");
     1144        _lensTypeById.put(4147, "Canon EF-M 11-22mm f/4-5.6 IS STM");
     1145        _lensTypeById.put(4148, "Canon EF-S 55-250mm f/4-5.6 IS STM");
     1146        _lensTypeById.put(4149, "Canon EF-M 55-200mm f/4.5-6.3 IS STM");
     1147        _lensTypeById.put(4150, "Canon EF-S 10-18mm f/4.5-5.6 IS STM");
     1148        _lensTypeById.put(4152, "Canon EF 24-105mm f/3.5-5.6 IS STM");
     1149        _lensTypeById.put(4153, "Canon EF-M 15-45mm f/3.5-6.3 IS STM");
     1150        _lensTypeById.put(4154, "Canon EF-S 24mm f/2.8 STM");
     1151        _lensTypeById.put(4156, "Canon EF 50mm f/1.8 STM");
     1152        _lensTypeById.put(36912, "Canon EF-S 18-135mm f/3.5-5.6 IS USM");
     1153        _lensTypeById.put(65535, "N/A");
     1154    }
    7261155}
  • trunk/src/com/drew/metadata/exif/makernotes/CanonMakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3535 * @author Drew Noakes https://drewnoakes.com
    3636 */
     37@SuppressWarnings("WeakerAccess")
    3738public class CanonMakernoteDirectory extends Directory
    3839{
     
    159160        public static final int TAG_FOCUS_MODE_1 = OFFSET + 0x07;
    160161        public static final int TAG_UNKNOWN_3 = OFFSET + 0x08;
    161         public static final int TAG_UNKNOWN_4 = OFFSET + 0x09;
     162        public static final int TAG_RECORD_MODE = OFFSET + 0x09;
    162163        /**
    163164         * 0 = Large
     
    249250        public static final int TAG_SHORT_FOCAL_LENGTH = OFFSET + 0x18;
    250251        public static final int TAG_FOCAL_UNITS_PER_MM = OFFSET + 0x19;
    251         public static final int TAG_UNKNOWN_9 = OFFSET + 0x1A;
    252         public static final int TAG_UNKNOWN_10 = OFFSET + 0x1B;
     252        public static final int TAG_MAX_APERTURE = OFFSET + 0x1A;
     253        public static final int TAG_MIN_APERTURE = OFFSET + 0x1B;
    253254        /**
    254255         * 0 = Flash Did Not Fire
     
    257258        public static final int TAG_FLASH_ACTIVITY = OFFSET + 0x1C;
    258259        public static final int TAG_FLASH_DETAILS = OFFSET + 0x1D;
    259         public static final int TAG_UNKNOWN_12 = OFFSET + 0x1E;
    260         public static final int TAG_UNKNOWN_13 = OFFSET + 0x1F;
     260        public static final int TAG_FOCUS_CONTINUOUS = OFFSET + 0x1E;
     261        public static final int TAG_AE_SETTING = OFFSET + 0x1F;
    261262        /**
    262263         * 0 = Focus Mode: Single
     
    264265         */
    265266        public static final int TAG_FOCUS_MODE_2 = OFFSET + 0x20;
     267
     268        public static final int TAG_DISPLAY_APERTURE = OFFSET + 0x21;
     269        public static final int TAG_ZOOM_SOURCE_WIDTH = OFFSET + 0x22;
     270        public static final int TAG_ZOOM_TARGET_WIDTH = OFFSET + 0x23;
     271
     272        public static final int TAG_SPOT_METERING_MODE = OFFSET + 0x25;
     273        public static final int TAG_PHOTO_EFFECT = OFFSET + 0x26;
     274        public static final int TAG_MANUAL_FLASH_OUTPUT = OFFSET + 0x27;
     275
     276        public static final int TAG_COLOR_TONE = OFFSET + 0x29;
     277        public static final int TAG_SRAW_QUALITY = OFFSET + 0x2D;
    266278    }
    267279
     
    515527        _tagNameMap.put(CameraSettings.TAG_UNKNOWN_2, "Unknown Camera Setting 2");
    516528        _tagNameMap.put(CameraSettings.TAG_UNKNOWN_3, "Unknown Camera Setting 3");
    517         _tagNameMap.put(CameraSettings.TAG_UNKNOWN_4, "Unknown Camera Setting 4");
     529        _tagNameMap.put(CameraSettings.TAG_RECORD_MODE, "Record Mode");
    518530        _tagNameMap.put(CameraSettings.TAG_DIGITAL_ZOOM, "Digital Zoom");
    519531        _tagNameMap.put(CameraSettings.TAG_FOCUS_TYPE, "Focus Type");
    520532        _tagNameMap.put(CameraSettings.TAG_UNKNOWN_7, "Unknown Camera Setting 7");
    521533        _tagNameMap.put(CameraSettings.TAG_LENS_TYPE, "Lens Type");
    522         _tagNameMap.put(CameraSettings.TAG_UNKNOWN_9, "Unknown Camera Setting 9");
    523         _tagNameMap.put(CameraSettings.TAG_UNKNOWN_10, "Unknown Camera Setting 10");
     534        _tagNameMap.put(CameraSettings.TAG_MAX_APERTURE, "Max Aperture");
     535        _tagNameMap.put(CameraSettings.TAG_MIN_APERTURE, "Min Aperture");
    524536        _tagNameMap.put(CameraSettings.TAG_FLASH_ACTIVITY, "Flash Activity");
    525         _tagNameMap.put(CameraSettings.TAG_UNKNOWN_12, "Unknown Camera Setting 12");
    526         _tagNameMap.put(CameraSettings.TAG_UNKNOWN_13, "Unknown Camera Setting 13");
     537        _tagNameMap.put(CameraSettings.TAG_FOCUS_CONTINUOUS, "Focus Continuous");
     538        _tagNameMap.put(CameraSettings.TAG_AE_SETTING, "AE Setting");
     539        _tagNameMap.put(CameraSettings.TAG_DISPLAY_APERTURE, "Display Aperture");
     540        _tagNameMap.put(CameraSettings.TAG_ZOOM_SOURCE_WIDTH, "Zoom Source Width");
     541        _tagNameMap.put(CameraSettings.TAG_ZOOM_TARGET_WIDTH, "Zoom Target Width");
     542        _tagNameMap.put(CameraSettings.TAG_SPOT_METERING_MODE, "Spot Metering Mode");
     543        _tagNameMap.put(CameraSettings.TAG_PHOTO_EFFECT, "Photo Effect");
     544        _tagNameMap.put(CameraSettings.TAG_MANUAL_FLASH_OUTPUT, "Manual Flash Output");
     545        _tagNameMap.put(CameraSettings.TAG_COLOR_TONE, "Color Tone");
     546        _tagNameMap.put(CameraSettings.TAG_SRAW_QUALITY, "SRAW Quality");
    527547
    528548        _tagNameMap.put(FocalLength.TAG_WHITE_BALANCE, "White Balance");
     
    576596        _tagNameMap.put(AFInfo.TAG_AF_AREA_X_POSITIONS, "AF Area X Positions");
    577597        _tagNameMap.put(AFInfo.TAG_AF_AREA_Y_POSITIONS, "AF Area Y Positions");
    578         _tagNameMap.put(AFInfo.TAG_AF_POINTS_IN_FOCUS, "AF Points in Focus Count");
     598        _tagNameMap.put(AFInfo.TAG_AF_POINTS_IN_FOCUS, "AF Points in Focus");
    579599        _tagNameMap.put(AFInfo.TAG_PRIMARY_AF_POINT_1, "Primary AF Point 1");
    580600        _tagNameMap.put(AFInfo.TAG_PRIMARY_AF_POINT_2, "Primary AF Point 2");
     
    672692        // TODO is there some way to drop out 'null' or 'zero' values that are present in the array to reduce the noise?
    673693
     694        if (!(array instanceof int[])) {
     695            // no special handling...
     696            super.setObjectArray(tagType, array);
     697            return;
     698        }
     699
    674700        // Certain Canon tags contain arrays of values that we split into 'fake' tags as each
    675701        // index in the array has its own meaning and decoding.
     
    709735//                break;
    710736            case TAG_AF_INFO_ARRAY: {
    711                 int[] ints = (int[])array;
    712                 for (int i = 0; i < ints.length; i++)
    713                     setInt(AFInfo.OFFSET + i, ints[i]);
     737                // Notes from Exiftool 10.10 by Phil Harvey, lib\Image\Exiftool\Canon.pm:
     738                // Auto-focus information used by many older Canon models. The values in this
     739                // record are sequential, and some have variable sizes based on the value of
     740                // numafpoints (which may be 1,5,7,9,15,45, or 53). The AFArea coordinates are
     741                // given in a system where the image has dimensions given by AFImageWidth and
     742                // AFImageHeight, and 0,0 is the image center. The direction of the Y axis
     743                // depends on the camera model, with positive Y upwards for EOS models, but
     744                // apparently downwards for PowerShot models.
     745
     746                // AFInfo is another array with 'fake' tags. The first int of the array contains
     747                // the number of AF points. Iterate through the array one byte at a time, generally
     748                // assuming one byte corresponds to one tag UNLESS certain tag numbers are encountered.
     749                // For these, read specific subsequent bytes from the array based on the tag type. The
     750                // number of bytes read can vary.
     751
     752                int[] values = (int[])array;
     753                int numafpoints = values[0];
     754                int tagnumber = 0;
     755                for (int i = 0; i < values.length; i++)
     756                {
     757                    // These two tags store 'numafpoints' bytes of data in the array
     758                    if (AFInfo.OFFSET + tagnumber == AFInfo.TAG_AF_AREA_X_POSITIONS ||
     759                        AFInfo.OFFSET + tagnumber == AFInfo.TAG_AF_AREA_Y_POSITIONS)
     760                    {
     761                        // There could be incorrect data in the array, so boundary check
     762                        if (values.length - 1 >= (i + numafpoints))
     763                        {
     764                            short[] areaPositions = new short[numafpoints];
     765                            for (int j = 0; j < areaPositions.length; j++)
     766                                areaPositions[j] = (short)values[i + j];
     767
     768                            super.setObjectArray(AFInfo.OFFSET + tagnumber, areaPositions);
     769                        }
     770                        i += numafpoints - 1;   // assume these bytes are processed and skip
     771                    }
     772                    else if (AFInfo.OFFSET + tagnumber == AFInfo.TAG_AF_POINTS_IN_FOCUS)
     773                    {
     774                        short[] pointsInFocus = new short[((numafpoints + 15) / 16)];
     775
     776                        // There could be incorrect data in the array, so boundary check
     777                        if (values.length - 1 >= (i + pointsInFocus.length))
     778                        {
     779                            for (int j = 0; j < pointsInFocus.length; j++)
     780                                pointsInFocus[j] = (short)values[i + j];
     781
     782                            super.setObjectArray(AFInfo.OFFSET + tagnumber, pointsInFocus);
     783                        }
     784                        i += pointsInFocus.length - 1;  // assume these bytes are processed and skip
     785                    }
     786                    else
     787                        super.setObjectArray(AFInfo.OFFSET + tagnumber, values[i]);
     788                    tagnumber++;
     789                }
    714790                break;
    715791            }
  • trunk/src/com/drew/metadata/exif/makernotes/CasioType1MakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3232 * @author Drew Noakes https://drewnoakes.com
    3333 */
     34@SuppressWarnings("WeakerAccess")
    3435public class CasioType1MakernoteDescriptor extends TagDescriptor<CasioType1MakernoteDirectory>
    3536{
  • trunk/src/com/drew/metadata/exif/makernotes/CasioType1MakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3434 * @author Drew Noakes https://drewnoakes.com
    3535 */
     36@SuppressWarnings("WeakerAccess")
    3637public class CasioType1MakernoteDirectory extends Directory
    3738{
  • trunk/src/com/drew/metadata/exif/makernotes/CasioType2MakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3232 * @author Drew Noakes https://drewnoakes.com
    3333 */
     34@SuppressWarnings("WeakerAccess")
    3435public class CasioType2MakernoteDescriptor extends TagDescriptor<CasioType2MakernoteDirectory>
    3536{
     
    6869            case TAG_SHARPNESS:
    6970                return getSharpnessDescription();
    70             case TAG_PRINT_IMAGE_MATCHING_INFO:
    71                 return getPrintImageMatchingInfoDescription();
    7271            case TAG_PREVIEW_THUMBNAIL:
    7372                return getCasioPreviewThumbnailDescription();
     
    212211
    213212    @Nullable
    214     public String getPrintImageMatchingInfoDescription()
    215     {
    216         // TODO research PIM specification http://www.ozhiker.com/electronics/pjmt/jpeg_info/pim.html
    217         return _directory.getString(TAG_PRINT_IMAGE_MATCHING_INFO);
    218     }
    219 
    220     @Nullable
    221213    public String getSharpnessDescription()
    222214    {
  • trunk/src/com/drew/metadata/exif/makernotes/CasioType2MakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3434 * @author Drew Noakes https://drewnoakes.com
    3535 */
     36@SuppressWarnings("WeakerAccess")
    3637public class CasioType2MakernoteDirectory extends Directory
    3738{
  • trunk/src/com/drew/metadata/exif/makernotes/FujifilmMakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    4949 * @author Drew Noakes https://drewnoakes.com
    5050 */
     51@SuppressWarnings("WeakerAccess")
    5152public class FujifilmMakernoteDescriptor extends TagDescriptor<FujifilmMakernoteDirectory>
    5253{
  • trunk/src/com/drew/metadata/exif/makernotes/FujifilmMakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3131 * @author Drew Noakes https://drewnoakes.com
    3232 */
     33@SuppressWarnings("WeakerAccess")
    3334public class FujifilmMakernoteDirectory extends Directory
    3435{
  • trunk/src/com/drew/metadata/exif/makernotes/KodakMakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3232 * @author Drew Noakes https://drewnoakes.com
    3333 */
     34@SuppressWarnings("WeakerAccess")
    3435public class KodakMakernoteDescriptor extends TagDescriptor<KodakMakernoteDirectory>
    3536{
  • trunk/src/com/drew/metadata/exif/makernotes/KodakMakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3131 * @author Drew Noakes https://drewnoakes.com
    3232 */
     33@SuppressWarnings("WeakerAccess")
    3334public class KodakMakernoteDirectory extends Directory
    3435{
  • trunk/src/com/drew/metadata/exif/makernotes/KyoceraMakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3939 * @author Drew Noakes https://drewnoakes.com
    4040 */
     41@SuppressWarnings("WeakerAccess")
    4142public class KyoceraMakernoteDescriptor extends TagDescriptor<KyoceraMakernoteDirectory>
    4243{
     
    5152    {
    5253        switch (tagType) {
    53             case TAG_PRINT_IMAGE_MATCHING_INFO:
    54                 return getPrintImageMatchingInfoDescription();
    5554            case TAG_PROPRIETARY_THUMBNAIL:
    5655                return getProprietaryThumbnailDataDescription();
     
    6160
    6261    @Nullable
    63     public String getPrintImageMatchingInfoDescription()
    64     {
    65         return getByteLengthDescription(TAG_PRINT_IMAGE_MATCHING_INFO);
    66     }
    67 
    68     @Nullable
    6962    public String getProprietaryThumbnailDataDescription()
    7063    {
  • trunk/src/com/drew/metadata/exif/makernotes/KyoceraMakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3131 * @author Drew Noakes https://drewnoakes.com
    3232 */
     33@SuppressWarnings("WeakerAccess")
    3334public class KyoceraMakernoteDirectory extends Directory
    3435{
  • trunk/src/com/drew/metadata/exif/makernotes/LeicaMakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3434 * @author Drew Noakes https://drewnoakes.com
    3535 */
     36@SuppressWarnings("WeakerAccess")
    3637public class LeicaMakernoteDescriptor extends TagDescriptor<LeicaMakernoteDirectory>
    3738{
  • trunk/src/com/drew/metadata/exif/makernotes/LeicaMakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3333 * @author Drew Noakes https://drewnoakes.com
    3434 */
     35@SuppressWarnings("WeakerAccess")
    3536public class LeicaMakernoteDirectory extends Directory
    3637{
  • trunk/src/com/drew/metadata/exif/makernotes/NikonType1MakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    4444 * @author Drew Noakes https://drewnoakes.com
    4545 */
     46@SuppressWarnings("WeakerAccess")
    4647public class NikonType1MakernoteDescriptor extends TagDescriptor<NikonType1MakernoteDirectory>
    4748{
  • trunk/src/com/drew/metadata/exif/makernotes/NikonType1MakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    4040 * @author Drew Noakes https://drewnoakes.com
    4141 */
     42@SuppressWarnings("WeakerAccess")
    4243public class NikonType1MakernoteDirectory extends Directory
    4344{
  • trunk/src/com/drew/metadata/exif/makernotes/NikonType2MakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3737 * @author Drew Noakes https://drewnoakes.com
    3838 */
     39@SuppressWarnings("WeakerAccess")
    3940public class NikonType2MakernoteDescriptor extends TagDescriptor<NikonType2MakernoteDirectory>
    4041{
  • trunk/src/com/drew/metadata/exif/makernotes/NikonType2MakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    4545 * @author Drew Noakes https://drewnoakes.com
    4646 */
     47@SuppressWarnings("WeakerAccess")
    4748public class NikonType2MakernoteDirectory extends Directory
    4849{
     
    760761    public static final int TAG_UNKNOWN_50 = 0x00BD;
    761762    public static final int TAG_UNKNOWN_51 = 0x0103;
    762     public static final int TAG_PRINT_IM = 0x0E00;
     763    public static final int TAG_PRINT_IMAGE_MATCHING_INFO = 0x0E00;
    763764
    764765    /**
     
    893894        _tagNameMap.put(TAG_UNKNOWN_50, "Unknown 50");
    894895        _tagNameMap.put(TAG_UNKNOWN_51, "Unknown 51");
    895         _tagNameMap.put(TAG_PRINT_IM, "Print IM");
     896        _tagNameMap.put(TAG_PRINT_IMAGE_MATCHING_INFO, "Print IM");
    896897        _tagNameMap.put(TAG_UNKNOWN_52, "Unknown 52");
    897898        _tagNameMap.put(TAG_UNKNOWN_53, "Unknown 53");
  • trunk/src/com/drew/metadata/exif/makernotes/OlympusCameraSettingsMakernoteDescriptor.java

    r10862 r13061  
    4141 * @author Drew Noakes https://drewnoakes.com
    4242 */
     43@SuppressWarnings("WeakerAccess")
    4344public class OlympusCameraSettingsMakernoteDescriptor extends TagDescriptor<OlympusCameraSettingsMakernoteDirectory>
    4445{
     
    143144            case TagArtFilterEffect:
    144145                return getArtFilterEffectDescription();
     146            case TagColorCreatorEffect:
     147                return getColorCreatorEffectDescription();
    145148
    146149            case TagDriveMode:
     
    407410        int p4 = (int)(values[index + 3].doubleValue() * 100);
    408411
     412        if(p1 + p2 + p3 + p4 == 0)
     413            return "n/a";
     414
    409415        return String.format("(%d%%,%d%%) (%d%%,%d%%)", p1, p2, p3, p4);
    410 
    411416    }
    412417
     
    10191024        StringBuilder sb = new StringBuilder();
    10201025        for (int i = 0; i < values.length; i++) {
    1021             if (i == 1)
    1022                 sb.append("Highlights ");
    1023             else if (i == 5)
    1024                 sb.append("Shadows ");
    1025 
    1026             sb.append(values[i]).append("; ");
     1026            if (i == 0 || i == 4 || i == 8 || i == 12 || i == 16 || i == 20 || i == 24)
     1027                sb.append(_toneLevelType.get(values[i])).append("; ");
     1028            else
     1029                sb.append(values[i]).append("; ");
    10271030        }
    10281031
     
    10341037    {
    10351038        int[] values = _directory.getIntArray(TagArtFilterEffect);
    1036         if (values == null || values.length == 0)
     1039        if (values == null)
    10371040            return null;
    10381041
     
    10401043        for (int i = 0; i < values.length; i++) {
    10411044            if (i == 0) {
    1042                 sb.append((_filters.containsKey(values[i]) ? _filters.get(values[i]) : "[unknown]"));
     1045                sb.append((_filters.containsKey(values[i]) ? _filters.get(values[i]) : "[unknown]")).append("; ");
     1046            } else if (i == 3) {
     1047                sb.append("Partial Color ").append(values[i]).append("; ");
    10431048            } else if (i == 4) {
    10441049                switch (values[i]) {
     
    10681073                        break;
    10691074                }
     1075                sb.append("; ");
     1076            } else if (i == 6) {
     1077                switch (values[i]) {
     1078                    case 0:
     1079                        sb.append("No Color Filter");
     1080                        break;
     1081                    case 1:
     1082                        sb.append("Yellow Color Filter");
     1083                        break;
     1084                    case 2:
     1085                        sb.append("Orange Color Filter");
     1086                        break;
     1087                    case 3:
     1088                        sb.append("Red Color Filter");
     1089                        break;
     1090                    case 4:
     1091                        sb.append("Green Color Filter");
     1092                        break;
     1093                    default:
     1094                        sb.append("Unknown (").append(values[i]).append(")");
     1095                        break;
     1096                }
     1097                sb.append("; ");
    10701098            } else {
    1071                 sb.append(values[i]);
     1099                sb.append(values[i]).append("; ");
    10721100            }
    1073             sb.append("; ");
     1101        }
     1102
     1103        return sb.substring(0, sb.length() - 2);
     1104    }
     1105
     1106    @Nullable
     1107    public String getColorCreatorEffectDescription()
     1108    {
     1109        int[] values = _directory.getIntArray(TagColorCreatorEffect);
     1110        if (values == null)
     1111            return null;
     1112
     1113        StringBuilder sb = new StringBuilder();
     1114        for (int i = 0; i < values.length; i++) {
     1115            if (i == 0) {
     1116                sb.append("Color ").append(values[i]).append("; ");
     1117            } else if (i == 3) {
     1118                sb.append("Strength ").append(values[i]).append("; ");
     1119            } else {
     1120                sb.append(values[i]).append("; ");
     1121            }
    10741122        }
    10751123
     
    12941342    }
    12951343
     1344    @Nullable
    12961345    private String getFiltersDescription(int tagId)
    12971346    {
     
    13121361    }
    13131362
     1363    private static final HashMap<Integer, String> _toneLevelType = new HashMap<Integer, String>();
    13141364    // ArtFilter, ArtFilterEffect and MagicFilter values
    13151365    private static final HashMap<Integer, String> _filters = new HashMap<Integer, String>();
     
    13541404        _filters.put(40, "Partial Color II");
    13551405        _filters.put(41, "Partial Color III");
     1406
     1407        _toneLevelType.put(0, "0");
     1408        _toneLevelType.put(-31999, "Highlights ");
     1409        _toneLevelType.put(-31998, "Shadows ");
     1410        _toneLevelType.put(-31997, "Midtones ");
    13561411    }
    13571412}
  • trunk/src/com/drew/metadata/exif/makernotes/OlympusCameraSettingsMakernoteDirectory.java

    r10862 r13061  
    3333 * @author Drew Noakes https://drewnoakes.com
    3434 */
     35@SuppressWarnings("WeakerAccess")
    3536public class OlympusCameraSettingsMakernoteDirectory extends Directory
    3637{
     
    8990    public static final int TagToneLevel = 0x52e;
    9091    public static final int TagArtFilterEffect = 0x52f;
     92    public static final int TagColorCreatorEffect = 0x532;
    9193
    9294    public static final int TagDriveMode = 0x600;
     
    162164        _tagNameMap.put(TagToneLevel, "Tone Level");
    163165        _tagNameMap.put(TagArtFilterEffect, "Art Filter Effect");
     166        _tagNameMap.put(TagColorCreatorEffect, "Color Creator Effect");
    164167
    165168        _tagNameMap.put(TagDriveMode, "Drive Mode");
  • trunk/src/com/drew/metadata/exif/makernotes/OlympusEquipmentMakernoteDescriptor.java

    r10862 r13061  
    4040 * @author Drew Noakes https://drewnoakes.com
    4141 */
     42@SuppressWarnings("WeakerAccess")
    4243public class OlympusEquipmentMakernoteDescriptor extends TagDescriptor<OlympusEquipmentMakernoteDirectory>
    4344{
     
    5354        switch (tagType) {
    5455            case TAG_EQUIPMENT_VERSION:
    55                 return GetEquipmentVersionDescription();
     56                return getEquipmentVersionDescription();
     57            case TAG_CAMERA_TYPE_2:
     58                return getCameraType2Description();
    5659            case TAG_FOCAL_PLANE_DIAGONAL:
    57                 return GetFocalPlaneDiagonalDescription();
     60                return getFocalPlaneDiagonalDescription();
    5861            case TAG_BODY_FIRMWARE_VERSION:
    59                 return GetBodyFirmwareVersionDescription();
     62                return getBodyFirmwareVersionDescription();
    6063            case TAG_LENS_TYPE:
    61                 return GetLensTypeDescription();
     64                return getLensTypeDescription();
    6265            case TAG_LENS_FIRMWARE_VERSION:
    63                 return GetLensFirmwareVersionDescription();
     66                return getLensFirmwareVersionDescription();
    6467            case TAG_MAX_APERTURE_AT_MIN_FOCAL:
    65                 return GetMaxApertureAtMinFocalDescription();
     68                return getMaxApertureAtMinFocalDescription();
    6669            case TAG_MAX_APERTURE_AT_MAX_FOCAL:
    67                 return GetMaxApertureAtMaxFocalDescription();
     70                return getMaxApertureAtMaxFocalDescription();
    6871            case TAG_MAX_APERTURE:
    69                 return GetMaxApertureDescription();
     72                return getMaxApertureDescription();
    7073            case TAG_LENS_PROPERTIES:
    71                 return GetLensPropertiesDescription();
     74                return getLensPropertiesDescription();
    7275            case TAG_EXTENDER:
    73                 return GetExtenderDescription();
     76                return getExtenderDescription();
    7477            case TAG_FLASH_TYPE:
    75                 return GetFlashTypeDescription();
     78                return getFlashTypeDescription();
    7679            case TAG_FLASH_MODEL:
    77                 return GetFlashModelDescription();
     80                return getFlashModelDescription();
    7881            default:
    7982                return super.getDescription(tagType);
     
    8285
    8386    @Nullable
    84     public String GetEquipmentVersionDescription()
     87    public String getEquipmentVersionDescription()
    8588    {
    8689        return getVersionBytesDescription(TAG_EQUIPMENT_VERSION, 4);
     
    8891
    8992    @Nullable
    90     public String GetFocalPlaneDiagonalDescription()
     93    public String getCameraType2Description()
     94    {
     95        String cameratype = _directory.getString(TAG_CAMERA_TYPE_2);
     96        if(cameratype == null)
     97            return null;
     98
     99        if(OlympusMakernoteDirectory.OlympusCameraTypes.containsKey(cameratype))
     100            return OlympusMakernoteDirectory.OlympusCameraTypes.get(cameratype);
     101
     102        return cameratype;
     103    }
     104
     105    @Nullable
     106    public String getFocalPlaneDiagonalDescription()
    91107    {
    92108        return _directory.getString(TAG_FOCAL_PLANE_DIAGONAL) + " mm";
     
    94110
    95111    @Nullable
    96     public String GetBodyFirmwareVersionDescription()
     112    public String getBodyFirmwareVersionDescription()
    97113    {
    98114        Integer value = _directory.getInteger(TAG_BODY_FIRMWARE_VERSION);
     
    107123
    108124    @Nullable
    109     public String GetLensTypeDescription()
     125    public String getLensTypeDescription()
    110126    {
    111127        String str = _directory.getString(TAG_LENS_TYPE);
     
    140156
    141157    @Nullable
    142     public String GetLensFirmwareVersionDescription()
     158    public String getLensFirmwareVersionDescription()
    143159    {
    144160        Integer value = _directory.getInteger(TAG_LENS_FIRMWARE_VERSION);
     
    153169
    154170    @Nullable
    155     public String GetMaxApertureAtMinFocalDescription()
     171    public String getMaxApertureAtMinFocalDescription()
    156172    {
    157173        Integer value = _directory.getInteger(TAG_MAX_APERTURE_AT_MIN_FOCAL);
     
    164180
    165181    @Nullable
    166     public String GetMaxApertureAtMaxFocalDescription()
     182    public String getMaxApertureAtMaxFocalDescription()
    167183    {
    168184        Integer value = _directory.getInteger(TAG_MAX_APERTURE_AT_MAX_FOCAL);
     
    175191
    176192    @Nullable
    177     public String GetMaxApertureDescription()
     193    public String getMaxApertureDescription()
    178194    {
    179195        Integer value = _directory.getInteger(TAG_MAX_APERTURE);
     
    191207
    192208    @Nullable
    193     public String GetLensPropertiesDescription()
     209    public String getLensPropertiesDescription()
    194210    {
    195211        Integer value = _directory.getInteger(TAG_LENS_PROPERTIES);
     
    201217
    202218    @Nullable
    203     public String GetExtenderDescription()
     219    public String getExtenderDescription()
    204220    {
    205221        String str = _directory.getString(TAG_EXTENDER);
     
    234250
    235251    @Nullable
    236     public String GetFlashTypeDescription()
     252    public String getFlashTypeDescription()
    237253    {
    238254        return getIndexedDescription(TAG_FLASH_TYPE,
     
    241257
    242258    @Nullable
    243     public String GetFlashModelDescription()
     259    public String getFlashModelDescription()
    244260    {
    245261        return getIndexedDescription(TAG_FLASH_MODEL,
  • trunk/src/com/drew/metadata/exif/makernotes/OlympusEquipmentMakernoteDirectory.java

    r10862 r13061  
    3333 * @author Drew Noakes https://drewnoakes.com
    3434 */
     35@SuppressWarnings("WeakerAccess")
    3536public class OlympusEquipmentMakernoteDirectory extends Directory
    3637{
  • trunk/src/com/drew/metadata/exif/makernotes/OlympusMakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    2121package com.drew.metadata.exif.makernotes;
    2222
     23import com.drew.imaging.PhotographicConversions;
     24import com.drew.lang.Rational;
    2325import com.drew.lang.DateUtil;
    2426import com.drew.lang.annotations.NotNull;
     
    3638 * @author Drew Noakes https://drewnoakes.com
    3739 */
     40@SuppressWarnings("WeakerAccess")
    3841public class OlympusMakernoteDescriptor extends TagDescriptor<OlympusMakernoteDirectory>
    3942{
     
    6669            case TAG_BW_MODE:
    6770                return getBWModeDescription();
    68             case TAG_DIGI_ZOOM_RATIO:
    69                 return getDigiZoomRatioDescription();
     71            case TAG_DIGITAL_ZOOM:
     72                return getDigitalZoomDescription();
     73            case TAG_FOCAL_PLANE_DIAGONAL:
     74                return getFocalPlaneDiagonalDescription();
     75            case TAG_CAMERA_TYPE:
     76                return getCameraTypeDescription();
    7077            case TAG_CAMERA_ID:
    7178                return getCameraIdDescription();
     79            case TAG_ONE_TOUCH_WB:
     80                return getOneTouchWbDescription();
     81            case TAG_SHUTTER_SPEED_VALUE:
     82                return getShutterSpeedDescription();
     83            case TAG_ISO_VALUE:
     84                return getIsoValueDescription();
     85            case TAG_APERTURE_VALUE:
     86                return getApertureValueDescription();
    7287            case TAG_FLASH_MODE:
    7388                return getFlashModeDescription();
     
    7893            case TAG_SHARPNESS:
    7994                return getSharpnessDescription();
     95            case TAG_COLOUR_MATRIX:
     96                return getColorMatrixDescription();
     97            case TAG_WB_MODE:
     98                return getWbModeDescription();
     99            case TAG_RED_BALANCE:
     100                return getRedBalanceDescription();
     101            case TAG_BLUE_BALANCE:
     102                return getBlueBalanceDescription();
     103            case TAG_CONTRAST:
     104                return getContrastDescription();
     105            case TAG_PREVIEW_IMAGE_VALID:
     106                return getPreviewImageValidDescription();
    80107
    81108            case CameraSettings.TAG_EXPOSURE_MODE:
     
    102129                return getMacroModeCameraSettingDescription();
    103130            case CameraSettings.TAG_DIGITAL_ZOOM:
    104                 return getDigitalZoomDescription();
     131                return getDigitalZoomCameraSettingDescription();
    105132            case CameraSettings.TAG_EXPOSURE_COMPENSATION:
    106133                return getExposureCompensationDescription();
     
    138165                return getSaturationDescription();
    139166            case CameraSettings.TAG_CONTRAST:
    140                 return getContrastDescription();
     167                return getContrastCameraSettingDescription();
    141168            case CameraSettings.TAG_SHARPNESS:
    142169                return getSharpnessCameraSettingDescription();
     
    305332
    306333    @Nullable
    307     public String getDigitalZoomDescription()
     334    public String getDigitalZoomCameraSettingDescription()
    308335    {
    309336        return getIndexedDescription(CameraSettings.TAG_DIGITAL_ZOOM, "Off", "Electronic magnification", "Digital zoom 2x");
     
    468495
    469496    @Nullable
    470     public String getContrastDescription()
     497    public String getContrastCameraSettingDescription()
    471498    {
    472499        Long value = _directory.getLongObject(CameraSettings.TAG_CONTRAST);
     
    647674
    648675    @Nullable
     676    public String getColorMatrixDescription()
     677    {
     678        int[] obj = _directory.getIntArray(TAG_COLOUR_MATRIX);
     679        if (obj == null)
     680            return null;
     681
     682        StringBuilder sb = new StringBuilder();
     683        for (int i = 0; i < obj.length; i++) {
     684            sb.append((short)obj[i]);
     685            if (i < obj.length - 1)
     686                sb.append(" ");
     687        }
     688        return sb.length() == 0 ? null : sb.toString();
     689    }
     690
     691    @Nullable
     692    public String getWbModeDescription()
     693    {
     694        int[] obj = _directory.getIntArray(TAG_WB_MODE);
     695        if (obj == null)
     696            return null;
     697
     698        String val = String.format("%d %d", obj[0], obj[1]);
     699
     700        if(val.equals("1 0"))
     701            return "Auto";
     702        else if(val.equals("1 2"))
     703            return "Auto (2)";
     704        else if(val.equals("1 4"))
     705            return "Auto (4)";
     706        else if(val.equals("2 2"))
     707            return "3000 Kelvin";
     708        else if(val.equals("2 3"))
     709            return "3700 Kelvin";
     710        else if(val.equals("2 4"))
     711            return "4000 Kelvin";
     712        else if(val.equals("2 5"))
     713            return "4500 Kelvin";
     714        else if(val.equals("2 6"))
     715            return "5500 Kelvin";
     716        else if(val.equals("2 7"))
     717            return "6500 Kelvin";
     718        else if(val.equals("2 8"))
     719            return "7500 Kelvin";
     720        else if(val.equals("3 0"))
     721            return "One-touch";
     722        else
     723            return "Unknown " + val;
     724    }
     725
     726    @Nullable
     727    public String getRedBalanceDescription()
     728    {
     729        int[] values = _directory.getIntArray(TAG_RED_BALANCE);
     730        if (values == null)
     731            return null;
     732
     733        short value = (short)values[0];
     734
     735        return String.valueOf((double)value/256d);
     736    }
     737
     738    @Nullable
     739    public String getBlueBalanceDescription()
     740    {
     741        int[] values = _directory.getIntArray(TAG_BLUE_BALANCE);
     742        if (values == null)
     743            return null;
     744
     745        short value = (short)values[0];
     746
     747        return String.valueOf((double)value/256d);
     748    }
     749
     750    @Nullable
     751    public String getContrastDescription()
     752    {
     753        return getIndexedDescription(TAG_CONTRAST, "High", "Normal", "Low");
     754    }
     755
     756    @Nullable
     757    public String getPreviewImageValidDescription()
     758    {
     759        return getIndexedDescription(TAG_PREVIEW_IMAGE_VALID, "No", "Yes");
     760    }
     761
     762    @Nullable
    649763    public String getFocusModeDescription()
    650764    {
     
    665779
    666780    @Nullable
    667     public String getDigiZoomRatioDescription()
    668     {
    669         return getIndexedDescription(TAG_DIGI_ZOOM_RATIO, "Normal", null, "Digital 2x Zoom");
     781    public String getDigitalZoomDescription()
     782    {
     783        Rational value = _directory.getRational(TAG_DIGITAL_ZOOM);
     784        if (value == null)
     785            return null;
     786        return value.toSimpleString(false);
     787    }
     788
     789    @Nullable
     790    public String getFocalPlaneDiagonalDescription()
     791    {
     792        Rational value = _directory.getRational(TAG_FOCAL_PLANE_DIAGONAL);
     793        if (value == null)
     794            return null;
     795
     796        DecimalFormat format = new DecimalFormat("0.###");
     797        return format.format(value.doubleValue()) + " mm";
     798    }
     799
     800    @Nullable
     801    public String getCameraTypeDescription()
     802    {
     803        String cameratype = _directory.getString(TAG_CAMERA_TYPE);
     804        if(cameratype == null)
     805            return null;
     806
     807        if(OlympusMakernoteDirectory.OlympusCameraTypes.containsKey(cameratype))
     808            return OlympusMakernoteDirectory.OlympusCameraTypes.get(cameratype);
     809
     810        return cameratype;
    670811    }
    671812
     
    680821
    681822    @Nullable
     823    public String getOneTouchWbDescription()
     824    {
     825        return getIndexedDescription(TAG_ONE_TOUCH_WB, "Off", "On", "On (Preset)");
     826    }
     827
     828    @Nullable
     829    public String getShutterSpeedDescription()
     830    {
     831        return super.getShutterSpeedDescription(TAG_SHUTTER_SPEED_VALUE);
     832    }
     833
     834    @Nullable
     835    public String getIsoValueDescription()
     836    {
     837        Rational value = _directory.getRational(TAG_ISO_VALUE);
     838        if (value == null)
     839            return null;
     840
     841        return String.valueOf(Math.round(Math.pow(2, value.doubleValue() - 5) * 100));
     842    }
     843
     844    @Nullable
     845    public String getApertureValueDescription()
     846    {
     847        Double aperture = _directory.getDoubleObject(TAG_APERTURE_VALUE);
     848        if (aperture == null)
     849            return null;
     850        double fStop = PhotographicConversions.apertureToFStop(aperture);
     851        return getFStopDescription(fStop);
     852    }
     853
     854    @Nullable
    682855    public String getMacroModeDescription()
    683856    {
     
    694867    public String getJpegQualityDescription()
    695868    {
    696         return getIndexedDescription(TAG_JPEG_QUALITY,
     869        String cameratype = _directory.getString(TAG_CAMERA_TYPE);
     870
     871        if(cameratype != null)
     872        {
     873            Integer value = _directory.getInteger(TAG_JPEG_QUALITY);
     874            if(value == null)
     875                return null;
     876
     877            if((cameratype.startsWith("SX") && !cameratype.startsWith("SX151"))
     878                || cameratype.startsWith("D4322"))
     879            {
     880                switch (value)
     881                {
     882                    case 0:
     883                        return "Standard Quality (Low)";
     884                    case 1:
     885                        return "High Quality (Normal)";
     886                    case 2:
     887                        return "Super High Quality (Fine)";
     888                    case 6:
     889                        return "RAW";
     890                    default:
     891                        return "Unknown (" + value.toString() + ")";
     892                }
     893            }
     894            else
     895            {
     896                switch (value)
     897                {
     898                    case 0:
     899                        return "Standard Quality (Low)";
     900                    case 1:
     901                        return "High Quality (Normal)";
     902                    case 2:
     903                        return "Super High Quality (Fine)";
     904                    case 4:
     905                        return "RAW";
     906                    case 5:
     907                        return "Medium-Fine";
     908                    case 6:
     909                        return "Small-Fine";
     910                    case 33:
     911                        return "Uncompressed";
     912                    default:
     913                        return "Unknown (" + value.toString() + ")";
     914                }
     915            }
     916        }
     917        else
     918            return getIndexedDescription(TAG_JPEG_QUALITY,
    697919            1,
    698920            "Standard Quality",
  • trunk/src/com/drew/metadata/exif/makernotes/OlympusMakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3434 * @author Drew Noakes https://drewnoakes.com
    3535 */
     36@SuppressWarnings("WeakerAccess")
    3637public class OlympusMakernoteDirectory extends Directory
    3738{
     
    117118
    118119    /** Zoom Factor (0 or 1 = normal) */
    119     public static final int TAG_DIGI_ZOOM_RATIO = 0x0204;
     120    public static final int TAG_DIGITAL_ZOOM = 0x0204;
    120121    public static final int TAG_FOCAL_PLANE_DIAGONAL = 0x0205;
    121122    public static final int TAG_LENS_DISTORTION_PARAMETERS = 0x0206;
    122     public static final int TAG_FIRMWARE_VERSION = 0x0207;
     123    public static final int TAG_CAMERA_TYPE = 0x0207;
    123124    public static final int TAG_PICT_INFO = 0x0208;
    124125    public static final int TAG_CAMERA_ID = 0x0209;
     
    146147    public static final int TAG_WHITE_BALANCE_BIAS = 0x0304;
    147148    public static final int TAG_SCENE_MODE = 0x0403;
    148     public static final int TAG_FIRMWARE = 0x0404;
     149    public static final int TAG_SERIAL_NUMBER_1 = 0x0404;
     150    public static final int TAG_FIRMWARE = 0x0405;
    149151
    150152    /**
     
    176178    public static final int TAG_COLOUR_MATRIX = 0x1011;
    177179    public static final int TAG_BLACK_LEVEL = 0x1012;
    178 //    public static final int TAG_ = 0x1013;
    179 //    public static final int TAG_ = 0x1014;
    180     public static final int TAG_WHITE_BALANCE = 0x1015;
     180    public static final int TAG_COLOR_TEMPERATURE_BG = 0x1013;
     181    public static final int TAG_COLOR_TEMPERATURE_RG = 0x1014;
     182    public static final int TAG_WB_MODE = 0x1015;
    181183//    public static final int TAG_ = 0x1016;
    182     public static final int TAG_RED_BIAS = 0x1017;
    183     public static final int TAG_BLUE_BIAS = 0x1018;
     184    public static final int TAG_RED_BALANCE = 0x1017;
     185    public static final int TAG_BLUE_BALANCE = 0x1018;
    184186    public static final int TAG_COLOR_MATRIX_NUMBER = 0x1019;
    185     public static final int TAG_SERIAL_NUMBER = 0x101A;
    186 //    public static final int TAG_ = 0x101B;
    187 //    public static final int TAG_ = 0x101C;
    188 //    public static final int TAG_ = 0x101D;
    189 //    public static final int TAG_ = 0x101E;
    190 //    public static final int TAG_ = 0x101F;
    191 //    public static final int TAG_ = 0x1020;
    192 //    public static final int TAG_ = 0x1021;
    193 //    public static final int TAG_ = 0x1022;
     187    public static final int TAG_SERIAL_NUMBER_2 = 0x101A;
     188
     189    public static final int TAG_EXTERNAL_FLASH_AE1_0 = 0x101B;
     190    public static final int TAG_EXTERNAL_FLASH_AE2_0 = 0x101C;
     191    public static final int TAG_INTERNAL_FLASH_AE1_0 = 0x101D;
     192    public static final int TAG_INTERNAL_FLASH_AE2_0 = 0x101E;
     193    public static final int TAG_EXTERNAL_FLASH_AE1 = 0x101F;
     194    public static final int TAG_EXTERNAL_FLASH_AE2 = 0x1020;
     195    public static final int TAG_INTERNAL_FLASH_AE1 = 0x1021;
     196    public static final int TAG_INTERNAL_FLASH_AE2 = 0x1022;
     197
    194198    public static final int TAG_FLASH_BIAS = 0x1023;
    195 //    public static final int TAG_ = 0x1024;
    196 //    public static final int TAG_ = 0x1025;
     199    public static final int TAG_INTERNAL_FLASH_TABLE = 0x1024;
     200    public static final int TAG_EXTERNAL_FLASH_G_VALUE = 0x1025;
    197201    public static final int TAG_EXTERNAL_FLASH_BOUNCE = 0x1026;
    198202    public static final int TAG_EXTERNAL_FLASH_ZOOM = 0x1027;
     
    203207    public static final int TAG_VALID_BITS = 0x102C;
    204208    public static final int TAG_CORING_FILTER = 0x102D;
    205     public static final int TAG_FINAL_WIDTH = 0x102E;
    206     public static final int TAG_FINAL_HEIGHT = 0x102F;
    207 //    public static final int TAG_ = 0x1030;
    208 //    public static final int TAG_ = 0x1031;
     209    public static final int TAG_OLYMPUS_IMAGE_WIDTH = 0x102E;
     210    public static final int TAG_OLYMPUS_IMAGE_HEIGHT = 0x102F;
     211    public static final int TAG_SCENE_DETECT = 0x1030;
     212    public static final int TAG_SCENE_AREA = 0x1031;
    209213//    public static final int TAG_ = 0x1032;
    210 //    public static final int TAG_ = 0x1033;
     214    public static final int TAG_SCENE_DETECT_DATA = 0x1033;
    211215    public static final int TAG_COMPRESSION_RATIO = 0x1034;
    212     public static final int TAG_THUMBNAIL = 0x1035;
    213     public static final int TAG_THUMBNAIL_OFFSET = 0x1036;
    214     public static final int TAG_THUMBNAIL_LENGTH = 0x1037;
    215 //    public static final int TAG_ = 0x1038;
     216    public static final int TAG_PREVIEW_IMAGE_VALID = 0x1035;
     217    public static final int TAG_PREVIEW_IMAGE_START = 0x1036;
     218    public static final int TAG_PREVIEW_IMAGE_LENGTH = 0x1037;
     219    public static final int TAG_AF_RESULT = 0x1038;
    216220    public static final int TAG_CCD_SCAN_MODE = 0x1039;
    217221    public static final int TAG_NOISE_REDUCTION = 0x103A;
    218222    public static final int TAG_INFINITY_LENS_STEP = 0x103B;
    219223    public static final int TAG_NEAR_LENS_STEP = 0x103C;
     224    public static final int TAG_LIGHT_VALUE_CENTER = 0x103D;
     225    public static final int TAG_LIGHT_VALUE_PERIPHERY = 0x103E;
     226    public static final int TAG_FIELD_COUNT = 0x103F;
    220227    public static final int TAG_EQUIPMENT = 0x2010;
    221228    public static final int TAG_CAMERA_SETTINGS = 0x2020;
     
    225232    public static final int TAG_FOCUS_INFO = 0x2050;
    226233    public static final int TAG_RAW_INFO = 0x3000;
     234    public static final int TAG_MAIN_INFO = 0x4000;
    227235
    228236    public final static class CameraSettings
     
    302310        _tagNameMap.put(TAG_MACRO_MODE, "Macro");
    303311        _tagNameMap.put(TAG_BW_MODE, "BW Mode");
    304         _tagNameMap.put(TAG_DIGI_ZOOM_RATIO, "DigiZoom Ratio");
     312        _tagNameMap.put(TAG_DIGITAL_ZOOM, "Digital Zoom");
    305313        _tagNameMap.put(TAG_FOCAL_PLANE_DIAGONAL, "Focal Plane Diagonal");
    306314        _tagNameMap.put(TAG_LENS_DISTORTION_PARAMETERS, "Lens Distortion Parameters");
    307         _tagNameMap.put(TAG_FIRMWARE_VERSION, "Firmware Version");
     315        _tagNameMap.put(TAG_CAMERA_TYPE, "Camera Type");
    308316        _tagNameMap.put(TAG_PICT_INFO, "Pict Info");
    309317        _tagNameMap.put(TAG_CAMERA_ID, "Camera Id");
     
    318326        _tagNameMap.put(TAG_WHITE_BALANCE_BIAS, "White Balance Bias");
    319327        _tagNameMap.put(TAG_SCENE_MODE, "Scene Mode");
     328        _tagNameMap.put(TAG_SERIAL_NUMBER_1, "Serial Number");
    320329        _tagNameMap.put(TAG_FIRMWARE, "Firmware");
    321330        _tagNameMap.put(TAG_PRINT_IMAGE_MATCHING_INFO, "Print Image Matching (PIM) Info");
     
    341350        _tagNameMap.put(TAG_COLOUR_MATRIX, "Colour Matrix");
    342351        _tagNameMap.put(TAG_BLACK_LEVEL, "Black Level");
    343         _tagNameMap.put(TAG_WHITE_BALANCE, "White Balance");
    344         _tagNameMap.put(TAG_RED_BIAS, "Red Bias");
    345         _tagNameMap.put(TAG_BLUE_BIAS, "Blue Bias");
     352        _tagNameMap.put(TAG_COLOR_TEMPERATURE_BG, "Color Temperature BG");
     353        _tagNameMap.put(TAG_COLOR_TEMPERATURE_RG, "Color Temperature RG");
     354        _tagNameMap.put(TAG_WB_MODE, "White Balance Mode");
     355        _tagNameMap.put(TAG_RED_BALANCE, "Red Balance");
     356        _tagNameMap.put(TAG_BLUE_BALANCE, "Blue Balance");
    346357        _tagNameMap.put(TAG_COLOR_MATRIX_NUMBER, "Color Matrix Number");
    347         _tagNameMap.put(TAG_SERIAL_NUMBER, "Serial Number");
     358        _tagNameMap.put(TAG_SERIAL_NUMBER_2, "Serial Number");
     359        _tagNameMap.put(TAG_EXTERNAL_FLASH_AE1_0, "External Flash AE1 0");
     360        _tagNameMap.put(TAG_EXTERNAL_FLASH_AE2_0, "External Flash AE2 0");
     361        _tagNameMap.put(TAG_INTERNAL_FLASH_AE1_0, "Internal Flash AE1 0");
     362        _tagNameMap.put(TAG_INTERNAL_FLASH_AE2_0, "Internal Flash AE2 0");
     363        _tagNameMap.put(TAG_EXTERNAL_FLASH_AE1, "External Flash AE1");
     364        _tagNameMap.put(TAG_EXTERNAL_FLASH_AE2, "External Flash AE2");
     365        _tagNameMap.put(TAG_INTERNAL_FLASH_AE1, "Internal Flash AE1");
     366        _tagNameMap.put(TAG_INTERNAL_FLASH_AE2, "Internal Flash AE2");
    348367        _tagNameMap.put(TAG_FLASH_BIAS, "Flash Bias");
     368        _tagNameMap.put(TAG_INTERNAL_FLASH_TABLE, "Internal Flash Table");
     369        _tagNameMap.put(TAG_EXTERNAL_FLASH_G_VALUE, "External Flash G Value");
    349370        _tagNameMap.put(TAG_EXTERNAL_FLASH_BOUNCE, "External Flash Bounce");
    350371        _tagNameMap.put(TAG_EXTERNAL_FLASH_ZOOM, "External Flash Zoom");
     
    355376        _tagNameMap.put(TAG_VALID_BITS, "Valid Bits");
    356377        _tagNameMap.put(TAG_CORING_FILTER, "Coring Filter");
    357         _tagNameMap.put(TAG_FINAL_WIDTH, "Final Width");
    358         _tagNameMap.put(TAG_FINAL_HEIGHT, "Final Height");
     378        _tagNameMap.put(TAG_OLYMPUS_IMAGE_WIDTH, "Olympus Image Width");
     379        _tagNameMap.put(TAG_OLYMPUS_IMAGE_HEIGHT, "Olympus Image Height");
     380        _tagNameMap.put(TAG_SCENE_DETECT, "Scene Detect");
     381        _tagNameMap.put(TAG_SCENE_AREA, "Scene Area");
     382        _tagNameMap.put(TAG_SCENE_DETECT_DATA, "Scene Detect Data");
    359383        _tagNameMap.put(TAG_COMPRESSION_RATIO, "Compression Ratio");
    360         _tagNameMap.put(TAG_THUMBNAIL, "Thumbnail");
    361         _tagNameMap.put(TAG_THUMBNAIL_OFFSET, "Thumbnail Offset");
    362         _tagNameMap.put(TAG_THUMBNAIL_LENGTH, "Thumbnail Length");
     384        _tagNameMap.put(TAG_PREVIEW_IMAGE_VALID, "Preview Image Valid");
     385        _tagNameMap.put(TAG_PREVIEW_IMAGE_START, "Preview Image Start");
     386        _tagNameMap.put(TAG_PREVIEW_IMAGE_LENGTH, "Preview Image Length");
     387        _tagNameMap.put(TAG_AF_RESULT, "AF Result");
    363388        _tagNameMap.put(TAG_CCD_SCAN_MODE, "CCD Scan Mode");
    364389        _tagNameMap.put(TAG_NOISE_REDUCTION, "Noise Reduction");
    365390        _tagNameMap.put(TAG_INFINITY_LENS_STEP, "Infinity Lens Step");
    366391        _tagNameMap.put(TAG_NEAR_LENS_STEP, "Near Lens Step");
     392        _tagNameMap.put(TAG_LIGHT_VALUE_CENTER, "Light Value Center");
     393        _tagNameMap.put(TAG_LIGHT_VALUE_PERIPHERY, "Light Value Periphery");
     394        _tagNameMap.put(TAG_FIELD_COUNT, "Field Count");
    367395        _tagNameMap.put(TAG_EQUIPMENT, "Equipment");
    368396        _tagNameMap.put(TAG_CAMERA_SETTINGS, "Camera Settings");
     
    372400        _tagNameMap.put(TAG_FOCUS_INFO, "Focus Info");
    373401        _tagNameMap.put(TAG_RAW_INFO, "Raw Info");
     402        _tagNameMap.put(TAG_MAIN_INFO, "Main Info");
    374403
    375404        _tagNameMap.put(CameraSettings.TAG_EXPOSURE_MODE, "Exposure Mode");
     
    476505        return _tagNameMap;
    477506    }
     507
     508    // <summary>
     509    // These values are currently decoded only for Olympus models.  Models with
     510    // Olympus-style maker notes from other brands such as Acer, BenQ, Hitachi, HP,
     511    // Premier, Konica-Minolta, Maginon, Ricoh, Rollei, SeaLife, Sony, Supra,
     512    // Vivitar are not listed.
     513    // </summary>
     514    // <remarks>
     515    // Converted from Exiftool version 10.33 created by Phil Harvey
     516    // http://www.sno.phy.queensu.ca/~phil/exiftool/
     517    // lib\Image\ExifTool\Olympus.pm
     518    // </remarks>
     519    public static final HashMap<String, String> OlympusCameraTypes = new HashMap<String, String>();
     520
     521    static {
     522        OlympusCameraTypes.put("D4028", "X-2,C-50Z");
     523        OlympusCameraTypes.put("D4029", "E-20,E-20N,E-20P");
     524        OlympusCameraTypes.put("D4034", "C720UZ");
     525        OlympusCameraTypes.put("D4040", "E-1");
     526        OlympusCameraTypes.put("D4041", "E-300");
     527        OlympusCameraTypes.put("D4083", "C2Z,D520Z,C220Z");
     528        OlympusCameraTypes.put("D4106", "u20D,S400D,u400D");
     529        OlympusCameraTypes.put("D4120", "X-1");
     530        OlympusCameraTypes.put("D4122", "u10D,S300D,u300D");
     531        OlympusCameraTypes.put("D4125", "AZ-1");
     532        OlympusCameraTypes.put("D4141", "C150,D390");
     533        OlympusCameraTypes.put("D4193", "C-5000Z");
     534        OlympusCameraTypes.put("D4194", "X-3,C-60Z");
     535        OlympusCameraTypes.put("D4199", "u30D,S410D,u410D");
     536        OlympusCameraTypes.put("D4205", "X450,D535Z,C370Z");
     537        OlympusCameraTypes.put("D4210", "C160,D395");
     538        OlympusCameraTypes.put("D4211", "C725UZ");
     539        OlympusCameraTypes.put("D4213", "FerrariMODEL2003");
     540        OlympusCameraTypes.put("D4216", "u15D");
     541        OlympusCameraTypes.put("D4217", "u25D");
     542        OlympusCameraTypes.put("D4220", "u-miniD,Stylus V");
     543        OlympusCameraTypes.put("D4221", "u40D,S500,uD500");
     544        OlympusCameraTypes.put("D4231", "FerrariMODEL2004");
     545        OlympusCameraTypes.put("D4240", "X500,D590Z,C470Z");
     546        OlympusCameraTypes.put("D4244", "uD800,S800");
     547        OlympusCameraTypes.put("D4256", "u720SW,S720SW");
     548        OlympusCameraTypes.put("D4261", "X600,D630,FE5500");
     549        OlympusCameraTypes.put("D4262", "uD600,S600");
     550        OlympusCameraTypes.put("D4301", "u810/S810"); // (yes, "/".  Olympus is not consistent in the notation)
     551        OlympusCameraTypes.put("D4302", "u710,S710");
     552        OlympusCameraTypes.put("D4303", "u700,S700");
     553        OlympusCameraTypes.put("D4304", "FE100,X710");
     554        OlympusCameraTypes.put("D4305", "FE110,X705");
     555        OlympusCameraTypes.put("D4310", "FE-130,X-720");
     556        OlympusCameraTypes.put("D4311", "FE-140,X-725");
     557        OlympusCameraTypes.put("D4312", "FE150,X730");
     558        OlympusCameraTypes.put("D4313", "FE160,X735");
     559        OlympusCameraTypes.put("D4314", "u740,S740");
     560        OlympusCameraTypes.put("D4315", "u750,S750");
     561        OlympusCameraTypes.put("D4316", "u730/S730");
     562        OlympusCameraTypes.put("D4317", "FE115,X715");
     563        OlympusCameraTypes.put("D4321", "SP550UZ");
     564        OlympusCameraTypes.put("D4322", "SP510UZ");
     565        OlympusCameraTypes.put("D4324", "FE170,X760");
     566        OlympusCameraTypes.put("D4326", "FE200");
     567        OlympusCameraTypes.put("D4327", "FE190/X750"); // (also SX876)
     568        OlympusCameraTypes.put("D4328", "u760,S760");
     569        OlympusCameraTypes.put("D4330", "FE180/X745"); // (also SX875)
     570        OlympusCameraTypes.put("D4331", "u1000/S1000");
     571        OlympusCameraTypes.put("D4332", "u770SW,S770SW");
     572        OlympusCameraTypes.put("D4333", "FE240/X795");
     573        OlympusCameraTypes.put("D4334", "FE210,X775");
     574        OlympusCameraTypes.put("D4336", "FE230/X790");
     575        OlympusCameraTypes.put("D4337", "FE220,X785");
     576        OlympusCameraTypes.put("D4338", "u725SW,S725SW");
     577        OlympusCameraTypes.put("D4339", "FE250/X800");
     578        OlympusCameraTypes.put("D4341", "u780,S780");
     579        OlympusCameraTypes.put("D4343", "u790SW,S790SW");
     580        OlympusCameraTypes.put("D4344", "u1020,S1020");
     581        OlympusCameraTypes.put("D4346", "FE15,X10");
     582        OlympusCameraTypes.put("D4348", "FE280,X820,C520");
     583        OlympusCameraTypes.put("D4349", "FE300,X830");
     584        OlympusCameraTypes.put("D4350", "u820,S820");
     585        OlympusCameraTypes.put("D4351", "u1200,S1200");
     586        OlympusCameraTypes.put("D4352", "FE270,X815,C510");
     587        OlympusCameraTypes.put("D4353", "u795SW,S795SW");
     588        OlympusCameraTypes.put("D4354", "u1030SW,S1030SW");
     589        OlympusCameraTypes.put("D4355", "SP560UZ");
     590        OlympusCameraTypes.put("D4356", "u1010,S1010");
     591        OlympusCameraTypes.put("D4357", "u830,S830");
     592        OlympusCameraTypes.put("D4359", "u840,S840");
     593        OlympusCameraTypes.put("D4360", "FE350WIDE,X865");
     594        OlympusCameraTypes.put("D4361", "u850SW,S850SW");
     595        OlympusCameraTypes.put("D4362", "FE340,X855,C560");
     596        OlympusCameraTypes.put("D4363", "FE320,X835,C540");
     597        OlympusCameraTypes.put("D4364", "SP570UZ");
     598        OlympusCameraTypes.put("D4366", "FE330,X845,C550");
     599        OlympusCameraTypes.put("D4368", "FE310,X840,C530");
     600        OlympusCameraTypes.put("D4370", "u1050SW,S1050SW");
     601        OlympusCameraTypes.put("D4371", "u1060,S1060");
     602        OlympusCameraTypes.put("D4372", "FE370,X880,C575");
     603        OlympusCameraTypes.put("D4374", "SP565UZ");
     604        OlympusCameraTypes.put("D4377", "u1040,S1040");
     605        OlympusCameraTypes.put("D4378", "FE360,X875,C570");
     606        OlympusCameraTypes.put("D4379", "FE20,X15,C25");
     607        OlympusCameraTypes.put("D4380", "uT6000,ST6000");
     608        OlympusCameraTypes.put("D4381", "uT8000,ST8000");
     609        OlympusCameraTypes.put("D4382", "u9000,S9000");
     610        OlympusCameraTypes.put("D4384", "SP590UZ");
     611        OlympusCameraTypes.put("D4385", "FE3010,X895");
     612        OlympusCameraTypes.put("D4386", "FE3000,X890");
     613        OlympusCameraTypes.put("D4387", "FE35,X30");
     614        OlympusCameraTypes.put("D4388", "u550WP,S550WP");
     615        OlympusCameraTypes.put("D4390", "FE5000,X905");
     616        OlympusCameraTypes.put("D4391", "u5000");
     617        OlympusCameraTypes.put("D4392", "u7000,S7000");
     618        OlympusCameraTypes.put("D4396", "FE5010,X915");
     619        OlympusCameraTypes.put("D4397", "FE25,X20");
     620        OlympusCameraTypes.put("D4398", "FE45,X40");
     621        OlympusCameraTypes.put("D4401", "XZ-1");
     622        OlympusCameraTypes.put("D4402", "uT6010,ST6010");
     623        OlympusCameraTypes.put("D4406", "u7010,S7010 / u7020,S7020");
     624        OlympusCameraTypes.put("D4407", "FE4010,X930");
     625        OlympusCameraTypes.put("D4408", "X560WP");
     626        OlympusCameraTypes.put("D4409", "FE26,X21");
     627        OlympusCameraTypes.put("D4410", "FE4000,X920,X925");
     628        OlympusCameraTypes.put("D4411", "FE46,X41,X42");
     629        OlympusCameraTypes.put("D4412", "FE5020,X935");
     630        OlympusCameraTypes.put("D4413", "uTough-3000");
     631        OlympusCameraTypes.put("D4414", "StylusTough-6020");
     632        OlympusCameraTypes.put("D4415", "StylusTough-8010");
     633        OlympusCameraTypes.put("D4417", "u5010,S5010");
     634        OlympusCameraTypes.put("D4418", "u7040,S7040");
     635        OlympusCameraTypes.put("D4419", "u9010,S9010");
     636        OlympusCameraTypes.put("D4423", "FE4040");
     637        OlympusCameraTypes.put("D4424", "FE47,X43");
     638        OlympusCameraTypes.put("D4426", "FE4030,X950");
     639        OlympusCameraTypes.put("D4428", "FE5030,X965,X960");
     640        OlympusCameraTypes.put("D4430", "u7030,S7030");
     641        OlympusCameraTypes.put("D4432", "SP600UZ");
     642        OlympusCameraTypes.put("D4434", "SP800UZ");
     643        OlympusCameraTypes.put("D4439", "FE4020,X940");
     644        OlympusCameraTypes.put("D4442", "FE5035");
     645        OlympusCameraTypes.put("D4448", "FE4050,X970");
     646        OlympusCameraTypes.put("D4450", "FE5050,X985");
     647        OlympusCameraTypes.put("D4454", "u-7050");
     648        OlympusCameraTypes.put("D4464", "T10,X27");
     649        OlympusCameraTypes.put("D4470", "FE5040,X980");
     650        OlympusCameraTypes.put("D4472", "TG-310");
     651        OlympusCameraTypes.put("D4474", "TG-610");
     652        OlympusCameraTypes.put("D4476", "TG-810");
     653        OlympusCameraTypes.put("D4478", "VG145,VG140,D715");
     654        OlympusCameraTypes.put("D4479", "VG130,D710");
     655        OlympusCameraTypes.put("D4480", "VG120,D705");
     656        OlympusCameraTypes.put("D4482", "VR310,D720");
     657        OlympusCameraTypes.put("D4484", "VR320,D725");
     658        OlympusCameraTypes.put("D4486", "VR330,D730");
     659        OlympusCameraTypes.put("D4488", "VG110,D700");
     660        OlympusCameraTypes.put("D4490", "SP-610UZ");
     661        OlympusCameraTypes.put("D4492", "SZ-10");
     662        OlympusCameraTypes.put("D4494", "SZ-20");
     663        OlympusCameraTypes.put("D4496", "SZ-30MR");
     664        OlympusCameraTypes.put("D4498", "SP-810UZ");
     665        OlympusCameraTypes.put("D4500", "SZ-11");
     666        OlympusCameraTypes.put("D4504", "TG-615");
     667        OlympusCameraTypes.put("D4508", "TG-620");
     668        OlympusCameraTypes.put("D4510", "TG-820");
     669        OlympusCameraTypes.put("D4512", "TG-1");
     670        OlympusCameraTypes.put("D4516", "SH-21");
     671        OlympusCameraTypes.put("D4519", "SZ-14");
     672        OlympusCameraTypes.put("D4520", "SZ-31MR");
     673        OlympusCameraTypes.put("D4521", "SH-25MR");
     674        OlympusCameraTypes.put("D4523", "SP-720UZ");
     675        OlympusCameraTypes.put("D4529", "VG170");
     676        OlympusCameraTypes.put("D4531", "XZ-2");
     677        OlympusCameraTypes.put("D4535", "SP-620UZ");
     678        OlympusCameraTypes.put("D4536", "TG-320");
     679        OlympusCameraTypes.put("D4537", "VR340,D750");
     680        OlympusCameraTypes.put("D4538", "VG160,X990,D745");
     681        OlympusCameraTypes.put("D4541", "SZ-12");
     682        OlympusCameraTypes.put("D4545", "VH410");
     683        OlympusCameraTypes.put("D4546", "XZ-10"); //IB
     684        OlympusCameraTypes.put("D4547", "TG-2");
     685        OlympusCameraTypes.put("D4548", "TG-830");
     686        OlympusCameraTypes.put("D4549", "TG-630");
     687        OlympusCameraTypes.put("D4550", "SH-50");
     688        OlympusCameraTypes.put("D4553", "SZ-16,DZ-105");
     689        OlympusCameraTypes.put("D4562", "SP-820UZ");
     690        OlympusCameraTypes.put("D4566", "SZ-15");
     691        OlympusCameraTypes.put("D4572", "STYLUS1");
     692        OlympusCameraTypes.put("D4574", "TG-3");
     693        OlympusCameraTypes.put("D4575", "TG-850");
     694        OlympusCameraTypes.put("D4579", "SP-100EE");
     695        OlympusCameraTypes.put("D4580", "SH-60");
     696        OlympusCameraTypes.put("D4581", "SH-1");
     697        OlympusCameraTypes.put("D4582", "TG-835");
     698        OlympusCameraTypes.put("D4585", "SH-2 / SH-3");
     699        OlympusCameraTypes.put("D4586", "TG-4");
     700        OlympusCameraTypes.put("D4587", "TG-860");
     701        OlympusCameraTypes.put("D4591", "TG-870");
     702        OlympusCameraTypes.put("D4809", "C2500L");
     703        OlympusCameraTypes.put("D4842", "E-10");
     704        OlympusCameraTypes.put("D4856", "C-1");
     705        OlympusCameraTypes.put("D4857", "C-1Z,D-150Z");
     706        OlympusCameraTypes.put("DCHC", "D500L");
     707        OlympusCameraTypes.put("DCHT", "D600L / D620L");
     708        OlympusCameraTypes.put("K0055", "AIR-A01");
     709        OlympusCameraTypes.put("S0003", "E-330");
     710        OlympusCameraTypes.put("S0004", "E-500");
     711        OlympusCameraTypes.put("S0009", "E-400");
     712        OlympusCameraTypes.put("S0010", "E-510");
     713        OlympusCameraTypes.put("S0011", "E-3");
     714        OlympusCameraTypes.put("S0013", "E-410");
     715        OlympusCameraTypes.put("S0016", "E-420");
     716        OlympusCameraTypes.put("S0017", "E-30");
     717        OlympusCameraTypes.put("S0018", "E-520");
     718        OlympusCameraTypes.put("S0019", "E-P1");
     719        OlympusCameraTypes.put("S0023", "E-620");
     720        OlympusCameraTypes.put("S0026", "E-P2");
     721        OlympusCameraTypes.put("S0027", "E-PL1");
     722        OlympusCameraTypes.put("S0029", "E-450");
     723        OlympusCameraTypes.put("S0030", "E-600");
     724        OlympusCameraTypes.put("S0032", "E-P3");
     725        OlympusCameraTypes.put("S0033", "E-5");
     726        OlympusCameraTypes.put("S0034", "E-PL2");
     727        OlympusCameraTypes.put("S0036", "E-M5");
     728        OlympusCameraTypes.put("S0038", "E-PL3");
     729        OlympusCameraTypes.put("S0039", "E-PM1");
     730        OlympusCameraTypes.put("S0040", "E-PL1s");
     731        OlympusCameraTypes.put("S0042", "E-PL5");
     732        OlympusCameraTypes.put("S0043", "E-PM2");
     733        OlympusCameraTypes.put("S0044", "E-P5");
     734        OlympusCameraTypes.put("S0045", "E-PL6");
     735        OlympusCameraTypes.put("S0046", "E-PL7"); //IB
     736        OlympusCameraTypes.put("S0047", "E-M1");
     737        OlympusCameraTypes.put("S0051", "E-M10");
     738        OlympusCameraTypes.put("S0052", "E-M5MarkII"); //IB
     739        OlympusCameraTypes.put("S0059", "E-M10MarkII");
     740        OlympusCameraTypes.put("S0061", "PEN-F"); //forum7005
     741        OlympusCameraTypes.put("S0065", "E-PL8");
     742        OlympusCameraTypes.put("S0067", "E-M1MarkII");
     743        OlympusCameraTypes.put("SR45", "D220");
     744        OlympusCameraTypes.put("SR55", "D320L");
     745        OlympusCameraTypes.put("SR83", "D340L");
     746        OlympusCameraTypes.put("SR85", "C830L,D340R");
     747        OlympusCameraTypes.put("SR852", "C860L,D360L");
     748        OlympusCameraTypes.put("SR872", "C900Z,D400Z");
     749        OlympusCameraTypes.put("SR874", "C960Z,D460Z");
     750        OlympusCameraTypes.put("SR951", "C2000Z");
     751        OlympusCameraTypes.put("SR952", "C21");
     752        OlympusCameraTypes.put("SR953", "C21T.commu");
     753        OlympusCameraTypes.put("SR954", "C2020Z");
     754        OlympusCameraTypes.put("SR955", "C990Z,D490Z");
     755        OlympusCameraTypes.put("SR956", "C211Z");
     756        OlympusCameraTypes.put("SR959", "C990ZS,D490Z");
     757        OlympusCameraTypes.put("SR95A", "C2100UZ");
     758        OlympusCameraTypes.put("SR971", "C100,D370");
     759        OlympusCameraTypes.put("SR973", "C2,D230");
     760        OlympusCameraTypes.put("SX151", "E100RS");
     761        OlympusCameraTypes.put("SX351", "C3000Z / C3030Z");
     762        OlympusCameraTypes.put("SX354", "C3040Z");
     763        OlympusCameraTypes.put("SX355", "C2040Z");
     764        OlympusCameraTypes.put("SX357", "C700UZ");
     765        OlympusCameraTypes.put("SX358", "C200Z,D510Z");
     766        OlympusCameraTypes.put("SX374", "C3100Z,C3020Z");
     767        OlympusCameraTypes.put("SX552", "C4040Z");
     768        OlympusCameraTypes.put("SX553", "C40Z,D40Z");
     769        OlympusCameraTypes.put("SX556", "C730UZ");
     770        OlympusCameraTypes.put("SX558", "C5050Z");
     771        OlympusCameraTypes.put("SX571", "C120,D380");
     772        OlympusCameraTypes.put("SX574", "C300Z,D550Z");
     773        OlympusCameraTypes.put("SX575", "C4100Z,C4000Z");
     774        OlympusCameraTypes.put("SX751", "X200,D560Z,C350Z");
     775        OlympusCameraTypes.put("SX752", "X300,D565Z,C450Z");
     776        OlympusCameraTypes.put("SX753", "C750UZ");
     777        OlympusCameraTypes.put("SX754", "C740UZ");
     778        OlympusCameraTypes.put("SX755", "C755UZ");
     779        OlympusCameraTypes.put("SX756", "C5060WZ");
     780        OlympusCameraTypes.put("SX757", "C8080WZ");
     781        OlympusCameraTypes.put("SX758", "X350,D575Z,C360Z");
     782        OlympusCameraTypes.put("SX759", "X400,D580Z,C460Z");
     783        OlympusCameraTypes.put("SX75A", "AZ-2ZOOM");
     784        OlympusCameraTypes.put("SX75B", "D595Z,C500Z");
     785        OlympusCameraTypes.put("SX75C", "X550,D545Z,C480Z");
     786        OlympusCameraTypes.put("SX75D", "IR-300");
     787        OlympusCameraTypes.put("SX75F", "C55Z,C5500Z");
     788        OlympusCameraTypes.put("SX75G", "C170,D425");
     789        OlympusCameraTypes.put("SX75J", "C180,D435");
     790        OlympusCameraTypes.put("SX771", "C760UZ");
     791        OlympusCameraTypes.put("SX772", "C770UZ");
     792        OlympusCameraTypes.put("SX773", "C745UZ");
     793        OlympusCameraTypes.put("SX774", "X250,D560Z,C350Z");
     794        OlympusCameraTypes.put("SX775", "X100,D540Z,C310Z");
     795        OlympusCameraTypes.put("SX776", "C460ZdelSol");
     796        OlympusCameraTypes.put("SX777", "C765UZ");
     797        OlympusCameraTypes.put("SX77A", "D555Z,C315Z");
     798        OlympusCameraTypes.put("SX851", "C7070WZ");
     799        OlympusCameraTypes.put("SX852", "C70Z,C7000Z");
     800        OlympusCameraTypes.put("SX853", "SP500UZ");
     801        OlympusCameraTypes.put("SX854", "SP310");
     802        OlympusCameraTypes.put("SX855", "SP350");
     803        OlympusCameraTypes.put("SX873", "SP320");
     804        OlympusCameraTypes.put("SX875", "FE180/X745"); // (also D4330)
     805        OlympusCameraTypes.put("SX876", "FE190/X750"); // (also D4327)
     806
     807        //   other brands
     808        //    4MP9Q3", "Camera 4MP-9Q3'
     809        //    4MP9T2", "BenQ DC C420 / Camera 4MP-9T2'
     810        //    5MP9Q3", "Camera 5MP-9Q3" },
     811        //    5MP9X9", "Camera 5MP-9X9" },
     812        //   '5MP-9T'=> 'Camera 5MP-9T3" },
     813        //   '5MP-9Y'=> 'Camera 5MP-9Y2" },
     814        //   '6MP-9U'=> 'Camera 6MP-9U9" },
     815        //    7MP9Q3", "Camera 7MP-9Q3" },
     816        //   '8MP-9U'=> 'Camera 8MP-9U4" },
     817        //    CE5330", "Acer CE-5330" },
     818        //   'CP-853'=> 'Acer CP-8531" },
     819        //    CS5531", "Acer CS5531" },
     820        //    DC500 ", "SeaLife DC500" },
     821        //    DC7370", "Camera 7MP-9GA" },
     822        //    DC7371", "Camera 7MP-9GM" },
     823        //    DC7371", "Hitachi HDC-751E" },
     824        //    DC7375", "Hitachi HDC-763E / Rollei RCP-7330X / Ricoh Caplio RR770 / Vivitar ViviCam 7330" },
     825        //   'DC E63'=> 'BenQ DC E63+" },
     826        //   'DC P86'=> 'BenQ DC P860" },
     827        //    DS5340", "Maginon Performic S5 / Premier 5MP-9M7" },
     828        //    DS5341", "BenQ E53+ / Supra TCM X50 / Maginon X50 / Premier 5MP-9P8" },
     829        //    DS5346", "Premier 5MP-9Q2" },
     830        //    E500  ", "Konica Minolta DiMAGE E500" },
     831        //    MAGINO", "Maginon X60" },
     832        //    Mz60  ", "HP Photosmart Mz60" },
     833        //    Q3DIGI", "Camera 5MP-9Q3" },
     834        //    SLIMLI", "Supra Slimline X6" },
     835        //    V8300s", "Vivitar V8300s" },
     836    }
    478837}
  • trunk/src/com/drew/metadata/exif/makernotes/PanasonicMakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    2222
    2323import com.drew.lang.ByteArrayReader;
     24import com.drew.lang.Charsets;
    2425import com.drew.lang.RandomAccessReader;
    2526import com.drew.lang.annotations.NotNull;
     
    2930import com.drew.metadata.TagDescriptor;
    3031
     32import java.text.DecimalFormat;
    3133import java.io.IOException;
    3234
     
    4547 * @author Philipp Sandhaus
    4648 */
     49@SuppressWarnings("WeakerAccess")
    4750public class PanasonicMakernoteDescriptor extends TagDescriptor<PanasonicMakernoteDirectory>
    4851{
     
    109112            case TAG_TRANSFORM:
    110113                return getTransformDescription();
    111                         case TAG_TRANSFORM_1:
    112                     return getTransform1Description();
     114            case TAG_TRANSFORM_1:
     115                return getTransform1Description();
    113116            case TAG_INTELLIGENT_EXPOSURE:
    114117                return getIntelligentExposureDescription();
     
    127130            case TAG_FACE_RECOGNITION_INFO:
    128131                return getRecognizedFacesDescription();
    129             case TAG_PRINT_IMAGE_MATCHING_INFO:
    130                 return getPrintImageMatchingInfoDescription();
    131132            case TAG_SCENE_MODE:
    132133                return getSceneModeDescription();
     
    134135                return getFlashFiredDescription();
    135136            case TAG_TEXT_STAMP:
    136                         return getTextStampDescription();
    137                         case TAG_TEXT_STAMP_1:
    138                      return getTextStamp1Description();
    139                         case TAG_TEXT_STAMP_2:
    140                          return getTextStamp2Description();
    141                         case TAG_TEXT_STAMP_3:
    142                              return getTextStamp3Description();
     137                return getTextStampDescription();
     138            case TAG_TEXT_STAMP_1:
     139                return getTextStamp1Description();
     140            case TAG_TEXT_STAMP_2:
     141                return getTextStamp2Description();
     142            case TAG_TEXT_STAMP_3:
     143                return getTextStamp3Description();
    143144            case TAG_MAKERNOTE_VERSION:
    144145                return getMakernoteVersionDescription();
     
    148149                return getInternalSerialNumberDescription();
    149150            case TAG_TITLE:
    150                     return getTitleDescription();
    151                         case TAG_BABY_NAME:
    152                     return getBabyNameDescription();
    153                         case TAG_LOCATION:
    154                     return getLocationDescription();
    155                         case TAG_BABY_AGE:
    156                         return getBabyAgeDescription();
    157                         case TAG_BABY_AGE_1:
    158                         return getBabyAge1Description();
    159                         default:
     151                return getTitleDescription();
     152            case TAG_BRACKET_SETTINGS:
     153                return getBracketSettingsDescription();
     154            case TAG_FLASH_CURTAIN:
     155                return getFlashCurtainDescription();
     156            case TAG_LONG_EXPOSURE_NOISE_REDUCTION:
     157                return getLongExposureNoiseReductionDescription();
     158            case TAG_BABY_NAME:
     159                return getBabyNameDescription();
     160            case TAG_LOCATION:
     161                return getLocationDescription();
     162
     163            case TAG_LENS_FIRMWARE_VERSION:
     164                return getLensFirmwareVersionDescription();
     165            case TAG_INTELLIGENT_D_RANGE:
     166                return getIntelligentDRangeDescription();
     167            case TAG_CLEAR_RETOUCH:
     168                return getClearRetouchDescription();
     169            case TAG_PHOTO_STYLE:
     170                return getPhotoStyleDescription();
     171            case TAG_SHADING_COMPENSATION:
     172                return getShadingCompensationDescription();
     173
     174            case TAG_ACCELEROMETER_Z:
     175                return getAccelerometerZDescription();
     176            case TAG_ACCELEROMETER_X:
     177                return getAccelerometerXDescription();
     178            case TAG_ACCELEROMETER_Y:
     179                return getAccelerometerYDescription();
     180            case TAG_CAMERA_ORIENTATION:
     181                return getCameraOrientationDescription();
     182            case TAG_ROLL_ANGLE:
     183                return getRollAngleDescription();
     184            case TAG_PITCH_ANGLE:
     185                return getPitchAngleDescription();
     186            case TAG_SWEEP_PANORAMA_DIRECTION:
     187                return getSweepPanoramaDirectionDescription();
     188            case TAG_TIMER_RECORDING:
     189                return getTimerRecordingDescription();
     190            case TAG_HDR:
     191                return getHDRDescription();
     192            case TAG_SHUTTER_TYPE:
     193                return getShutterTypeDescription();
     194            case TAG_TOUCH_AE:
     195                return getTouchAeDescription();
     196
     197            case TAG_BABY_AGE:
     198                return getBabyAgeDescription();
     199            case TAG_BABY_AGE_1:
     200                return getBabyAge1Description();
     201            default:
    160202                return super.getDescription(tagType);
    161203        }
    162     }
    163 
    164     @Nullable
    165     public String getPrintImageMatchingInfoDescription()
    166     {
    167         return getByteLengthDescription(TAG_PRINT_IMAGE_MATCHING_INFO);
    168204    }
    169205
     
    279315
    280316    @Nullable
     317    private static String trim(@Nullable String s)
     318    {
     319        return s == null ? null : s.trim();
     320    }
     321
     322    @Nullable
    281323    public String getCountryDescription()
    282324    {
    283         return getAsciiStringFromBytes(TAG_COUNTRY);
     325        return trim(getStringFromBytes(TAG_COUNTRY, Charsets.UTF_8));
    284326    }
    285327
     
    287329    public String getStateDescription()
    288330    {
    289         return getAsciiStringFromBytes(TAG_STATE);
     331        return trim(getStringFromBytes(TAG_STATE, Charsets.UTF_8));
    290332    }
    291333
     
    293335    public String getCityDescription()
    294336    {
    295         return getAsciiStringFromBytes(TAG_CITY);
     337        return trim(getStringFromBytes(TAG_CITY, Charsets.UTF_8));
    296338    }
    297339
     
    299341    public String getLandmarkDescription()
    300342    {
    301         return getAsciiStringFromBytes(TAG_LANDMARK);
    302     }
    303 
    304         @Nullable
     343        return trim(getStringFromBytes(TAG_LANDMARK, Charsets.UTF_8));
     344    }
     345
     346    @Nullable
    305347    public String getTitleDescription()
    306348    {
    307         return getAsciiStringFromBytes(TAG_TITLE);
    308     }
    309 
    310         @Nullable
     349        return trim(getStringFromBytes(TAG_TITLE, Charsets.UTF_8));
     350    }
     351
     352    @Nullable
     353    public String getBracketSettingsDescription()
     354    {
     355        return getIndexedDescription(TAG_BRACKET_SETTINGS,
     356            "No Bracket", "3 Images, Sequence 0/-/+", "3 Images, Sequence -/0/+", "5 Images, Sequence 0/-/+",
     357            "5 Images, Sequence -/0/+", "7 Images, Sequence 0/-/+", "7 Images, Sequence -/0/+");
     358    }
     359
     360    @Nullable
     361    public String getFlashCurtainDescription()
     362    {
     363        return getIndexedDescription(TAG_FLASH_CURTAIN,
     364            "n/a", "1st", "2nd");
     365    }
     366
     367    @Nullable
     368    public String getLongExposureNoiseReductionDescription()
     369    {
     370        return getIndexedDescription(TAG_LONG_EXPOSURE_NOISE_REDUCTION, 1,
     371            "Off", "On");
     372    }
     373
     374    @Nullable
     375    public String getLensFirmwareVersionDescription()
     376    {
     377        // lens version has 4 parts separated by periods
     378        byte[] bytes = _directory.getByteArray(TAG_LENS_FIRMWARE_VERSION);
     379        if (bytes == null)
     380            return null;
     381
     382        StringBuilder sb = new StringBuilder();
     383        for (int i = 0; i < bytes.length; i++) {
     384            sb.append(bytes[i]);
     385            if (i < bytes.length - 1)
     386                sb.append(".");
     387        }
     388        return sb.toString();
     389        //return string.Join(".", bytes.Select(b => b.ToString()).ToArray());
     390    }
     391
     392    @Nullable
     393    public String getIntelligentDRangeDescription()
     394    {
     395        return getIndexedDescription(TAG_INTELLIGENT_D_RANGE,
     396            "Off", "Low", "Standard", "High");
     397    }
     398
     399    @Nullable
     400    public String getClearRetouchDescription()
     401    {
     402        return getIndexedDescription(TAG_CLEAR_RETOUCH,
     403                "Off", "On");
     404
     405    }
     406
     407    @Nullable
     408    public String getPhotoStyleDescription()
     409    {
     410        return getIndexedDescription(TAG_PHOTO_STYLE,
     411            "Auto", "Standard or Custom", "Vivid", "Natural", "Monochrome", "Scenery", "Portrait");
     412    }
     413
     414    @Nullable
     415    public String getShadingCompensationDescription()
     416    {
     417        return getIndexedDescription(TAG_SHADING_COMPENSATION,
     418            "Off", "On");
     419    }
     420
     421    @Nullable
     422    public String getAccelerometerZDescription()
     423    {
     424        Integer value = _directory.getInteger(TAG_ACCELEROMETER_Z);
     425        if (value == null)
     426            return null;
     427
     428        // positive is acceleration upwards
     429        return String.valueOf(value.shortValue());
     430    }
     431
     432    @Nullable
     433    public String getAccelerometerXDescription()
     434    {
     435        Integer value = _directory.getInteger(TAG_ACCELEROMETER_X);
     436        if (value == null)
     437            return null;
     438
     439        // positive is acceleration to the left
     440        return String.valueOf(value.shortValue());
     441    }
     442
     443    @Nullable
     444    public String getAccelerometerYDescription()
     445    {
     446        Integer value = _directory.getInteger(TAG_ACCELEROMETER_Y);
     447        if (value == null)
     448            return null;
     449
     450        // positive is acceleration backwards
     451        return String.valueOf(value.shortValue());
     452    }
     453
     454    @Nullable
     455    public String getCameraOrientationDescription()
     456    {
     457        return getIndexedDescription(TAG_CAMERA_ORIENTATION,
     458                "Normal", "Rotate CW", "Rotate 180", "Rotate CCW", "Tilt Upwards", "Tile Downwards");
     459    }
     460
     461    @Nullable
     462    public String getRollAngleDescription()
     463    {
     464        Integer value = _directory.getInteger(TAG_ROLL_ANGLE);
     465        if (value == null)
     466            return null;
     467
     468        DecimalFormat format = new DecimalFormat("0.#");
     469        // converted to degrees of clockwise camera rotation
     470        return format.format(value.shortValue() / 10.0);
     471    }
     472
     473    @Nullable
     474    public String getPitchAngleDescription()
     475    {
     476        Integer value = _directory.getInteger(TAG_PITCH_ANGLE);
     477        if (value == null)
     478            return null;
     479
     480        DecimalFormat format = new DecimalFormat("0.#");
     481        // converted to degrees of upward camera tilt
     482        return format.format(-value.shortValue() / 10.0);
     483    }
     484
     485    @Nullable
     486    public String getSweepPanoramaDirectionDescription()
     487    {
     488        return getIndexedDescription(TAG_SWEEP_PANORAMA_DIRECTION,
     489                "Off", "Left to Right", "Right to Left", "Top to Bottom", "Bottom to Top");
     490    }
     491
     492    @Nullable
     493    public String getTimerRecordingDescription()
     494    {
     495        return getIndexedDescription(TAG_TIMER_RECORDING,
     496                "Off", "Time Lapse", "Stop-motion Animation");
     497    }
     498
     499    @Nullable
     500    public String getHDRDescription()
     501    {
     502        Integer value = _directory.getInteger(TAG_HDR);
     503        if (value == null)
     504            return null;
     505
     506        switch (value)
     507        {
     508            case 0:
     509                return "Off";
     510            case 100:
     511                return "1 EV";
     512            case 200:
     513                return "2 EV";
     514            case 300:
     515                return "3 EV";
     516            case 32868:
     517                return "1 EV (Auto)";
     518            case 32968:
     519                return "2 EV (Auto)";
     520            case 33068:
     521                return "3 EV (Auto)";
     522            default:
     523                return String.format("Unknown (%d)", value);
     524        }
     525    }
     526
     527    @Nullable
     528    public String getShutterTypeDescription()
     529    {
     530        return getIndexedDescription(TAG_SHUTTER_TYPE,
     531                "Mechanical", "Electronic", "Hybrid");
     532    }
     533
     534    @Nullable
     535    public String getTouchAeDescription()
     536    {
     537        return getIndexedDescription(TAG_TOUCH_AE,
     538                "Off", "On");
     539    }
     540
     541    @Nullable
    311542    public String getBabyNameDescription()
    312543    {
    313         return getAsciiStringFromBytes(TAG_BABY_NAME);
     544        return trim(getStringFromBytes(TAG_BABY_NAME, Charsets.UTF_8));
    314545    }
    315546
     
    317548    public String getLocationDescription()
    318549    {
    319         return getAsciiStringFromBytes(TAG_LOCATION);
     550        return trim(getStringFromBytes(TAG_LOCATION, Charsets.UTF_8));
    320551    }
    321552
  • trunk/src/com/drew/metadata/exif/makernotes/PanasonicMakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3838 * @author Philipp Sandhaus
    3939 */
     40@SuppressWarnings("WeakerAccess")
    4041public class PanasonicMakernoteDirectory extends Directory
    4142{
     
    354355    public static final int TAG_FILM_MODE = 0x0042;
    355356
    356     /**
    357          * WB adjust AB. Positive is a shift toward blue.
    358          */
    359         public static final int TAG_WB_ADJUST_AB = 0x0046;
    360     /**
    361          * WB adjust GM. Positive is a shift toward green.
    362          */
    363         public static final int TAG_WB_ADJUST_GM = 0x0047;
    364 
    365 
     357    public static final int TAG_COLOR_TEMP_KELVIN = 0x0044;
     358    public static final int TAG_BRACKET_SETTINGS = 0x0045;
     359
     360    /**
     361    * WB adjust AB. Positive is a shift toward blue.
     362    */
     363    public static final int TAG_WB_ADJUST_AB = 0x0046;
     364    /**
     365    * WB adjust GM. Positive is a shift toward green.
     366    */
     367    public static final int TAG_WB_ADJUST_GM = 0x0047;
     368
     369    public static final int TAG_FLASH_CURTAIN = 0x0048;
     370    public static final int TAG_LONG_EXPOSURE_NOISE_REDUCTION = 0x0049;
     371
     372    public static final int TAG_PANASONIC_IMAGE_WIDTH = 0x004b;
     373    public static final int TAG_PANASONIC_IMAGE_HEIGHT = 0x004c;
    366374    public static final int TAG_AF_POINT_POSITION = 0x004d;
    367375
     
    384392    public static final int TAG_LENS_SERIAL_NUMBER = 0x0052;
    385393    public static final int TAG_ACCESSORY_TYPE = 0x0053;
     394    public static final int TAG_ACCESSORY_SERIAL_NUMBER = 0x0054;
    386395
    387396    /**
     
    403412    public static final int TAG_INTELLIGENT_EXPOSURE = 0x005d;
    404413
    405     /**
    406           * Info at http://www.ozhiker.com/electronics/pjmt/jpeg_info/pim.html
    407      */
    408         public static final int TAG_PRINT_IMAGE_MATCHING_INFO = 0x0E00;
     414    public static final int TAG_LENS_FIRMWARE_VERSION = 0x0060;
     415    public static final int TAG_BURST_SPEED = 0x0077;
     416    public static final int TAG_INTELLIGENT_D_RANGE = 0x0079;
     417    public static final int TAG_CLEAR_RETOUCH = 0x007c;
     418    public static final int TAG_CITY2 = 0x0080;
     419    public static final int TAG_PHOTO_STYLE = 0x0089;
     420    public static final int TAG_SHADING_COMPENSATION = 0x008a;
     421
     422    public static final int TAG_ACCELEROMETER_Z = 0x008c;
     423    public static final int TAG_ACCELEROMETER_X = 0x008d;
     424    public static final int TAG_ACCELEROMETER_Y = 0x008e;
     425    public static final int TAG_CAMERA_ORIENTATION = 0x008f;
     426    public static final int TAG_ROLL_ANGLE = 0x0090;
     427    public static final int TAG_PITCH_ANGLE = 0x0091;
     428    public static final int TAG_SWEEP_PANORAMA_DIRECTION = 0x0093;
     429    public static final int TAG_SWEEP_PANORAMA_FIELD_OF_VIEW = 0x0094;
     430    public static final int TAG_TIMER_RECORDING = 0x0096;
     431
     432    public static final int TAG_INTERNAL_ND_FILTER = 0x009d;
     433    public static final int TAG_HDR = 0x009e;
     434    public static final int TAG_SHUTTER_TYPE = 0x009f;
     435
     436    public static final int TAG_CLEAR_RETOUCH_VALUE = 0x00a3;
     437    public static final int TAG_TOUCH_AE = 0x00ab;
     438
     439    /**
     440    * Info at http://www.ozhiker.com/electronics/pjmt/jpeg_info/pim.html
     441    */
     442    public static final int TAG_PRINT_IMAGE_MATCHING_INFO = 0x0E00;
    409443
    410444    /**
     
    434468    public static final int TAG_RECOGNIZED_FACE_FLAGS = 0x0063;
    435469    public static final int TAG_TITLE = 0x0065;
    436         public static final int TAG_BABY_NAME = 0x0066;
    437         public static final int TAG_LOCATION = 0x0067;
    438         public static final int TAG_COUNTRY = 0x0069;
     470    public static final int TAG_BABY_NAME = 0x0066;
     471    public static final int TAG_LOCATION = 0x0067;
     472    public static final int TAG_COUNTRY = 0x0069;
    439473    public static final int TAG_STATE = 0x006b;
    440474    public static final int TAG_CITY = 0x006d;
     
    455489    public static final int TAG_FLASH_FIRED = 0x8007;
    456490    public static final int TAG_TEXT_STAMP_2 = 0x8008;
    457         public static final int TAG_TEXT_STAMP_3 = 0x8009;
    458         public static final int TAG_BABY_AGE_1 = 0x8010;
     491    public static final int TAG_TEXT_STAMP_3 = 0x8009;
     492    public static final int TAG_BABY_AGE_1 = 0x8010;
    459493
    460494        /**
     
    506540        _tagNameMap.put(TAG_TEXT_STAMP, "Text Stamp");
    507541        _tagNameMap.put(TAG_PROGRAM_ISO, "Program ISO");
    508                 _tagNameMap.put(TAG_ADVANCED_SCENE_MODE, "Advanced Scene Mode");
     542        _tagNameMap.put(TAG_ADVANCED_SCENE_MODE, "Advanced Scene Mode");
    509543        _tagNameMap.put(TAG_PRINT_IMAGE_MATCHING_INFO, "Print Image Matching (PIM) Info");
    510544        _tagNameMap.put(TAG_FACES_DETECTED, "Number of Detected Faces");
     
    512546        _tagNameMap.put(TAG_SHARPNESS, "Sharpness");
    513547        _tagNameMap.put(TAG_FILM_MODE, "Film Mode");
     548        _tagNameMap.put(TAG_COLOR_TEMP_KELVIN, "Color Temp Kelvin");
     549        _tagNameMap.put(TAG_BRACKET_SETTINGS, "Bracket Settings");
    514550        _tagNameMap.put(TAG_WB_ADJUST_AB, "White Balance Adjust (AB)");
    515                 _tagNameMap.put(TAG_WB_ADJUST_GM, "White Balance Adjust (GM)");
    516                 _tagNameMap.put(TAG_AF_POINT_POSITION, "Af Point Position");
     551        _tagNameMap.put(TAG_WB_ADJUST_GM, "White Balance Adjust (GM)");
     552
     553        _tagNameMap.put(TAG_FLASH_CURTAIN, "Flash Curtain");
     554        _tagNameMap.put(TAG_LONG_EXPOSURE_NOISE_REDUCTION, "Long Exposure Noise Reduction");
     555        _tagNameMap.put(TAG_PANASONIC_IMAGE_WIDTH, "Panasonic Image Width");
     556        _tagNameMap.put(TAG_PANASONIC_IMAGE_HEIGHT, "Panasonic Image Height");
     557
     558        _tagNameMap.put(TAG_AF_POINT_POSITION, "Af Point Position");
    517559        _tagNameMap.put(TAG_FACE_DETECTION_INFO, "Face Detection Info");
    518560        _tagNameMap.put(TAG_LENS_TYPE, "Lens Type");
    519561        _tagNameMap.put(TAG_LENS_SERIAL_NUMBER, "Lens Serial Number");
    520562        _tagNameMap.put(TAG_ACCESSORY_TYPE, "Accessory Type");
     563        _tagNameMap.put(TAG_ACCESSORY_SERIAL_NUMBER, "Accessory Serial Number");
    521564        _tagNameMap.put(TAG_TRANSFORM, "Transform");
    522565        _tagNameMap.put(TAG_INTELLIGENT_EXPOSURE, "Intelligent Exposure");
     566        _tagNameMap.put(TAG_LENS_FIRMWARE_VERSION, "Lens Firmware Version");
    523567        _tagNameMap.put(TAG_FACE_RECOGNITION_INFO, "Face Recognition Info");
    524568        _tagNameMap.put(TAG_FLASH_WARNING, "Flash Warning");
    525569        _tagNameMap.put(TAG_RECOGNIZED_FACE_FLAGS, "Recognized Face Flags");
    526                 _tagNameMap.put(TAG_TITLE, "Title");
    527                 _tagNameMap.put(TAG_BABY_NAME, "Baby Name");
    528                 _tagNameMap.put(TAG_LOCATION, "Location");
    529                 _tagNameMap.put(TAG_COUNTRY, "Country");
     570        _tagNameMap.put(TAG_TITLE, "Title");
     571        _tagNameMap.put(TAG_BABY_NAME, "Baby Name");
     572        _tagNameMap.put(TAG_LOCATION, "Location");
     573        _tagNameMap.put(TAG_COUNTRY, "Country");
    530574        _tagNameMap.put(TAG_STATE, "State");
    531575        _tagNameMap.put(TAG_CITY, "City");
    532576        _tagNameMap.put(TAG_LANDMARK, "Landmark");
    533577        _tagNameMap.put(TAG_INTELLIGENT_RESOLUTION, "Intelligent Resolution");
     578        _tagNameMap.put(TAG_BURST_SPEED, "Burst Speed");
     579        _tagNameMap.put(TAG_INTELLIGENT_D_RANGE, "Intelligent D-Range");
     580        _tagNameMap.put(TAG_CLEAR_RETOUCH, "Clear Retouch");
     581        _tagNameMap.put(TAG_CITY2, "City 2");
     582        _tagNameMap.put(TAG_PHOTO_STYLE, "Photo Style");
     583        _tagNameMap.put(TAG_SHADING_COMPENSATION, "Shading Compensation");
     584
     585        _tagNameMap.put(TAG_ACCELEROMETER_Z, "Accelerometer Z");
     586        _tagNameMap.put(TAG_ACCELEROMETER_X, "Accelerometer X");
     587        _tagNameMap.put(TAG_ACCELEROMETER_Y, "Accelerometer Y");
     588        _tagNameMap.put(TAG_CAMERA_ORIENTATION, "Camera Orientation");
     589        _tagNameMap.put(TAG_ROLL_ANGLE, "Roll Angle");
     590        _tagNameMap.put(TAG_PITCH_ANGLE, "Pitch Angle");
     591        _tagNameMap.put(TAG_SWEEP_PANORAMA_DIRECTION, "Sweep Panorama Direction");
     592        _tagNameMap.put(TAG_SWEEP_PANORAMA_FIELD_OF_VIEW, "Sweep Panorama Field Of View");
     593        _tagNameMap.put(TAG_TIMER_RECORDING, "Timer Recording");
     594
     595        _tagNameMap.put(TAG_INTERNAL_ND_FILTER, "Internal ND Filter");
     596        _tagNameMap.put(TAG_HDR, "HDR");
     597        _tagNameMap.put(TAG_SHUTTER_TYPE, "Shutter Type");
     598        _tagNameMap.put(TAG_CLEAR_RETOUCH_VALUE, "Clear Retouch Value");
     599        _tagNameMap.put(TAG_TOUCH_AE, "Touch AE");
     600
    534601        _tagNameMap.put(TAG_MAKERNOTE_VERSION, "Makernote Version");
    535602        _tagNameMap.put(TAG_SCENE_MODE, "Scene Mode");
     
    538605        _tagNameMap.put(TAG_WB_BLUE_LEVEL, "White Balance (Blue)");
    539606        _tagNameMap.put(TAG_FLASH_FIRED, "Flash Fired");
    540                 _tagNameMap.put(TAG_TEXT_STAMP_1, "Text Stamp 1");
    541                 _tagNameMap.put(TAG_TEXT_STAMP_2, "Text Stamp 2");
    542                 _tagNameMap.put(TAG_TEXT_STAMP_3, "Text Stamp 3");
    543                 _tagNameMap.put(TAG_BABY_AGE_1, "Baby Age 1");
    544                 _tagNameMap.put(TAG_TRANSFORM_1, "Transform 1");
     607        _tagNameMap.put(TAG_TEXT_STAMP_1, "Text Stamp 1");
     608        _tagNameMap.put(TAG_TEXT_STAMP_2, "Text Stamp 2");
     609        _tagNameMap.put(TAG_TEXT_STAMP_3, "Text Stamp 3");
     610        _tagNameMap.put(TAG_BABY_AGE_1, "Baby Age 1");
     611        _tagNameMap.put(TAG_TRANSFORM_1, "Transform 1");
    545612    }
    546613
  • trunk/src/com/drew/metadata/exif/makernotes/PentaxMakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3535 * @author Drew Noakes https://drewnoakes.com
    3636 */
     37@SuppressWarnings("WeakerAccess")
    3738public class PentaxMakernoteDescriptor extends TagDescriptor<PentaxMakernoteDirectory>
    3839{
  • trunk/src/com/drew/metadata/exif/makernotes/PentaxMakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3131 * @author Drew Noakes https://drewnoakes.com
    3232 */
     33@SuppressWarnings("WeakerAccess")
    3334public class PentaxMakernoteDirectory extends Directory
    3435{
  • trunk/src/com/drew/metadata/exif/makernotes/RicohMakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    2626
    2727/**
    28  * Provides human-readable string representations of tag values stored in a {@link RicohMakernoteDescriptor}.
     28 * Provides human-readable string representations of tag values stored in a {@link RicohMakernoteDirectory}.
    2929 * <p>
    3030 * Some information about this makernote taken from here:
     
    3333 * @author Drew Noakes https://drewnoakes.com
    3434 */
     35@SuppressWarnings("WeakerAccess")
    3536public class RicohMakernoteDescriptor extends TagDescriptor<RicohMakernoteDirectory>
    3637{
     
    4546    {
    4647        switch (tagType) {
    47 //            case TAG_PRINT_IMAGE_MATCHING_INFO:
    48 //                return getPrintImageMatchingInfoDescription();
    4948//            case TAG_PROPRIETARY_THUMBNAIL:
    5049//                return getProprietaryThumbnailDataDescription();
     
    5352        }
    5453    }
    55 
    56 //    @Nullable
    57 //    public String getPrintImageMatchingInfoDescription()
    58 //    {
    59 //        return getByteLengthDescription(TAG_PRINT_IMAGE_MATCHING_INFO);
    60 //    }
    6154//
    6255//    @Nullable
  • trunk/src/com/drew/metadata/exif/makernotes/RicohMakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3131 * @author Drew Noakes https://drewnoakes.com
    3232 */
     33@SuppressWarnings("WeakerAccess")
    3334public class RicohMakernoteDirectory extends Directory
    3435{
  • trunk/src/com/drew/metadata/exif/makernotes/SanyoMakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3333 * @author Drew Noakes https://drewnoakes.com
    3434 */
     35@SuppressWarnings("WeakerAccess")
    3536public class SanyoMakernoteDescriptor extends TagDescriptor<SanyoMakernoteDirectory>
    3637{
  • trunk/src/com/drew/metadata/exif/makernotes/SanyoMakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3232 * @author Drew Noakes https://drewnoakes.com
    3333 */
     34@SuppressWarnings("WeakerAccess")
    3435public class SanyoMakernoteDirectory extends Directory
    3536{
     
    6263    public static final int TAG_FLASH_MODE = 0x0225;
    6364
    64     public static final int TAG_PRINT_IM = 0x0e00;
     65    public static final int TAG_PRINT_IMAGE_MATCHING_INFO = 0x0E00;
    6566
    6667    public static final int TAG_DATA_DUMP = 0x0f00;
     
    99100        _tagNameMap.put(TAG_FLASH_MODE, "Flash Mode");
    100101
    101         _tagNameMap.put(TAG_PRINT_IM, "Print IM");
     102        _tagNameMap.put(TAG_PRINT_IMAGE_MATCHING_INFO, "Print IM");
    102103
    103104        _tagNameMap.put(TAG_DATA_DUMP, "Data Dump");
  • trunk/src/com/drew/metadata/exif/makernotes/SigmaMakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3333 * @author Drew Noakes https://drewnoakes.com
    3434 */
     35@SuppressWarnings("WeakerAccess")
    3536public class SigmaMakernoteDescriptor extends TagDescriptor<SigmaMakernoteDirectory>
    3637{
  • trunk/src/com/drew/metadata/exif/makernotes/SigmaMakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3232 * @author Drew Noakes https://drewnoakes.com
    3333 */
     34@SuppressWarnings("WeakerAccess")
    3435public class SigmaMakernoteDirectory extends Directory
    3536{
  • trunk/src/com/drew/metadata/exif/makernotes/SonyType1MakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3333 * @author Drew Noakes https://drewnoakes.com
    3434 */
     35@SuppressWarnings("WeakerAccess")
    3536public class SonyType1MakernoteDescriptor extends TagDescriptor<SonyType1MakernoteDirectory>
    3637{
     
    433434    public String getVignettingCorrectionDescription()
    434435    {
    435         return getIndexedDescription(TAG_VIGNETTING_CORRECTION, "Off", null, "Auto");
     436        Integer value = _directory.getInteger(TAG_VIGNETTING_CORRECTION);
     437        if (value == null)
     438            return null;
     439        switch (value) {
     440            case 0: return "Off";
     441            case 2: return "Auto";
     442            case 0xffffffff: return "N/A";
     443            default: return String.format("Unknown (%d)", value);
     444        }
    436445    }
    437446
     
    439448    public String getLateralChromaticAberrationDescription()
    440449    {
    441         return getIndexedDescription(TAG_LATERAL_CHROMATIC_ABERRATION, "Off", null, "Auto");
     450        Integer value = _directory.getInteger(TAG_LATERAL_CHROMATIC_ABERRATION);
     451        if (value == null)
     452            return null;
     453        switch (value) {
     454            case 0: return "Off";
     455            case 2: return "Auto";
     456            case 0xffffffff: return "N/A";
     457            default: return String.format("Unknown (%d)", value);
     458        }
    442459    }
    443460
     
    445462    public String getDistortionCorrectionDescription()
    446463    {
    447         return getIndexedDescription(TAG_DISTORTION_CORRECTION, "Off", null, "Auto");
     464        Integer value = _directory.getInteger(TAG_DISTORTION_CORRECTION);
     465        if (value == null)
     466            return null;
     467        switch (value) {
     468            case 0: return "Off";
     469            case 2: return "Auto";
     470            case 0xffffffff: return "N/A";
     471            default: return String.format("Unknown (%d)", value);
     472        }
    448473    }
    449474
  • trunk/src/com/drew/metadata/exif/makernotes/SonyType1MakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3131 * @author Drew Noakes https://drewnoakes.com
    3232 */
     33@SuppressWarnings("WeakerAccess")
    3334public class SonyType1MakernoteDirectory extends Directory
    3435{
     
    141142        _tagNameMap.put(TAG_EXTRA_INFO, "Extra Info");
    142143
    143         _tagNameMap.put(TAG_PRINT_IMAGE_MATCHING_INFO, "Print Image Matching Info");
     144        _tagNameMap.put(TAG_PRINT_IMAGE_MATCHING_INFO, "Print Image Matching (PIM) Info");
    144145
    145146        _tagNameMap.put(TAG_MULTI_BURST_MODE, "Multi Burst Mode");
  • trunk/src/com/drew/metadata/exif/makernotes/SonyType6MakernoteDescriptor.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3333 * @author Drew Noakes https://drewnoakes.com
    3434 */
     35@SuppressWarnings("WeakerAccess")
    3536public class SonyType6MakernoteDescriptor extends TagDescriptor<SonyType6MakernoteDirectory>
    3637{
  • trunk/src/com/drew/metadata/exif/makernotes/SonyType6MakernoteDirectory.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3232 * @author Drew Noakes https://drewnoakes.com
    3333 */
     34@SuppressWarnings("WeakerAccess")
    3435public class SonyType6MakernoteDirectory extends Directory
    3536{
Note: See TracChangeset for help on using the changeset viewer.