Ignore:
Timestamp:
2019-07-07T01:56:46+02:00 (5 years ago)
Author:
Don-vip
Message:

see #17848 - update to metadata-extractor 2.12.0

File:
1 edited

Legend:

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

    r13061 r15217  
    11/*
    2  * Copyright 2002-2017 Drew Noakes
     2 * Copyright 2002-2019 Drew Noakes and contributors
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    757757        if (o == null)
    758758            return null;
     759        if (o instanceof Number)
     760            return ((Number)o).longValue();
    759761        if (o instanceof String || o instanceof StringValue) {
    760762            try {
     
    763765                return null;
    764766            }
    765         }
    766         if (o instanceof Number)
    767             return ((Number)o).longValue();
     767        } else if (o instanceof Rational[]) {
     768            Rational[] rationals = (Rational[])o;
     769            if (rationals.length == 1)
     770                return rationals[0].longValue();
     771        } else if (o instanceof byte[]) {
     772            byte[] bytes = (byte[])o;
     773            if (bytes.length == 1)
     774                return (long)bytes[0];
     775        } else if (o instanceof int[]) {
     776            int[] ints = (int[])o;
     777            if (ints.length == 1)
     778                return (long)ints[0];
     779        } else if (o instanceof short[]) {
     780            short[] shorts = (short[])o;
     781            if (shorts.length == 1)
     782                return (long)shorts[0];
     783        }
    768784        return null;
    769785    }
     
    10091025                }
    10101026            } else if (componentType.getName().equals("float")) {
     1027                DecimalFormat format = new DecimalFormat(_floatFormatPattern);
    10111028                for (int i = 0; i < arrayLength; i++) {
    10121029                    if (i != 0)
    10131030                        string.append(' ');
    1014                     string.append(new DecimalFormat(_floatFormatPattern).format(Array.getFloat(o, i)));
     1031                    String s = format.format(Array.getFloat(o, i));
     1032                    string.append(s.equals("-0") ? "0" : s);
    10151033                }
    10161034            } else if (componentType.getName().equals("double")) {
     1035                DecimalFormat format = new DecimalFormat(_floatFormatPattern);
    10171036                for (int i = 0; i < arrayLength; i++) {
    10181037                    if (i != 0)
    10191038                        string.append(' ');
    1020                     string.append(new DecimalFormat(_floatFormatPattern).format(Array.getDouble(o, i)));
     1039                    String s = format.format(Array.getDouble(o, i));
     1040                    string.append(s.equals("-0") ? "0" : s);
    10211041                }
    10221042            } else if (componentType.getName().equals("byte")) {
Note: See TracChangeset for help on using the changeset viewer.