Recent

Author Topic: Smart handling of jpeg  (Read 4450 times)

Eric S

  • Newbie
  • Posts: 2
Smart handling of jpeg
« on: July 02, 2011, 02:25:39 pm »
Hi all,

I want to develop a small software for my PDA (arm, win mobile) that performs some analysis on jpeg pictures. Indeed, it seems that I can't load large picture in my software due to the small amount of memory available for all the running softwares. From what I'm understanding, only 30 MB are available for all softwares.

I did a small test :
Code: [Select]
var
  JpegImage : TJpegImage;
begin
  if OpenDialog1.Execute then
  begin
    JpegImage := TJpegImage.Create;
    try
      JPegImage.LoadFromFile(OpenDialog1.FileName);
      showMessage(Format('Largeur %d Hauteur %d',[JPegImage.Width, JPegImage.Height]));
    finally
      JPegImage.Free;
    end;
  end;
end; 

Under Windows Mobile, it crashes with Access Violation when trying to load 4000x3000 pixels picture. It's ok with 1200x900 pixels. And it's ok under Win32.

So, now, I'm looking for methods to handle my picture without full loading in memory:
- as I'm only interested in the black&white part of the picture, is it possible to only load the luminance part of the jpeg picture?
- is there a way to load a reduced version (1/2, 1/4 or 1/8) of the jpeg picture?
- a way of parsing the picture line by line without loading in memory?

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Smart handling of jpeg
« Reply #1 on: July 02, 2011, 08:07:33 pm »
Of course if you have enough knowledge of the file format, you can edit it on a stream or even on the file itself. But this forum is not the right place to know about the file format.
« Last Edit: July 02, 2011, 11:01:20 pm by typo »

Eric S

  • Newbie
  • Posts: 2
Re: Smart handling of jpeg
« Reply #2 on: July 02, 2011, 08:25:38 pm »
Yes, I can start from scratch but I would save time if some libraries can help me. For instance, loading fractions of the picture seems on the way.

 

TinyPortal © 2005-2018