Index: trunk/src/com/drew/metadata/icc/IccDescriptor.java
===================================================================
--- trunk/src/com/drew/metadata/icc/IccDescriptor.java	(revision 15218)
+++ 	(revision )
@@ -1,342 +1,0 @@
-/*
- * Copyright 2002-2019 Drew Noakes and contributors
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- *
- * More information about this project is available at:
- *
- *    https://drewnoakes.com/code/exif/
- *    https://github.com/drewnoakes/metadata-extractor
- */
-
-package com.drew.metadata.icc;
-
-import com.drew.lang.ByteArrayReader;
-import com.drew.lang.RandomAccessReader;
-import com.drew.lang.annotations.NotNull;
-import com.drew.lang.annotations.Nullable;
-import com.drew.metadata.TagDescriptor;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.text.DecimalFormat;
-
-import static com.drew.metadata.icc.IccDirectory.*;
-
-/**
- * @author Yuri Binev
- * @author Drew Noakes https://drewnoakes.com
- */
-@SuppressWarnings("WeakerAccess")
-public class IccDescriptor extends TagDescriptor<IccDirectory>
-{
-    public IccDescriptor(@NotNull IccDirectory directory)
-    {
-        super(directory);
-    }
-
-    @Override
-    public String getDescription(int tagType)
-    {
-        switch (tagType) {
-            case TAG_PROFILE_VERSION:
-                return getProfileVersionDescription();
-            case TAG_PROFILE_CLASS:
-                return getProfileClassDescription();
-            case TAG_PLATFORM:
-                return getPlatformDescription();
-            case TAG_RENDERING_INTENT:
-                return getRenderingIntentDescription();
-        }
-
-        if (tagType > 0x20202020 && tagType < 0x7a7a7a7a)
-            return getTagDataString(tagType);
-
-        return super.getDescription(tagType);
-    }
-
-    private static final int ICC_TAG_TYPE_TEXT = 0x74657874;
-    private static final int ICC_TAG_TYPE_DESC = 0x64657363;
-    private static final int ICC_TAG_TYPE_SIG = 0x73696720;
-    private static final int ICC_TAG_TYPE_MEAS = 0x6D656173;
-    private static final int ICC_TAG_TYPE_XYZ_ARRAY = 0x58595A20;
-    private static final int ICC_TAG_TYPE_MLUC = 0x6d6c7563;
-    private static final int ICC_TAG_TYPE_CURV = 0x63757276;
-
-    @Nullable
-    private String getTagDataString(int tagType)
-    {
-        try {
-            byte[] bytes = _directory.getByteArray(tagType);
-            if (bytes == null)
-                return _directory.getString(tagType);
-            RandomAccessReader reader = new ByteArrayReader(bytes);
-            int iccTagType = reader.getInt32(0);
-            switch (iccTagType) {
-                case ICC_TAG_TYPE_TEXT:
-                    try {
-                        return new String(bytes, 8, bytes.length - 8 - 1, "ASCII");
-                    } catch (UnsupportedEncodingException ex) {
-                        return new String(bytes, 8, bytes.length - 8 - 1);
-                    }
-                case ICC_TAG_TYPE_DESC:
-                    int stringLength = reader.getInt32(8);
-                    return new String(bytes, 12, stringLength - 1);
-                case ICC_TAG_TYPE_SIG:
-                    return IccReader.getStringFromInt32(reader.getInt32(8));
-                case ICC_TAG_TYPE_MEAS: {
-                    int observerType = reader.getInt32(8);
-                    float x = reader.getS15Fixed16(12);
-                    float y = reader.getS15Fixed16(16);
-                    float z = reader.getS15Fixed16(20);
-                    int geometryType = reader.getInt32(24);
-                    float flare = reader.getS15Fixed16(28);
-                    int illuminantType = reader.getInt32(32);
-                    String observerString;
-                    switch (observerType) {
-                        case 0:
-                            observerString = "Unknown";
-                            break;
-                        case 1:
-                            observerString = "1931 2\u00B0";
-                            break;
-                        case 2:
-                            observerString = "1964 10\u00B0";
-                            break;
-                        default:
-                            observerString = String.format("Unknown %d", observerType);
-                    }
-                    String geometryString;
-                    switch (geometryType) {
-                        case 0:
-                            geometryString = "Unknown";
-                            break;
-                        case 1:
-                            geometryString = "0/45 or 45/0";
-                            break;
-                        case 2:
-                            geometryString = "0/d or d/0";
-                            break;
-                        default:
-                            geometryString = String.format("Unknown %d", observerType);
-                    }
-                    String illuminantString;
-                    switch (illuminantType) {
-                        case 0:
-                            illuminantString = "unknown";
-                            break;
-                        case 1:
-                            illuminantString = "D50";
-                            break;
-                        case 2:
-                            illuminantString = "D65";
-                            break;
-                        case 3:
-                            illuminantString = "D93";
-                            break;
-                        case 4:
-                            illuminantString = "F2";
-                            break;
-                        case 5:
-                            illuminantString = "D55";
-                            break;
-                        case 6:
-                            illuminantString = "A";
-                            break;
-                        case 7:
-                            illuminantString = "Equi-Power (E)";
-                            break;
-                        case 8:
-                            illuminantString = "F8";
-                            break;
-                        default:
-                            illuminantString = String.format("Unknown %d", illuminantType);
-                            break;
-                    }
-                    DecimalFormat format = new DecimalFormat("0.###");
-                    return String.format("%s Observer, Backing (%s, %s, %s), Geometry %s, Flare %d%%, Illuminant %s",
-                            observerString, format.format(x), format.format(y), format.format(z), geometryString, Math.round(flare * 100), illuminantString);
-                }
-                case ICC_TAG_TYPE_XYZ_ARRAY: {
-                    StringBuilder res = new StringBuilder();
-                    DecimalFormat format = new DecimalFormat("0.####");
-                    int count = (bytes.length - 8) / 12;
-                    for (int i = 0; i < count; i++) {
-                        float x = reader.getS15Fixed16(8 + i * 12);
-                        float y = reader.getS15Fixed16(8 + i * 12 + 4);
-                        float z = reader.getS15Fixed16(8 + i * 12 + 8);
-                        if (i > 0)
-                            res.append(", ");
-                        res.append("(").append(format.format(x)).append(", ").append(format.format(y)).append(", ").append(format.format(z)).append(")");
-                    }
-                    return res.toString();
-                }
-                case ICC_TAG_TYPE_MLUC: {
-                    int int1 = reader.getInt32(8);
-                    StringBuilder res = new StringBuilder();
-                    res.append(int1);
-                    //int int2 = reader.getInt32(12);
-                    //System.err.format("int1: %d, int2: %d\n", int1, int2);
-                    for (int i = 0; i < int1; i++) {
-                        String str = IccReader.getStringFromInt32(reader.getInt32(16 + i * 12));
-                        int len = reader.getInt32(16 + i * 12 + 4);
-                        int ofs = reader.getInt32(16 + i * 12 + 8);
-                        String name;
-                        try {
-                            name = new String(bytes, ofs, len, "UTF-16BE");
-                        } catch (UnsupportedEncodingException ex) {
-                            name = new String(bytes, ofs, len);
-                        }
-                        res.append(" ").append(str).append("(").append(name).append(")");
-                        //System.err.format("% 3d: %s, len: %d, ofs: %d, \"%s\"\n", i, str, len,ofs,name);
-                    }
-                    return res.toString();
-                }
-                case ICC_TAG_TYPE_CURV: {
-                    int num = reader.getInt32(8);
-                    StringBuilder res = new StringBuilder();
-                    for (int i = 0; i < num; i++) {
-                        if (i != 0)
-                            res.append(", ");
-                        res.append(formatDoubleAsString(((float)reader.getUInt16(12 + i * 2)) / 65535.0, 7, false));
-                        //res+=String.format("%1.7g",Math.round(((float)iccReader.getInt16(b,12+i*2))/0.065535)/1E7);
-                    }
-                    return res.toString();
-                }
-                default:
-                    return String.format("%s (0x%08X): %d bytes", IccReader.getStringFromInt32(iccTagType), iccTagType, bytes.length);
-            }
-        } catch (IOException e) {
-            // TODO decode these values during IccReader.extract so we can report any errors at that time
-            // It is convention to return null if a description cannot be formulated.
-            // If an error is to be reported, it should be done during the extraction process.
-            return null;
-        }
-    }
-
-    @NotNull
-    public static String formatDoubleAsString(double value, int precision, boolean zeroes)
-    {
-        if (precision < 1)
-            return "" + Math.round(value);
-        long intPart = Math.abs((long)value);
-        long rest = (int)Math.round((Math.abs(value) - intPart) * Math.pow(10, precision));
-        long restKept = rest;
-        String res = "";
-        byte cour;
-        for (int i = precision; i > 0; i--) {
-            cour = (byte)(Math.abs(rest % 10));
-            rest /= 10;
-            if (res.length() > 0 || zeroes || cour != 0 || i == 1)
-                res = cour + res;
-        }
-        intPart += rest;
-        boolean isNegative = ((value < 0) && (intPart != 0 || restKept != 0));
-        return (isNegative ? "-" : "") + intPart + "." + res;
-    }
-
-    @Nullable
-    private String getRenderingIntentDescription()
-    {
-        return getIndexedDescription(TAG_RENDERING_INTENT,
-            "Perceptual",
-            "Media-Relative Colorimetric",
-            "Saturation",
-            "ICC-Absolute Colorimetric");
-    }
-
-    @Nullable
-    private String getPlatformDescription()
-    {
-        String str = _directory.getString(TAG_PLATFORM);
-        if (str==null)
-            return null;
-        // Because Java doesn't allow switching on string values, create an integer from the first four chars
-        // and switch on that instead.
-        int i;
-        try {
-            i = getInt32FromString(str);
-        } catch (IOException e) {
-            return str;
-        }
-        switch (i) {
-            case 0x4150504C: // "APPL"
-                return "Apple Computer, Inc.";
-            case 0x4D534654: // "MSFT"
-                return "Microsoft Corporation";
-            case 0x53474920:
-                return "Silicon Graphics, Inc.";
-            case 0x53554E57:
-                return "Sun Microsystems, Inc.";
-            case 0x54474E54:
-                return "Taligent, Inc.";
-            default:
-                return String.format("Unknown (%s)", str);
-        }
-    }
-
-    @Nullable
-    private String getProfileClassDescription()
-    {
-        String str = _directory.getString(TAG_PROFILE_CLASS);
-        if (str==null)
-            return null;
-        // Because Java doesn't allow switching on string values, create an integer from the first four chars
-        // and switch on that instead.
-        int i;
-        try {
-            i = getInt32FromString(str);
-        } catch (IOException e) {
-            return str;
-        }
-        switch (i) {
-            case 0x73636E72:
-                return "Input Device";
-            case 0x6D6E7472: // mntr
-                return "Display Device";
-            case 0x70727472:
-                return "Output Device";
-            case 0x6C696E6B:
-                return "DeviceLink";
-            case 0x73706163:
-                return "ColorSpace Conversion";
-            case 0x61627374:
-                return "Abstract";
-            case 0x6E6D636C:
-                return "Named Color";
-            default:
-                return String.format("Unknown (%s)", str);
-        }
-    }
-
-    @Nullable
-    private String getProfileVersionDescription()
-    {
-        Integer value = _directory.getInteger(TAG_PROFILE_VERSION);
-
-        if (value == null)
-            return null;
-
-        int m = (value & 0xFF000000) >> 24;
-        int r = (value & 0x00F00000) >> 20;
-        int R = (value & 0x000F0000) >> 16;
-
-        return String.format("%d.%d.%d", m, r, R);
-    }
-
-    private static int getInt32FromString(@NotNull String string) throws IOException
-    {
-        byte[] bytes = string.getBytes();
-        return new ByteArrayReader(bytes).getInt32(0);
-    }
-}
Index: trunk/src/com/drew/metadata/icc/IccDirectory.java
===================================================================
--- trunk/src/com/drew/metadata/icc/IccDirectory.java	(revision 15218)
+++ 	(revision )
@@ -1,208 +1,0 @@
-/*
- * Copyright 2002-2019 Drew Noakes and contributors
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- *
- * More information about this project is available at:
- *
- *    https://drewnoakes.com/code/exif/
- *    https://github.com/drewnoakes/metadata-extractor
- */
-package com.drew.metadata.icc;
-
-import com.drew.lang.annotations.NotNull;
-import com.drew.metadata.Directory;
-
-import java.util.HashMap;
-
-/**
- * @author Yuri Binev
- * @author Drew Noakes https://drewnoakes.com
- */
-@SuppressWarnings("WeakerAccess")
-public class IccDirectory extends Directory
-{
-    // These (smaller valued) tags have an integer value that's equal to their offset within the ICC data buffer.
-
-    public static final int TAG_PROFILE_BYTE_COUNT = 0;
-    public static final int TAG_CMM_TYPE = 4;
-    public static final int TAG_PROFILE_VERSION = 8;
-    public static final int TAG_PROFILE_CLASS = 12;
-    public static final int TAG_COLOR_SPACE = 16;
-    public static final int TAG_PROFILE_CONNECTION_SPACE = 20;
-    public static final int TAG_PROFILE_DATETIME = 24;
-    public static final int TAG_SIGNATURE = 36;
-    public static final int TAG_PLATFORM = 40;
-    public static final int TAG_CMM_FLAGS = 44;
-    public static final int TAG_DEVICE_MAKE = 48;
-    public static final int TAG_DEVICE_MODEL = 52;
-    public static final int TAG_DEVICE_ATTR = 56;
-    public static final int TAG_RENDERING_INTENT = 64;
-    public static final int TAG_XYZ_VALUES = 68;
-    public static final int TAG_PROFILE_CREATOR = 80;
-    public static final int TAG_TAG_COUNT = 128;
-
-    // These tag values
-
-    public static final int TAG_TAG_A2B0 = 0x41324230;
-    public static final int TAG_TAG_A2B1 = 0x41324231;
-    public static final int TAG_TAG_A2B2 = 0x41324232;
-    public static final int TAG_TAG_bXYZ = 0x6258595A;
-    public static final int TAG_TAG_bTRC = 0x62545243;
-    public static final int TAG_TAG_B2A0 = 0x42324130;
-    public static final int TAG_TAG_B2A1 = 0x42324131;
-    public static final int TAG_TAG_B2A2 = 0x42324132;
-    public static final int TAG_TAG_calt = 0x63616C74;
-    public static final int TAG_TAG_targ = 0x74617267;
-    public static final int TAG_TAG_chad = 0x63686164;
-    public static final int TAG_TAG_chrm = 0x6368726D;
-    public static final int TAG_TAG_cprt = 0x63707274;
-    public static final int TAG_TAG_crdi = 0x63726469;
-    public static final int TAG_TAG_dmnd = 0x646D6E64;
-    public static final int TAG_TAG_dmdd = 0x646D6464;
-    public static final int TAG_TAG_devs = 0x64657673;
-    public static final int TAG_TAG_gamt = 0x67616D74;
-    public static final int TAG_TAG_kTRC = 0x6B545243;
-    public static final int TAG_TAG_gXYZ = 0x6758595A;
-    public static final int TAG_TAG_gTRC = 0x67545243;
-    public static final int TAG_TAG_lumi = 0x6C756D69;
-    public static final int TAG_TAG_meas = 0x6D656173;
-    public static final int TAG_TAG_bkpt = 0x626B7074;
-    public static final int TAG_TAG_wtpt = 0x77747074;
-    public static final int TAG_TAG_ncol = 0x6E636F6C;
-    public static final int TAG_TAG_ncl2 = 0x6E636C32;
-    public static final int TAG_TAG_resp = 0x72657370;
-    public static final int TAG_TAG_pre0 = 0x70726530;
-    public static final int TAG_TAG_pre1 = 0x70726531;
-    public static final int TAG_TAG_pre2 = 0x70726532;
-    public static final int TAG_TAG_desc = 0x64657363;
-    public static final int TAG_TAG_pseq = 0x70736571;
-    public static final int TAG_TAG_psd0 = 0x70736430;
-    public static final int TAG_TAG_psd1 = 0x70736431;
-    public static final int TAG_TAG_psd2 = 0x70736432;
-    public static final int TAG_TAG_psd3 = 0x70736433;
-    public static final int TAG_TAG_ps2s = 0x70733273;
-    public static final int TAG_TAG_ps2i = 0x70733269;
-    public static final int TAG_TAG_rXYZ = 0x7258595A;
-    public static final int TAG_TAG_rTRC = 0x72545243;
-    public static final int TAG_TAG_scrd = 0x73637264;
-    public static final int TAG_TAG_scrn = 0x7363726E;
-    public static final int TAG_TAG_tech = 0x74656368;
-    public static final int TAG_TAG_bfd = 0x62666420;
-    public static final int TAG_TAG_vued = 0x76756564;
-    public static final int TAG_TAG_view = 0x76696577;
-
-    public static final int TAG_TAG_aabg = 0x61616267;
-    public static final int TAG_TAG_aagg = 0x61616767;
-    public static final int TAG_TAG_aarg = 0x61617267;
-    public static final int TAG_TAG_mmod = 0x6D6D6F64;
-    public static final int TAG_TAG_ndin = 0x6E64696E;
-    public static final int TAG_TAG_vcgt = 0x76636774;
-    public static final int TAG_APPLE_MULTI_LANGUAGE_PROFILE_NAME = 0x6473636d;
-
-    @NotNull
-    protected static final HashMap<Integer, String> _tagNameMap = new HashMap<Integer, String>();
-
-    static {
-        _tagNameMap.put(TAG_PROFILE_BYTE_COUNT, "Profile Size");
-        _tagNameMap.put(TAG_CMM_TYPE, "CMM Type");
-        _tagNameMap.put(TAG_PROFILE_VERSION, "Version");
-        _tagNameMap.put(TAG_PROFILE_CLASS, "Class");
-        _tagNameMap.put(TAG_COLOR_SPACE, "Color space");
-        _tagNameMap.put(TAG_PROFILE_CONNECTION_SPACE, "Profile Connection Space");
-        _tagNameMap.put(TAG_PROFILE_DATETIME, "Profile Date/Time");
-        _tagNameMap.put(TAG_SIGNATURE, "Signature");
-        _tagNameMap.put(TAG_PLATFORM, "Primary Platform");
-        _tagNameMap.put(TAG_CMM_FLAGS, "CMM Flags");
-        _tagNameMap.put(TAG_DEVICE_MAKE, "Device manufacturer");
-        _tagNameMap.put(TAG_DEVICE_MODEL, "Device model");
-        _tagNameMap.put(TAG_DEVICE_ATTR, "Device attributes");
-        _tagNameMap.put(TAG_RENDERING_INTENT, "Rendering Intent");
-        _tagNameMap.put(TAG_XYZ_VALUES, "XYZ values");
-        _tagNameMap.put(TAG_PROFILE_CREATOR, "Profile Creator");
-        _tagNameMap.put(TAG_TAG_COUNT, "Tag Count");
-        _tagNameMap.put(TAG_TAG_A2B0, "AToB 0");
-        _tagNameMap.put(TAG_TAG_A2B1, "AToB 1");
-        _tagNameMap.put(TAG_TAG_A2B2, "AToB 2");
-        _tagNameMap.put(TAG_TAG_bXYZ, "Blue Colorant");
-        _tagNameMap.put(TAG_TAG_bTRC, "Blue TRC");
-        _tagNameMap.put(TAG_TAG_B2A0, "BToA 0");
-        _tagNameMap.put(TAG_TAG_B2A1, "BToA 1");
-        _tagNameMap.put(TAG_TAG_B2A2, "BToA 2");
-        _tagNameMap.put(TAG_TAG_calt, "Calibration Date/Time");
-        _tagNameMap.put(TAG_TAG_targ, "Char Target");
-        _tagNameMap.put(TAG_TAG_chad, "Chromatic Adaptation");
-        _tagNameMap.put(TAG_TAG_chrm, "Chromaticity");
-        _tagNameMap.put(TAG_TAG_cprt, "Copyright");
-        _tagNameMap.put(TAG_TAG_crdi, "CrdInfo");
-        _tagNameMap.put(TAG_TAG_dmnd, "Device Mfg Description");
-        _tagNameMap.put(TAG_TAG_dmdd, "Device Model Description");
-        _tagNameMap.put(TAG_TAG_devs, "Device Settings");
-        _tagNameMap.put(TAG_TAG_gamt, "Gamut");
-        _tagNameMap.put(TAG_TAG_kTRC, "Gray TRC");
-        _tagNameMap.put(TAG_TAG_gXYZ, "Green Colorant");
-        _tagNameMap.put(TAG_TAG_gTRC, "Green TRC");
-        _tagNameMap.put(TAG_TAG_lumi, "Luminance");
-        _tagNameMap.put(TAG_TAG_meas, "Measurement");
-        _tagNameMap.put(TAG_TAG_bkpt, "Media Black Point");
-        _tagNameMap.put(TAG_TAG_wtpt, "Media White Point");
-        _tagNameMap.put(TAG_TAG_ncol, "Named Color");
-        _tagNameMap.put(TAG_TAG_ncl2, "Named Color 2");
-        _tagNameMap.put(TAG_TAG_resp, "Output Response");
-        _tagNameMap.put(TAG_TAG_pre0, "Preview 0");
-        _tagNameMap.put(TAG_TAG_pre1, "Preview 1");
-        _tagNameMap.put(TAG_TAG_pre2, "Preview 2");
-        _tagNameMap.put(TAG_TAG_desc, "Profile Description");
-        _tagNameMap.put(TAG_TAG_pseq, "Profile Sequence Description");
-        _tagNameMap.put(TAG_TAG_psd0, "Ps2 CRD 0");
-        _tagNameMap.put(TAG_TAG_psd1, "Ps2 CRD 1");
-        _tagNameMap.put(TAG_TAG_psd2, "Ps2 CRD 2");
-        _tagNameMap.put(TAG_TAG_psd3, "Ps2 CRD 3");
-        _tagNameMap.put(TAG_TAG_ps2s, "Ps2 CSA");
-        _tagNameMap.put(TAG_TAG_ps2i, "Ps2 Rendering Intent");
-        _tagNameMap.put(TAG_TAG_rXYZ, "Red Colorant");
-        _tagNameMap.put(TAG_TAG_rTRC, "Red TRC");
-        _tagNameMap.put(TAG_TAG_scrd, "Screening Desc");
-        _tagNameMap.put(TAG_TAG_scrn, "Screening");
-        _tagNameMap.put(TAG_TAG_tech, "Technology");
-        _tagNameMap.put(TAG_TAG_bfd, "Ucrbg");
-        _tagNameMap.put(TAG_TAG_vued, "Viewing Conditions Description");
-        _tagNameMap.put(TAG_TAG_view, "Viewing Conditions");
-        _tagNameMap.put(TAG_TAG_aabg, "Blue Parametric TRC");
-        _tagNameMap.put(TAG_TAG_aagg, "Green Parametric TRC");
-        _tagNameMap.put(TAG_TAG_aarg, "Red Parametric TRC");
-        _tagNameMap.put(TAG_TAG_mmod, "Make And Model");
-        _tagNameMap.put(TAG_TAG_ndin, "Native Display Information");
-        _tagNameMap.put(TAG_TAG_vcgt, "Video Card Gamma");
-        _tagNameMap.put(TAG_APPLE_MULTI_LANGUAGE_PROFILE_NAME, "Apple Multi-language Profile Name");
-    }
-
-    public IccDirectory()
-    {
-        this.setDescriptor(new IccDescriptor(this));
-    }
-
-    @Override
-    @NotNull
-    public String getName()
-    {
-        return "ICC Profile";
-    }
-
-    @Override
-    @NotNull
-    protected HashMap<Integer, String> getTagNameMap()
-    {
-        return _tagNameMap;
-    }
-}
Index: trunk/src/com/drew/metadata/icc/IccReader.java
===================================================================
--- trunk/src/com/drew/metadata/icc/IccReader.java	(revision 15218)
+++ 	(revision )
@@ -1,217 +1,0 @@
-/*
- * Copyright 2002-2019 Drew Noakes and contributors
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- *
- * More information about this project is available at:
- *
- *    https://drewnoakes.com/code/exif/
- *    https://github.com/drewnoakes/metadata-extractor
- */
-package com.drew.metadata.icc;
-
-import com.drew.imaging.jpeg.JpegSegmentMetadataReader;
-import com.drew.imaging.jpeg.JpegSegmentType;
-import com.drew.lang.ByteArrayReader;
-import com.drew.lang.DateUtil;
-import com.drew.lang.RandomAccessReader;
-import com.drew.lang.annotations.NotNull;
-import com.drew.lang.annotations.Nullable;
-import com.drew.metadata.Directory;
-import com.drew.metadata.Metadata;
-import com.drew.metadata.MetadataReader;
-
-import java.io.IOException;
-import java.util.Collections;
-
-/**
- * Reads an ICC profile.
- * <p>
- * More information about ICC:
- * <ul>
- * <li>http://en.wikipedia.org/wiki/ICC_profile</li>
- * <li>http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/ICC_Profile.html</li>
- * <li>https://developer.apple.com/library/mac/samplecode/ImageApp/Listings/ICC_h.html</li>
- * </ul>
- *
- * @author Yuri Binev
- * @author Drew Noakes https://drewnoakes.com
- */
-public class IccReader implements JpegSegmentMetadataReader, MetadataReader
-{
-    public static final String JPEG_SEGMENT_PREAMBLE = "ICC_PROFILE";
-
-    @NotNull
-    public Iterable<JpegSegmentType> getSegmentTypes()
-    {
-        return Collections.singletonList(JpegSegmentType.APP2);
-    }
-
-    public void readJpegSegments(@NotNull Iterable<byte[]> segments, @NotNull Metadata metadata, @NotNull JpegSegmentType segmentType)
-    {
-        final int preambleLength = JPEG_SEGMENT_PREAMBLE.length();
-
-        // ICC data can be spread across multiple JPEG segments.
-        // We concat them together in this buffer for later processing.
-        byte[] buffer = null;
-
-        for (byte[] segmentBytes : segments) {
-            // Skip any segments that do not contain the required preamble
-            if (segmentBytes.length < preambleLength || !JPEG_SEGMENT_PREAMBLE.equalsIgnoreCase(new String(segmentBytes, 0, preambleLength)))
-                continue;
-
-            // NOTE we ignore three bytes here -- are they useful for anything?
-
-            // Grow the buffer
-            if (buffer == null) {
-                buffer = new byte[segmentBytes.length - 14];
-                // skip the first 14 bytes
-                System.arraycopy(segmentBytes, 14, buffer, 0, segmentBytes.length - 14);
-            } else {
-                byte[] newBuffer = new byte[buffer.length + segmentBytes.length - 14];
-                System.arraycopy(buffer, 0, newBuffer, 0, buffer.length);
-                System.arraycopy(segmentBytes, 14, newBuffer, buffer.length, segmentBytes.length - 14);
-                buffer = newBuffer;
-            }
-        }
-
-        if (buffer != null)
-            extract(new ByteArrayReader(buffer), metadata);
-    }
-
-    public void extract(@NotNull final RandomAccessReader reader, @NotNull final Metadata metadata)
-    {
-        extract(reader, metadata, null);
-    }
-
-    public void extract(@NotNull final RandomAccessReader reader, @NotNull final Metadata metadata, @Nullable Directory parentDirectory)
-    {
-        // TODO review whether the 'tagPtr' values below really do require RandomAccessReader or whether SequentialReader may be used instead
-
-        IccDirectory directory = new IccDirectory();
-
-        if (parentDirectory != null)
-            directory.setParent(parentDirectory);
-
-        try {
-            int profileByteCount = reader.getInt32(IccDirectory.TAG_PROFILE_BYTE_COUNT);
-            directory.setInt(IccDirectory.TAG_PROFILE_BYTE_COUNT, profileByteCount);
-
-            // For these tags, the int value of the tag is in fact it's offset within the buffer.
-            set4ByteString(directory, IccDirectory.TAG_CMM_TYPE, reader);
-            setInt32(directory, IccDirectory.TAG_PROFILE_VERSION, reader);
-            set4ByteString(directory, IccDirectory.TAG_PROFILE_CLASS, reader);
-            set4ByteString(directory, IccDirectory.TAG_COLOR_SPACE, reader);
-            set4ByteString(directory, IccDirectory.TAG_PROFILE_CONNECTION_SPACE, reader);
-            setDate(directory, IccDirectory.TAG_PROFILE_DATETIME, reader);
-            set4ByteString(directory, IccDirectory.TAG_SIGNATURE, reader);
-            set4ByteString(directory, IccDirectory.TAG_PLATFORM, reader);
-            setInt32(directory, IccDirectory.TAG_CMM_FLAGS, reader);
-            set4ByteString(directory, IccDirectory.TAG_DEVICE_MAKE, reader);
-
-            int temp = reader.getInt32(IccDirectory.TAG_DEVICE_MODEL);
-            if (temp != 0) {
-                if (temp <= 0x20202020) {
-                    directory.setInt(IccDirectory.TAG_DEVICE_MODEL, temp);
-                } else {
-                    directory.setString(IccDirectory.TAG_DEVICE_MODEL, getStringFromInt32(temp));
-                }
-            }
-
-            setInt32(directory, IccDirectory.TAG_RENDERING_INTENT, reader);
-            setInt64(directory, IccDirectory.TAG_DEVICE_ATTR, reader);
-
-            float[] xyz = new float[]{
-                    reader.getS15Fixed16(IccDirectory.TAG_XYZ_VALUES),
-                    reader.getS15Fixed16(IccDirectory.TAG_XYZ_VALUES + 4),
-                    reader.getS15Fixed16(IccDirectory.TAG_XYZ_VALUES + 8)
-            };
-            directory.setObject(IccDirectory.TAG_XYZ_VALUES, xyz);
-
-            // Process 'ICC tags'
-            int tagCount = reader.getInt32(IccDirectory.TAG_TAG_COUNT);
-            directory.setInt(IccDirectory.TAG_TAG_COUNT, tagCount);
-
-            for (int i = 0; i < tagCount; i++) {
-                int pos = IccDirectory.TAG_TAG_COUNT + 4 + i * 12;
-                int tagType = reader.getInt32(pos);
-                int tagPtr = reader.getInt32(pos + 4);
-                int tagLen = reader.getInt32(pos + 8);
-                byte[] b = reader.getBytes(tagPtr, tagLen);
-                directory.setByteArray(tagType, b);
-            }
-        } catch (IOException ex) {
-            directory.addError("Exception reading ICC profile: " + ex.getMessage());
-        }
-
-        metadata.addDirectory(directory);
-    }
-
-    private void set4ByteString(@NotNull Directory directory, int tagType, @NotNull RandomAccessReader reader) throws IOException
-    {
-        int i = reader.getInt32(tagType);
-        if (i != 0)
-            directory.setString(tagType, getStringFromInt32(i));
-    }
-
-    private void setInt32(@NotNull Directory directory, int tagType, @NotNull RandomAccessReader reader) throws IOException
-    {
-        int i = reader.getInt32(tagType);
-        if (i != 0)
-            directory.setInt(tagType, i);
-    }
-
-    @SuppressWarnings({"SameParameterValue"})
-    private void setInt64(@NotNull Directory directory, int tagType, @NotNull RandomAccessReader reader) throws IOException
-    {
-        long l = reader.getInt64(tagType);
-        if (l != 0)
-            directory.setLong(tagType, l);
-    }
-
-    @SuppressWarnings({"SameParameterValue", "MagicConstant"})
-    private void setDate(@NotNull final IccDirectory directory, final int tagType, @NotNull RandomAccessReader reader) throws IOException
-    {
-        final int y = reader.getUInt16(tagType);
-        final int m = reader.getUInt16(tagType + 2);
-        final int d = reader.getUInt16(tagType + 4);
-        final int h = reader.getUInt16(tagType + 6);
-        final int M = reader.getUInt16(tagType + 8);
-        final int s = reader.getUInt16(tagType + 10);
-
-        if (DateUtil.isValidDate(y, m - 1, d) && DateUtil.isValidTime(h, M, s))
-        {
-            String dateString = String.format("%04d:%02d:%02d %02d:%02d:%02d", y, m, d, h, M, s);
-            directory.setString(tagType, dateString);
-        }
-        else
-        {
-            directory.addError(String.format(
-                "ICC data describes an invalid date/time: year=%d month=%d day=%d hour=%d minute=%d second=%d",
-                y, m, d, h, M, s));
-        }
-    }
-
-    @NotNull
-    public static String getStringFromInt32(int d)
-    {
-        // MSB
-        byte[] b = new byte[] {
-                (byte) ((d & 0xFF000000) >> 24),
-                (byte) ((d & 0x00FF0000) >> 16),
-                (byte) ((d & 0x0000FF00) >> 8),
-                (byte) ((d & 0x000000FF))
-        };
-        return new String(b);
-    }
-}
Index: trunk/src/com/drew/metadata/icc/package-info.java
===================================================================
--- trunk/src/com/drew/metadata/icc/package-info.java	(revision 15218)
+++ 	(revision )
@@ -1,4 +1,0 @@
-/**
- * Contains classes for the extraction and modelling of ICC (International Color Consortium) profile metadata.
- */
-package com.drew.metadata.icc;
