private CRXIFD[] FillIFD() { List <CRXIFD> lstIIFD = new List <CRXIFD>(); do { CRXIFD ifd = new CRXIFD(this._content, AdressIFD); if (ifd.Size == 0) { break; } AdressIFD = ifd.NextIFDOffset; lstIIFD.Add(ifd); } while (AdressIFD < _content.Length); return(lstIIFD.ToArray()); }
public CRXIFD(byte[] content, uint offset) { size = TiffType.getInt(offset, content, true); Name = Encoding.ASCII.GetString(content, (int)offset + SizeLen, NameLen).ToString(); if (Name == "PRVW") { PRVW = CRXParser.ParsePRVW(content, offset); } no = SizeLen + NameLen; if (size == 1) { size = TiffType.getInt((uint)(offset + no), content, true); no = SizeLen + NameLen + 8; } if (dicCount.Keys.Contains(Name)) { dicCount[Name]++; } else { dicCount.Add(Name, 1); } if (tags.Contains(Name)) { FillTags(Name, content, offset + no, size - no); } if (cmt.Contains(Name) || Name == "CMT") { TiffData = FillTiff(content, offset + no, size - no); } if (innerParsing.Contains(Name)) { var adressOffsetParent = (uint)(offset + no); if (Name == "uuid") { adressOffsetParent = adressOffsetParent + UUIDLen; } uint adressOffset = adressOffsetParent; do { var crx = new CRXIFD(content, adressOffset); adressOffset = crx.NextIFDOffset; lstCRXIFD.Add(crx); if (crx.Name == "\0\0\0\u0001") { break; } } while (adressOffset < (adressOffsetParent + size)); } if (innerOffsets.Keys.Contains(Name)) { size = (int)(size - no - innerOffsets[Name]); } if (Name == "trak") { Name = "trak" + dicCount["trak"]; } NextIFDOffset = (uint)(offset + size); }