- uint8_t *localRaw = Raw;
- // Loop on the fragment[s]
- for( JPEGFragmentsInfo::JPEGFragmentsList::iterator
- it = JPEGInfo->Fragments.begin();
- it != JPEGInfo->Fragments.end();
- ++it )
- {
- fp->seekg( (*it)->Offset, std::ios::beg);
-
- (*it)->DecompressJPEGFramesFromFile(fp, localRaw, BitsStored );
-
- // Advance to next free location in Raw
- // for next fragment decompression (if any)
- int length = XSize * YSize * SamplesPerPixel;
- int numberBytes = BitsAllocated / 8;
-
- localRaw += length * numberBytes;
- }
+ // Pointer to the Raw image
+ //uint8_t *localRaw = Raw;
+
+ // Precompute the offset localRaw will be shifted with
+ int length = XSize * YSize * SamplesPerPixel;
+ int numberBytes = BitsAllocated / 8;
+
+// // Loop on the fragment[s]
+// for( JPEGFragmentsInfo::JPEGFragmentsList::iterator
+// it = JPEGInfo->Fragments.begin();
+// it != JPEGInfo->Fragments.end();
+// ++it )
+// {
+// (*it)->DecompressJPEGFramesFromFile(fp, localRaw, BitsStored );
+//
+// // Advance to next free location in Raw
+// // for next fragment decompression (if any)
+//
+// localRaw += length * numberBytes;
+// }
+ JPEGInfo->DecompressJPEGFramesFromFile(fp, Raw, BitsStored, numberBytes, length );