Relation between FileSize and the size of a file on the disk

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, xnview

Post Reply
Nols Smit
Posts: 16
Joined: Mon Jun 27, 2005 6:38 pm

Relation between FileSize and the size of a file on the disk

Post by Nols Smit »


Refering to the example images in the data folder of the installation folder:
C:\Program Files\GflSDK\data

I'm a bit (even a byte) confused. If I use IrfanView and open test2 in the folder, then the image properties are:
Disk size: 196.84 KB (201 560 bytes)
Current memory size: 600.04 KB (614 440 bytes)

I presume the difference is because of the LZW compression.

But if I extract the FileSize and Compression properties, via the GFL SDK library, with the statements:
e := gflLoadBitmap(PChar(filename), gfl_bmp, lp, finfo);
lblSize.Caption := IntToStr(finfo.FileSize);
lblCompression.Caption := IntToStr(finfo.Compression);

lblSize (a label on a Delphi window) displays 65536 and
lblCompression (also a label on the Delphi window) displays 101

My question:
What is the relation between finfo.FileSize and finfo.Compression and the size on disk of 201 560 bytes ?

The reason whay I ask is because I want to resize and compress images before loading them into a database.


Nols Smit
Post Reply