T O P I C R E V I E W |
skippix |
Posted - Dec 07 2017 : 04:32:26 Using Delphi 10.2, ImageEn 7.0.1.22.1842
Loading images from a StringList. Files are original files from a Canon 1Dx, could be .jpg, .cr2, or mix of both. Files are not always in the same folder, meaning I can't use FillFromDirectory. List may have as few as 1, as many as 2000. Average is about 200.
TImageMView properties: DefaultBottomText = iedtFileType DefaultTopText = iedtFilename DisplayMode = mdGrid ImageCacheSize = 200 StoreType = ietFastThumb ThreadPoolSize = 5
procedure TfmWorkflowManager.LoadImageGrid (slIn: TStringList);
var i: Integer;
begin
if (slIn.Count > 0) then
begin
imgMView.LockUpdate;
imgMView.Clear;
for i := 0 to slIn.Count-1 do
imgMView.MIO.LoadFromFile(slIn[i]);
imgMView.SelectedImage := 0;
imgMView.UnlockUpdate;
end;
end;
I have a TEdit with a numeric value to set the GridWidth. With it set to 16, I have thumbnails that are 112x112.
I loaded 832 files (416 .cr2 avg size 26mb, 416 .jpg avg size 7mb) in 26 seconds. I changed the GridWidth to 6, thumbnails recalculated to 300x300. The screen update was nearly instantaneous.
I loaded 134 files (67 .cr2 avg size 26mb, 67 .jpg avg size 7mb) in 1 seconds. I changed the GridWidth to 6, thumbnails recalculated to 300x300. Again, the screen update was nearly instantaneous.
However, when I go to reload the grid with only the jpgs, leaving the grid size at 6 columns of 300x300 thumbnails, the load crawls to 20 seconds.
My problem seems to be that if I load the grid with small thumbs, it's quick, but if I load with larger thumbs, the performance is terrible.
What do I need to do to get the same performance, regardless of GridWith and thumbsize?
TIA |
1 L A T E S T R E P L I E S (Newest First) |
xequte |
Posted - Dec 07 2017 : 20:24:57 Hi
If you are using TImageEnMView.StoreType=ietFastThumb, then you need to increase the ImageCacheSize to at least twice as many as are shown on screen.
Also, you should load files only as they are needed, e.g. using TImageEnMView.LoadFromFileOnDemand (for a single file) or the LoadOnDemand parameter for methods such as AppendFile.
FYI, in the next release you will be able to use FillFromList with a TStringList parameter.
Also, here is a new passage from the documentation of the upcoming version:
Thumbnail Performance
Because a TImageEnMView may potentially load and store thousands of files, you should optimize your settings to ensure the best performance. Take note of the following:
- Most importantly, decide whether the TImageEnMView should load and store full size images. If you are loading the content of a multi-page file, such as TIFF, for editing and display purposes then generally you will want TImageEnMView.StoreType=ietNormal. However, if you are displaying thousands of photos from a folder, for example, then you are better to use load only thumbnails (TImageEnMView.StoreType is ietThumb or ietFastThumb) - Load images only on demand (i.e. as they are displayed or needed). To do this, ensure the LoadOnDemand parameter is set for AppendImage, InsertImage, FillFromDirectory or FillFromFolder - Lock updating while performing batch operations (LockUpdate/UnlockUpdate) - Consider options to load EXIF thumbnails (TImageEnMView.EnableLoadEXIFThumbnails) or Windows Explorer thumbnails (TImageEnMView.EnableLoadExplorerThumbnails) - Increasing the size of the image cache can help with general performance (TImageEnMView.ImageCacheSize), especially if you are using TImageEnMView.StoreType=ietFastThumb
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
|
|