public static ImageFileDirectoryEntry Parse(byte[] bytes, ref int offset, int tiffoffset, bool tiffIsBigEndian) { var tde = new ImageFileDirectoryEntry(bytes, offset, tiffoffset, tiffIsBigEndian); offset += Size; return(tde); }
public static int GetIFDTags(Dictionary <IFDTag, ImageFileDirectoryEntry> tags, byte[] bytes, int offset, int sectionstart, bool swap) { UInt16 tagcount = 0; int start = offset; BitUtils.GetValue(ref tagcount, bytes, ref offset, swap); for (int dIdx = 0; dIdx < tagcount; dIdx++) { var ifd = ImageFileDirectoryEntry.Parse(bytes, ref offset, sectionstart, swap);//False? try { if (Enum.IsDefined(typeof(IFDTag), (Int32)ifd.Tag)) { tags.Add((IFDTag)ifd.Tag, ifd); } } catch (Exception e) { Console.WriteLine(e); } } return(offset - start); }