Hi.
Jpeg thumbnail can be very fast reading with scaling (1:2, 1:4, 1:8, 1:16). Unluckily libgfl doesn't use this possibility. Is possible to add such new field into GFL_LOAD_PARAMS structure (exemplary GFL_JPEG_SCALE)and new feature for jpeg file reading? It's very useful for thumbnails list etc.
New feature 'Scale' for jpeg reading
Moderators: XnTriq, helmut, xnview
-
- Author of XnView
- Posts: 44355
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: New feature 'Scale' for jpeg reading
When you load jpeg thumbnail, i use the more closed scale factor.Anonymous wrote:Jpeg thumbnail can be very fast reading with scalling (1:2, 1:4, 1:8, 1:16). Unluckily libgfl doesn't use this possibility. Is possible to add such new field into GFL_LOAD_PARAMS structure (exemplary GFL_JPEG_SCALE)and new feature for jpeg file reading? It's very useful for thumbnails list etc.
Pierre.
-
- Author of XnView
- Posts: 44355
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Yes, all is identical, One and only difference is in file reading:xnview wrote:But with the same thumbnail size?
Original files are JPEG 2048x1536 px (or 1536x2048).
// gflLoadThumbnail(PChar(filename), w, h, gfl_bmp, lp, finfo);
// w:=120, h:=120; work 350-520 milliseconds
My subprocedure (in Delphi only, without GFL):
//(...)
Thumb.LoadFromFile(FileName);
if Thumb is TJPEGImage then
begin
TJPEGImage(Thumb).Scale := jsEighth; // look delphi help - below
TJPEGImage(Thumb).Performance := jpBestSpeed;
Result:=true;
end;
BMP := bmpScaling(Thumb, w, h);
// w:=120, h:=120; 90-150 milliseconds
Pozdrawiam, regards
------------------------
Description of TJPEGImage.Scale property from Delphi 6 Help:
Determines the size of the JPEG image when it is displayed.
Use Scale to optimize performance for previewing an image. jsFullSize displays the image as maximum size, whereas jsEighth displays an eighth of the image size, but 8 times faster.
TJPEGScale is the type of the Scale property. The following table lists the values of TJPEGScale:
Value Meaning
jsFullSize Displays a full-sized image.
(...)
jsEighth Displays an eighth-size image in an eighth of the time it takes to display a full-sized image.
Scale it used for reading in files, that is, for decompression.
------------------------
-
- Author of XnView
- Posts: 44355
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
But in the 2 cases, do you have a thumbnail of 120x120 after loading?Anonymous wrote:Yes, all is identical, One and only difference is in file reading:xnview wrote:But with the same thumbnail size?
Original files are JPEG 2048x1536 px (or 1536x2048).
// gflLoadThumbnail(PChar(filename), w, h, gfl_bmp, lp, finfo);
// w:=120, h:=120; work 350-520 milliseconds
My subprocedure (in Delphi only, without GFL):
//(...)
Thumb.LoadFromFile(FileName);
if Thumb is TJPEGImage then
begin
TJPEGImage(Thumb).Scale := jsEighth; // look delphi help - below
TJPEGImage(Thumb).Performance := jpBestSpeed;
Result:=true;
end;
BMP := bmpScaling(Thumb, w, h);
// w:=120, h:=120; 90-150 milliseconds
Pierre.
Yes, but look:xnview wrote:But in the 2 cases, do you have a thumbnail of 120x120 after loading?
Code: Select all
gflLoadThumbnail(PChar(filename), w, h, gfl_bmp, lp, finfo);
// Here is of course 120x120.
Code: Select all
Thumb.LoadFromFile(FileName);
TJPEGImage(jpg).Scale := jsFullSize;
// Now is 1/8 original size (e.g for original size 2048x1536 thumb. is 256x192)
// (....)
BMP := bmpScaling(Thumb, w, h);
// After scalling is 120x120. All time (reading + scalling is 90-150 msec)
Sorry, i have bugs in previous post, below is correct:
Yes, but look:
In my procedure:
Yes, but look:
Code: Select all
gflLoadThumbnail(PChar(filename), w, h, gfl_bmp, lp, finfo);
// Here is of course 120x120.
Code: Select all
Thumb.LoadFromFile(FileName);
TJPEGImage(Thumb).Scale := jsEight;
// Now is 1/8 original size (e.g for original size 2048x1536 thumb. is 256x192)
// (....)
BMP := bmpScaling(Thumb, w, h);
// After scalling is 120x120. All time (reading + scalling is 90-150 msec)