DcsDecoder(TiffIFD *rootIFD, FileMap *file);
void ParseFuji(UInt32 offset, TiffIFD *target_ifd);
TiffIFD(ref FileMap f, UInt32 offset, UInt32 _depth) { TIFF_DEPTH(_depth); mFile = f; ushort[] entries; entries = *(ushort*)f.getData(offset, 2); // Directory entries in this IFD for (UInt32 i = 0; i < entries; i++) { int entry_offset = (int)(offset + 2 + i * 12); // If the space for the entry is no longer valid stop reading any more as // the file is broken or truncated if (!mFile.isValid(entry_offset, 12)) break; TiffEntry t = null; try { t = new TiffEntry(f, entry_offset, offset); } catch (IOException) { // Ignore unparsable entry continue; } switch (t.tag) { case DNGPRIVATEDATA: { try { TiffIFD* maker_ifd = parseDngPrivateData(t); mSubIFD.push_back(maker_ifd); delete(t); } catch (TiffParserException) { // Unparsable private data are added as entries mEntry[t.tag] = t; } catch (IOException) { // Unparsable private data are added as entries mEntry[t.tag] = t; } } break; case MAKERNOTE: case MAKERNOTE_ALT: { try { mSubIFD.push_back(parseMakerNote(f, t.getDataOffset(), endian)); delete(t); } catch (TiffParserException) { // Unparsable makernotes are added as entries mEntry[t.tag] = t; } catch (IOException) { // Unparsable makernotes are added as entries mEntry[t.tag] = t; } } break; case FUJI_RAW_IFD: if (t.type == 0xd) // FUJI - correct type t.type = TIFF_LONG; case SUBIFDS: case EXIFIFDPOINTER: try { for (UInt32 j = 0; j < t.count; j++) { mSubIFD.push_back(new TiffIFD(f, t.getInt(j), depth)); } delete(t); } catch (TiffParserException) { // Unparsable subifds are added as entries mEntry[t.tag] = t; } catch (IOException) { // Unparsable subifds are added as entries mEntry[t.tag] = t; } break; default: mEntry[t.tag] = t; } } nextIFD = *(align1_int*)f.getData(offset + 2 + entries * 12, 4); }
ThreefrDecoder(TiffIFD *rootIFD, FileMap *file);