[fpc-pascal] Why is FPImage dog slow in reading jpeg's?

Mattias Gaertner nc-gaertnma at netcologne.de
Mon May 30 17:05:57 CEST 2011


 Tomas Hajny <XHajT03 at hajny.biz> hat am 30. Mai 2011 um 16:50 geschrieben:

 > On Mon, May 30, 2011 16:16, michael.vancanneyt at wisa.be wrote:
 > >
 > > Try the following code:
 > >
 > > Img:=TFPMemoryImage.Create(0,0);
 > > Img.UsePalette:=False;
 > > Img.loadFromFile(FileList[i]);
 > >
 > > That should work much faster. The reason is probably that the default
 > > image
 > > created by the reader uses a palette, which is of course dog slow when
 > > reading
 > > large images.
 > Interesting. What is supposed to be a "large image"? I ask because the
 > original post mentioned 35 kB and 65 kB (and indirectly also dimensions
 > around 600x400 if I understand the program output correctly) which I
 > certainly wouldn't consider as "large" (and the mentioned time necessary
 > for reading it surely not appropriate regardless of using palette or not).
 > I guess that some optimization may be reasonable because such pictures
 > could be loaded and displayed (including conversion from true colour to
 > 256 colours palette) faster even on a 486 machine...
 Is there any size, where a palette image is fast?

 I think this is a newbie trap and the default for UsePalette should be changed.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110530/e9dba889/attachment.html>

More information about the fpc-pascal mailing list