Ignore:
Timestamp:
2015-04-21T00:42:50+02:00 (9 years ago)
Author:
Don-vip
Message:

fix #11359 - update to metadata-extractor 2.8.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/com/drew/metadata/iptc/IptcDescriptor.java

    r8132 r8243  
    4949            case IptcDirectory.TAG_KEYWORDS:
    5050                return getKeywordsDescription();
     51            case IptcDirectory.TAG_TIME_CREATED:
     52                return getTimeCreatedDescription();
     53            case IptcDirectory.TAG_DIGITAL_TIME_CREATED:
     54                return getDigitalTimeCreatedDescription();
    5155            default:
    5256                return super.getDescription(tagType);
     
    227231    public String getTimeCreatedDescription()
    228232    {
    229         return _directory.getString(IptcDirectory.TAG_TIME_CREATED);
     233        String s = _directory.getString(IptcDirectory.TAG_TIME_CREATED);
     234        if (s == null)
     235            return null;
     236        if (s.length() == 6 || s.length() == 11)
     237            return s.substring(0, 2) + ':' + s.substring(2, 4) + ':' + s.substring(4);
     238        return s;
     239    }
     240
     241    @Nullable
     242    public String getDigitalTimeCreatedDescription()
     243    {
     244        String s = _directory.getString(IptcDirectory.TAG_DIGITAL_TIME_CREATED);
     245        if (s == null)
     246            return null;
     247        if (s.length() == 6 || s.length() == 11)
     248            return s.substring(0, 2) + ':' + s.substring(2, 4) + ':' + s.substring(4);
     249        return s;
    230250    }
    231251
Note: See TracChangeset for help on using the changeset viewer.