Пример #1
0
        public static void Decode12BitRawBEInterlaced(ImageBinaryReader input, Point2D size, Point2D off, Image <ushort> rawImage)
        {
            long half = (size.height + 1) >> 1;
            long y    = 0;

            for (int row = 0; row < size.height; row++)
            {
                y = row % half * 2 + row / half;
                var skip = (y + off.height) * rawImage.fullSize.dim.width + off.width;
                if (y == 1)
                {
                    // The second field starts at a 2048 byte aligment
                    long offset = ((half * size.width * 3 / 2 >> 11) + 1) << 11;
                    if (offset > input.RemainingSize)
                    {
                        throw new IOException("Decode12BitSplitRaw: Trying to jump to invalid offset " + offset);
                    }
                    input.Position = offset;
                }
                for (int x = 0; x < size.width; x += 2)
                {
                    uint g1 = input.ReadByte();
                    uint g2 = input.ReadByte();
                    rawImage.fullSize.rawView[skip + x] = (ushort)((g1 << 4) | (g2 >> 4));
                    uint g3 = input.ReadByte();
                    rawImage.fullSize.rawView[skip + x + 1] = (ushort)(((g2 & 0x0f) << 8) | g3);
                }
            }
        }
Пример #2
0
        public SOFInfo GetSOF(uint offset, uint size)
        {
            // JPEG is big endian
            if (Common.GetHostEndianness() == Endianness.Big)
            {
                input = new ImageBinaryReader(input.BaseStream, offset);
            }
            else
            {
                input = new ImageBinaryReaderBigEndian(input.BaseStream, offset);
            }

            if (GetNextMarker(false) != JpegMarker.SOI)
            {
                throw new RawDecoderException("Image did not start with SOI. Probably not an LJPEG");
            }

            while (true)
            {
                JpegMarker m = GetNextMarker(true);
                if (m == JpegMarker.Sof3)
                {
                    SOFInfo sof = new SOFInfo();
                    ParseSOF(sof);
                    return(sof);
                }
                if (m == JpegMarker.EOI)
                {
                    throw new RawDecoderException("Could not locate Start of Frame.");
                }
            }
        }
Пример #3
0
 private void DecodeUncompressed(ImageBinaryReader input, uint width, uint height, long size, Endianness endian)
 {
     /*
      *   RawDecompressor.Decode12BitRawWithControl(s, w, h, rawImage);
      * else if ((hints.ContainsKey("jpeg32_bitorder")))
      * {
      *   Point2D dim = new Point2D(w, h), pos = new Point2D(0, 0);
      *   RawDecompressor.ReadUncompressedRaw(s, dim, pos, w * 12 / 8, 12, BitOrder.Jpeg32, rawImage);
      * }
      * else*/
     if (size >= width * height * 2)
     { // We're in an unpacked raw
         if (endian == Endianness.Little)
         {
             RawDecompressor.Decode12BitRawUnpacked(input, new Point2D(width, height), new Point2D(), rawImage);
         }
         else
         {
             RawDecompressor.Decode12BitRawBEunpackedLeftAligned(input, new Point2D(width, height), new Point2D(), rawImage);
         }
     }
     else if (size >= width * height * 3 / 2)
     { // We're in one of those weird interlaced packed raws
         RawDecompressor.Decode12BitRawBEInterlaced(input, new Point2D(width, height), new Point2D(), rawImage);
     }
     else
     {
         throw new RawDecoderException("ORF Decoder: Don't know how to handle the encoding in this file\n");
     }
 }
Пример #4
0
 /* This will attempt to parse makernotes and return it as an IFD */
 //makernote should be self contained
 Makernote ParseMakerNote(ImageBinaryReader reader, Tag tag, Endianness parentEndian)
 {
     //read twice the makernote lenght, should be enough
     reader.BaseStream.Position = tag.dataOffset + RelativeOffset;
     byte[] data = reader.ReadBytes((int)Math.Min(tag.dataCount * 3, reader.BaseStream.Length));
     return(ParseMakerNote(data, parentEndian, (int)tag.dataOffset));
 }
Пример #5
0
        public static void Decode10BitRaw(ImageBinaryReader input, Point2D size, Point2D offset, Image <ushort> rawImage)
        {
            int off   = (int)(size.width * 10) / 8;
            var pumps = new byte[size.height][];

            //read the data
            for (int i = 0; i < size.height; i++)
            {
                pumps[i] = input.ReadBytes(off);
            }

            Parallel.For(0, size.height, i =>
            {
                long pos    = (i + offset.height) * rawImage.fullSize.dim.width + offset.width;
                var data    = pumps[i];
                var bytePos = 0;
                for (uint x = 0; x < size.width;)
                {
                    rawImage.fullSize.rawView[pos + x++] = (ushort)((data[bytePos++] << 2) + (data[bytePos] >> 6));
                    rawImage.fullSize.rawView[pos + x++] = (ushort)(((data[bytePos++] & 63) << 4) + (data[bytePos] >> 4));
                    rawImage.fullSize.rawView[pos + x++] = (ushort)(((data[bytePos++] & 15) << 6) + (data[bytePos] >> 2));
                    rawImage.fullSize.rawView[pos + x++] = (ushort)(((data[bytePos++] & 3) << 8) + data[bytePos++]);
                }
                pumps[i] = null;
            });
        }
Пример #6
0
 internal PanaBitpump(ImageBinaryReader _input, uint load)
 {
     var temp = _input.ReadBytes((int)_input.RemainingSize);
     Array.Resize(ref temp, temp.Length + 32);
     input = new ImageBinaryReader(temp);
     vbits = 0;
     load_flags = (int)load;
 }
Пример #7
0
 public NikonDecompressor(ImageBinaryReader file, RawImage img) : base(file, img, false, false)
 {
     huff[0] = new NikonHuffman();
     for (int i = 0; i < 0x8000; i++)
     {
         curve[i] = (ushort)i;
     }
 }
Пример #8
0

        
Пример #9
0
 /*
  * Huffman table generation:
  * HuffDecode,
  * createHuffmanTable
  * and used data structures are originally grabbed from the IJG software,
  * and adapted by Hubert Figuiere.
  *
  * Copyright (C) 1991, 1992, Thomas G. Lane.
  * Part of the Independent JPEG Group's software.
  * See the file Copyright for more details.
  *
  * Copyright (c) 1993 Brian C. Smith, The Regents of the University
  * of California
  * All rights reserved.
  *
  * Copyright (c) 1994 Kongji Huang and Brian C. Smith.
  * Cornell University
  * All rights reserved.
  *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation for any purpose, without fee, and without written agreement is
  * hereby granted, provided that the above copyright notice and the following
  * two paragraphs appear in all copies of this software.
  *
  * IN NO EVENT SHALL CORNELL UNIVERSITY BE LIABLE TO ANY PARTY FOR
  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF CORNELL
  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * CORNELL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  * ON AN "AS IS" BASIS, AND CORNELL UNIVERSITY HAS NO OBLIGATION TO
  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  */
 public JPEGDecompressor(ImageBinaryReader file, RawImage img, bool DNGCompatible, bool UseBigTable)
 {
     raw   = img;
     input = file;
     this.DNGCompatible = DNGCompatible;
     this.UseBigTable   = UseBigTable;
     huff = new HuffmanTable[4];
 }
Пример #10
0
        private void GetData(ImageBinaryReader fileStream)
        {
            data = new Object[dataCount];
            for (int j = 0; j < dataCount; j++)
            {
                switch (dataType)
                {
                case TiffDataType.BYTE:
                case TiffDataType.UNDEFINED:
                case TiffDataType.ASCII:
                    data[j] = fileStream.ReadByte();
                    break;

                case TiffDataType.SHORT:
                    data[j] = fileStream.ReadUInt16();
                    break;

                case TiffDataType.LONG:
                case TiffDataType.OFFSET:
                    data[j] = fileStream.ReadUInt32();
                    break;

                case TiffDataType.SBYTE:
                    data[j] = fileStream.ReadSByte();
                    break;

                case TiffDataType.SSHORT:
                    data[j] = fileStream.ReadInt16();
                    //if ( dataOffset == 0 &&  dataCount == 1) fileStream.ReadInt16();
                    break;

                case TiffDataType.SLONG:
                    data[j] = fileStream.ReadInt32();
                    break;

                case TiffDataType.SRATIONAL:
                case TiffDataType.RATIONAL:
                    //Because the nikonmakernote is broken with the tag 0x19 wich is double but offset of zero.
                    if (dataOffset == 0)
                    {
                        data[j] = .0;
                    }
                    else
                    {
                        data[j] = fileStream.ReadRational();
                    }
                    break;

                case TiffDataType.FLOAT:
                    data[j] = fileStream.ReadSingle();
                    break;

                case TiffDataType.DOUBLE:
                    data[j] = fileStream.ReadDouble();
                    break;
                }
            }
        }
Пример #11
0
        protected void Parse(uint offset)
        {
            //parse the ifd
            if (stream.Length < 16)
            {
                throw new RawDecoderException("Not a TIFF file (size too small)");
            }
            Endianness endian = Endianness.Little;

            byte[] data = new byte[5];
            stream.Position = offset;
            stream.Read(data, 0, 4);
            if (data[0] == 0x4D || data[1] == 0x4D)
            {
                //open binaryreader
                reader = new ImageBinaryReaderBigEndian(stream);
                endian = Endianness.Big;
                if (data[3] != 42 && data[3] != 0x4f) // ORF sometimes has 0x4f!
                {
                    throw new RawDecoderException("Not a TIFF file (magic 42)");
                }
            }
            else if (data[0] == 0x49 || data[1] == 0x49)
            {
                reader = new ImageBinaryReader(stream);
                if (data[2] != 42 && data[2] != 0x52 && data[2] != 0x55) // ORF has 0x52, RW2 0x55!
                {
                    throw new RawDecoderException("Not a TIFF file (magic 42)");
                }
            }
            else
            {
                throw new RawDecoderException("Not a TIFF file (ID)");
            }
            reader.Position = offset + 4;

            var newIfd = new IFD(reader, reader.ReadUInt32(), endian, 0, (int)offset);

            if (ifd == null)
            {
                ifd = newIfd;
            }
            else
            {
                ifd.subIFD.Add(newIfd);
            }
            uint nextIFD = newIfd.NextOffset;

            while (nextIFD != 0)
            {
                ifd.subIFD.Add(new IFD(reader, nextIFD, endian, 0, (int)offset));
                if (ifd.subIFD.Count > 100)
                {
                    throw new RawDecoderException("TIFF file has too many Sub IFDs, probably broken");
                }
                nextIFD = (ifd.subIFD[ifd.subIFD.Count - 1]).NextOffset;
            }
        }
Пример #12
0
 public LJPEGPlain(ImageBinaryReader file, RawImage img, bool DNGCompatible, bool UseBigTable) : base(file, img, DNGCompatible, UseBigTable)
 {
     huff = new HuffmanTable[4] {
         new HuffmanTable(UseBigTable, DNGCompatible),
         new HuffmanTable(UseBigTable, DNGCompatible),
         new HuffmanTable(UseBigTable, DNGCompatible),
         new HuffmanTable(UseBigTable, DNGCompatible)
     };
 }
Пример #13
0
 public BitPumpMSB32(ImageBinaryReader reader, long offset, long count)
 {
     MIN_GET_BITS = (BITS_PER_LONG_LONG - 33);
     size         = count + sizeof(uint);
     buffer       = new byte[size];
     reader.BaseStream.Position = offset;
     reader.BaseStream.Read(buffer, 0, (int)count);
     Init();
 }
Пример #14
0
 public BitPumpJPEG(ImageBinaryReader reader, uint offset, uint count)
 {
     MIN_GET_BITS = (BITS_PER_LONG - 7);
     size         = (uint)(reader.RemainingSize + sizeof(uint));
     buffer       = new byte[size];
     reader.BaseStream.Position = offset;
     reader.Read(buffer, 0, (int)reader.RemainingSize);
     Init();
 }
Пример #15
0
 public void ReadData(ImageBinaryReader fileStream)
 {
     if (data == null && dataOffset + parent_offset < fileStream.BaseStream.Length && dataOffset > 1)
     {
         long firstPosition = fileStream.Position;
         fileStream.Position = dataOffset + parent_offset;
         GetData(fileStream);
         fileStream.BaseStream.Position = firstPosition;
     }
 }
Пример #16
0
 public static void Decode16BitRawUnpacked(ImageBinaryReader input, Point2D size, Point2D offset, Image <ushort> rawImage)
 {
     for (int y = 0; y < size.height; y++)
     {
         var skip = (y + offset.height) * rawImage.fullSize.dim.width + offset.width;
         for (int x = 0; x < size.width; x += 1)
         {
             rawImage.fullSize.rawView[skip + x] = input.ReadUInt16();
         }
     }
 }
Пример #17
0
        public static void Decode8BitRaw(ImageBinaryReader input, Point2D size, Point2D offset, Image <ushort> rawImage)
        {
            var temp = input.ReadBytes((int)size.Area);

            Parallel.For(0, size.height, y =>
            {
                var skip = (y + offset.height) * rawImage.fullSize.UncroppedDim.width + offset.width;
                for (int x = 0; x < size.width; x++)
                {
                    rawImage.fullSize.rawView[skip + x] = temp[skip + x];
                }
            });
        }
Пример #18
0
 public static void Decode12BitRawUnpacked(ImageBinaryReader input, Point2D size, Point2D offset, Image <ushort> rawImage)
 {
     for (int y = 0; y < size.height; y++)
     {
         var pos = (y + offset.height) * rawImage.fullSize.dim.width + offset.width;
         for (int x = 0; x < size.width; x += 1)
         {
             uint g1 = input.ReadByte();
             uint g2 = input.ReadByte();
             rawImage.fullSize.rawView[pos + x] = (ushort)(((g2 << 8) | g1) >> 4);
         }
     }
 }
Пример #19
0
 public static void Decode14BitRawBEunpacked(ImageBinaryReader input, Point2D size, Point2D offset, Image <ushort> rawImage)
 {
     for (int y = 0; y < size.height; y++)
     {
         var skip = (y + offset.height) * rawImage.fullSize.dim.width + offset.width;
         for (int x = 0; x < size.width; x += 1)
         {
             uint g1 = input.ReadByte();
             uint g2 = input.ReadByte();
             rawImage.fullSize.rawView[skip + x] = (ushort)(((g1 & 0x3f) << 8) | g2);
         }
     }
 }
Пример #20
0
        private void DecodeCryptedUncompressed()
        {
            var data = ifd.GetIFDsWithTag(TagType.IMAGEWIDTH);

            if (data.Count == 0)
            {
                throw new RawDecoderException("ARW: SRF format, couldn't find width/height");
            }
            var raw = data[0];

            var  size = new Point2D(raw.GetEntry(TagType.IMAGEWIDTH).GetUInt(0), raw.GetEntry(TagType.IMAGELENGTH).GetUInt(0));
            uint len  = (size.Area * 2);

            // Constants taken from dcraw
            uint offtemp  = 862144;
            uint key_off  = 200896;
            uint head_off = 164600;

            // Replicate the dcraw contortions to get the "decryption" key
            base.reader.Position = key_off;;
            int offset = base.reader.ReadByte() * 4;

            base.reader.Position = key_off + offset;
            byte[] d   = base.reader.ReadBytes(4);
            uint   key = (((uint)(d[0]) << 24) | ((uint)(d[1]) << 16) | ((uint)(d[2]) << 8) | d[3]);

            base.reader.Position = head_off;
            byte[] head = base.reader.ReadBytes(40);

            SonyDecrypt(head, 10, key);

            for (int i = 26; i-- > 22;)
            {
                key = key << 8 | head[i];
            }

            // "Decrypt" the whole image buffer in place
            base.reader.Position = offtemp;
            byte[] imageData = base.reader.ReadBytes((int)len);

            SonyDecrypt(imageData, len / 4, key);

            // And now decode as a normal 16bit raw
            rawImage.fullSize.dim = new Point2D(size);
            rawImage.Init(false);
            using (ImageBinaryReader reader = new ImageBinaryReader(imageData, len))
            {
                RawDecompressor.Decode16BitRawUnpacked(reader, size, new Point2D(), rawImage);
            }
        }
Пример #21
0
        void DecodeUncompressed(IFD raw)
        {
            uint width  = raw.GetEntry(TagType.IMAGEWIDTH).GetUInt(0);
            uint height = raw.GetEntry(TagType.IMAGELENGTH).GetUInt(0);
            uint off    = raw.GetEntry(TagType.STRIPOFFSETS).GetUInt(0);

            rawImage.fullSize.dim = new Point2D(width, height);
            rawImage.Init(false);
            ImageBinaryReader input = new ImageBinaryReader(reader.BaseStream, off);

            /*
             *  RawDecompressor.Decode14BitRawBEunpacked(input, width, height, rawImage);
             */
            RawDecompressor.Decode16BitRawUnpacked(input, new Point2D(width, height), new Point2D(), rawImage);
        }
Пример #22
0
 public static void Decode12BitRawBE(ImageBinaryReader input, Point2D size, Point2D offset, Image <ushort> rawImage)
 {
     for (int y = 0; y < size.height; y++)
     {
         var pos = (y + offset.height) * rawImage.fullSize.dim.width + offset.width;
         for (int x = 0; x < size.width; x += 2)
         {
             uint g1 = input.ReadByte();
             uint g2 = input.ReadByte();
             rawImage.fullSize.rawView[pos + x] = (ushort)((g1 << 4) | (g2 >> 4));
             uint g3 = input.ReadByte();
             rawImage.fullSize.rawView[pos + x + 1] = (ushort)(((g2 & 0x0f) << 8) | g3);
         }
     }
 }
Пример #23
0
        void DecodeARW(ImageBinaryReader input, long w, long h)
        {
            BitPumpMSB bits = new BitPumpMSB(input);

            int sum = 0;

            for (long x = w; (x--) != 0;)
            {
                for (int y = 0; y < h + 1; y += 2)
                {
                    bits.Fill();
                    if (y == h)
                    {
                        y = 1;
                    }
                    int len = 4 - (int)bits.GetBits(2);
                    if (len == 3 && bits.GetBit() != 0)
                    {
                        len = 0;
                    }
                    if (len == 4)
                    {
                        while (len < 17 && bits.GetBit() == 0)
                        {
                            len++;
                        }
                    }
                    int diff = (int)bits.GetBits(len);
                    if (len != 0 && (diff & (1 << (len - 1))) == 0)
                    {
                        diff -= (1 << len) - 1;
                    }
                    sum += diff;
                    Debug.Assert((sum >> 12) == 0);
                    if (y < h)
                    {
                        rawImage.fullSize.rawView[x + y * rawImage.fullSize.dim.width] = (ushort)sum;
                    }
                }
            }
        }
Пример #24
0
        public FujiMakerNote(byte[] data, Endianness endian, int depth) : base(endian, depth)
        {
            ImageBinaryReader file;

            if (endian == Endianness.Little)
            {
                file = new ImageBinaryReader(data);
            }
            else if (endian == Endianness.Big)
            {
                file = new ImageBinaryReaderBigEndian(data);
            }
            else
            {
                throw new RawDecoderException("Endianness not correct " + endian);
            }
            file.BaseStream.Position = 12;
            RelativeOffset           = 0;
            Parse(file);
            file.Dispose();
        }
Пример #25
0
        private void DecodeA100()
        {
            // We've caught the elusive A100 in the wild, a transitional format
            // between the simple sanity of the MRW custom format and the wordly
            // wonderfullness of the Tiff-based ARW format, let's shoot from the hip
            var data = ifd.GetIFDsWithTag(TagType.SUBIFDS);

            if (data.Count == 0)
            {
                throw new RawDecoderException("ARW: A100 format, couldn't find offset");
            }
            var  raw    = data[0];
            uint offset = raw.GetEntry(TagType.SUBIFDS).GetUInt(0);
            uint w      = 3881;
            uint h      = 2608;

            rawImage.fullSize.dim = new Point2D(w, h);
            rawImage.Init(false);
            reader = new ImageBinaryReader(reader.BaseStream, offset);

            DecodeARW(reader, w, h);
        }
Пример #26
0
        public IFD(IFDType type, ImageBinaryReader fileStream, uint offset, Endianness endian, int depth, int relativeOffset) : this(endian, depth)
        {
            this.type = type;

            if (relativeOffset > 0)
            {
                fileStream.Position = offset + relativeOffset;
            }
            else
            {
                fileStream.Position = offset;
            }

            Offset         = offset;
            RelativeOffset = relativeOffset;
            if (depth > MaxRecursion)
            {
                throw new IndexOutOfRangeException();
            }

            Parse(fileStream);
        }
Пример #27
0
        public NikonMakerNote(byte[] data, int depth) : base(Endianness.Little, depth)
        {
            //read the header
            // buffer.BaseStream.Position = offset;
            StringMagic = "";
            for (int i = 0; i < 6; i++)
            {
                StringMagic += (char)data[i];
            }

            Version = (ushort)(data[8] << 8 | data[7]);
            //buffer.BaseStream.Position = 2 + offset;//jump the padding
            data = data.Skip(10).ToArray();
            //header = new Header(buffer, 0); //0 car beggining of the stream
            ImageBinaryReader buffer;

            if (data[0] == 0x4D && data[1] == 0x4D)
            {
                buffer = new ImageBinaryReaderBigEndian(data);
                endian = Endianness.Big;
            }
            else if (data[0] == 0x49 && data[1] == 0x49)
            {
                buffer = new ImageBinaryReader(data);
                endian = Endianness.Little;
            }
            else
            {
                throw new RawDecoderException("Makernote endianness unknown " + data[0]);
            }
            buffer.BaseStream.Position = 2;
            buffer.ReadUInt16();
            uint TIFFoffset = buffer.ReadUInt32();

            buffer.BaseStream.Position = TIFFoffset;
            Parse(buffer);
            //parse gps info
            buffer.Dispose();
        }
Пример #28
0
        public Makernote(byte[] data, uint offset, Endianness endian, int depth, int parentOffset) : base(endian, depth)
        {
            type = IFDType.Makernote;
            ImageBinaryReader file;

            if (endian == Endianness.Little)
            {
                file = new ImageBinaryReader(data);
            }
            else if (endian == Endianness.Big)
            {
                file = new ImageBinaryReaderBigEndian(data);
            }
            else
            {
                throw new RawDecoderException("Endianness not correct " + endian);
            }

            file.BaseStream.Position = offset;
            RelativeOffset           = -parentOffset;
            Parse(file);
            file.Dispose();
        }
Пример #29
0
        public Tag(ImageBinaryReader fileStream, int baseOffset)
        {
            parent_offset = baseOffset;
            TagId         = (TagType)fileStream.ReadUInt16();
            dataType      = (TiffDataType)fileStream.ReadUInt16();
            if (TagId == TagType.FUJI_RAW_IFD)
            {
                if (dataType == TiffDataType.OFFSET) // FUJI - correct type
                {
                    dataType = TiffDataType.LONG;
                }
            }

            dataCount  = fileStream.ReadUInt32();
            dataOffset = 0;
            if (((dataCount * dataType.GetTypeSize() > 4)))
            {
                dataOffset = fileStream.ReadUInt32();
            }
            else
            {
                GetData(fileStream);
                int k = (int)dataCount * dataType.GetTypeSize();
                if (k < 4)
                {
                    fileStream.ReadBytes(4 - k);
                }
            }

            /*            if (dataOffset < fileStream.BaseStream.Length && dataOffset > 1)
             * {
             *  long firstPosition = fileStream.Position;
             *  fileStream.Position = dataOffset + parent_offset;
             *  GetData(fileStream);
             *  fileStream.BaseStream.Position = firstPosition;
             * ¨*/
        }
Пример #30
0
        public PanasonicMakernote(byte[] data, Endianness endian, int depth) : base(endian, depth)
        {
            //start wth a tiff headder

            this.type = IFDType.Makernote;
            ImageBinaryReader file;

            if (endian == Endianness.Little)
            {
                file = new ImageBinaryReader(data);
            }
            else if (endian == Endianness.Big)
            {
                file = new ImageBinaryReaderBigEndian(data);
            }
            else
            {
                throw new RawDecoderException("Endianness not correct " + endian);
            }

            file.BaseStream.Position = 8;
            Parse(file);
            file.Dispose();
        }