Re: Once and for all! Fastest way to load large jpeg




My program is a kiosk for viewing and ordering digital images and is
reading external drives so the program is always working from cd or usb
that's why the premium on loading large images. Cameras are producing
larger photos. Media can hold hundreds of photos. I have to display a
reasonable sized image for inspection so when the thumb is clicked I
load from the media.

Right, so the photos are all different, that rules out caching.

Sorry. Still confused.

If you are just reading the file once, then 'remembering' it is not
going to help much.

Understood.

<snip>
How about kicking off a separate App that generates the thumbnails in
the back ground, that way you'll be using the processor while the user
is twiddling with the mouse.

The thumbs are no problem.

<snip>

User chooses folder from directorylistbox populating a filelistbox.
I create an object for each entry with path and other relevant info and
add it to an array with a common index to the filelistbox. So I use
whichever is convenient.

Where exactly are those JPEGs coming from

CD USB or any external drive.

How long do you want to keep the JPEGs

In practice only long enough to assign it to the larger TImage. I free
it immediately. See original example.
<snip>

Could you explain the 4mb
- do you mean that a 4mb file is slow to load ?

Yes from external media. I orginally tested with 2MB files from various
cameras. When I started testing with larger 4MB+ files the speed is
borderline acceptable. I need to improve loading the image from disk
somehow in order to properly support large files.

If that is the case, you could try reading the entire file into a
memory stream and then use LoadFromStream
- I'm not sure, but it could cut down on physical disk reads

I found this. Would this help?
var
bm2: TBitmap;
st: TMemoryStream;
begin
bm2:= TBitmap.Create;

bm2.PixelFormat := pf24bit;
bm2.Width := 256 ;
bm2.Height := 256 ;

st := TMemoryStream.Create;
bm2.SaveToStream (st);
st.Seek( - (256*256*3), soFromEnd);
st.WriteBuffer( ColorArray[ScrollPos,0,0,1] , 256*256*3);
st.Seek(0, soFromBeginning );
bm2.LoadFromStream(st);
Image1.Picture.Bitmap := bm2;
bm2.Destroy ;
st.Destroy;

end;
Jim

.



Relevant Pages

  • Re: Erasing women
    ... anti-semitism in western or Islamic media. ... images is the point really carried. ... media intended for men will have the effect of marginalizing the role ... Take one of the iconic photos of the mid-twentieth century: ...
    (soc.culture.jewish.moderated)
  • Re: The National.
    ... gathering to the media. ... cameras or on them they will just confescate the camera or cameras. ... summer the LEOs were outnumbered; so, ... Cussing out those you really should be educating is not waging Peace. ...
    (alt.gathering.rainbow)
  • Re: Using WindowsXP explorer as a database.
    ... > won't compromize future viewing of these photos. ... >> a particular application to view it might make your media incompatable ... >> You would want to use the TIFF format for conversion to other formats ... >> support for computer viewing on anouther, and a VCD or DVD to ...
    (microsoft.public.windowsxp.basics)
  • Re: The National.
    ... gathering to the media. ... cameras or on them they will just confescate the camera or cameras. ... summer the LEOs were outnumbered; so, ... Cussing out those you really should be educating is not waging Peace. ...
    (alt.gathering.rainbow)
  • Re: The National.
    ... The media are always there at the big gathering. ... planning on 'escorting' the media, pointing out only the well kept ... Popeye, you said you can't afford jail, can you afford to pay fire ... cameras or on them they will just confescate the camera or cameras. ...
    (alt.gathering.rainbow)