Exemple #1
0
        private IccTagDataEntry[] ReadTagData(IccDataReader reader)
        {
            IccTagTableEntry[] tagTable = this.ReadTagTable(reader);
            var entries = new List <IccTagDataEntry>(tagTable.Length);
            var store   = new Dictionary <uint, IccTagDataEntry>();

            foreach (IccTagTableEntry tag in tagTable)
            {
                IccTagDataEntry entry;
                if (store.ContainsKey(tag.Offset))
                {
                    entry = store[tag.Offset];
                }
                else
                {
                    try
                    {
                        entry = reader.ReadTagDataEntry(tag);
                    }
                    catch
                    {
                        // Ignore tags that could not be read
                        continue;
                    }

                    store.Add(tag.Offset, entry);
                }

                entry.TagSignature = tag.Signature;
                entries.Add(entry);
            }

            return(entries.ToArray());
        }
Exemple #2
0
        private IccTagDataEntry[] ReadTagData(IccDataReader reader)
        {
            IccTagTableEntry[] tagTable = this.ReadTagTable(reader);
            IccTagDataEntry[]  entries  = new IccTagDataEntry[tagTable.Length];
            var store = new Dictionary <uint, IccTagDataEntry>();

            for (int i = 0; i < tagTable.Length; i++)
            {
                IccTagDataEntry entry;
                uint            offset = tagTable[i].Offset;
                if (store.ContainsKey(offset))
                {
                    entry = store[offset];
                }
                else
                {
                    entry = reader.ReadTagDataEntry(tagTable[i]);
                    store.Add(offset, entry);
                }

                entry.TagSignature = tagTable[i].Signature;
                entries[i]         = entry;
            }

            return(entries);
        }