0

I was wondering if it is possible to load a huge JPEG (see my previous question there) and save it / use it in a quickly-loadable format, without loading its fully decoded contents into memory.

The main idea is to have a file format (or a function I'm not aware of which would do that natively in Java) allowing to load dynamically a given area of the image, without loading 800MB of data.

I'm actually using a tiling algorithm to render the image, but it needs to load the full image (thanks to mKorbel and Gerard Le Blanc), but this "preloading" step remains quite long.

I don't figure out how to do that (and first of all, is it possible ?), since Google did not help me a lot (maybe bad-english searching ?)

Community
  • 1
  • 1
Benj
  • 1,184
  • 7
  • 26
  • 57
  • related: http://stackoverflow.com/questions/12022675/decode-part-of-jpeg-file - You have to *decode* it; you don't have to keep it all in memory. – Brian Roach Dec 10 '12 at 00:32
  • @Brian Roach : OK thanks, I will investigate this way. I will post comments or answer when done. – Benj Dec 10 '12 at 01:37
  • It's a bit of a difficult problem because you're trying to deal with a portion of a lossy, compressed format at a time. – Brian Roach Dec 10 '12 at 01:44
  • Yes, I'm aware of the Huffman compression algorithm used in JPEG encoding. I'm investigating in Greg Hewills "When you get the callback from libjpeg for each row, just wait until the row number matches the section of scanlines you want" way. Not sure I post an answer quickly, but I will post it. – Benj Dec 10 '12 at 19:37

1 Answers1

0

I found what I needed there :

very large image manipulation and tiling

The Java JAI lib has a lot of features to handle these kind of problems, and is supported by Oracle, which means it is (theoretically) stable and sustainable.

Thanks to @BryanD !

Community
  • 1
  • 1
Benj
  • 1,184
  • 7
  • 26
  • 57