Jump to content
Software FX Community

Problem with file sizes


User (Legacy)

Recommended Posts

Hello!

Please look at the attached .zip file. It contain 2 chart files, 4.chd and

5.chd.

The charts are very similar but the file sizes are 20 and 60 KB (i.e. 3

times different).

Both charts were saved using the same method.

m_pChartFX->ShowDialog(CDIALOG_EXPORTFILE, 0);

Using the Export() method with FileMask property set to FMASK_ALL &

~(FMASK_PRINTERINFO|FMASK_DATA|FMASK_SIZEDATA) gives the same results.

- Why there is such a big difference?

It looks to me that the 5.chd file contains lots of unnecessary "garbage".

- How can I avoid it? Is there any flag to minimize the file size?

This problem is very important forour application because it saves many

charts into a single file and the file becomes very big.

Thanks in advance,

Serge S. Spiridonoff

Link to comment
Share on other sites

Other than saving less stuff (taking more flags out of the file mask) there

in no way to reduce the file size.

If you only want to save a few properties, you may want to think about

saving them on your own (getting the values from the chart and then saving

them).

One thing I didn't get clearly was: How are these files different ? where

they saved with different Chart FX versions or with different file masks ?

FP

Software FX Support

"Serge S. Spiridonoff" <ns_serg2409@yandex.ru> wrote in message

news:qWb3Vns2DHA.3808@WEBSERVER1...

> Hello!

>

> Please look at the attached .zip file. It contain 2 chart files, 4.chd and

> 5.chd.

>

> The charts are very similar but the file sizes are 20 and 60 KB (i.e. 3

> times different).

>

> Both charts were saved using the same method.

> m_pChartFX->ShowDialog(CDIALOG_EXPORTFILE, 0);

>

> Using the Export() method with FileMask property set to FMASK_ALL &

> ~(FMASK_PRINTERINFO|FMASK_DATA|FMASK_SIZEDATA) gives the same results.

>

> - Why there is such a big difference?

> It looks to me that the 5.chd file contains lots of unnecessary "garbage".

>

> - How can I avoid it? Is there any flag to minimize the file size?

>

> This problem is very important forour application because it saves many

> charts into a single file and the file becomes very big.

>

> Thanks in advance,

> Serge S. Spiridonoff

>

>

>

Link to comment
Share on other sites

SFS> Other than saving less stuff (taking more flags out of the file

SFS> mask) there in no way to reduce the file size.

As I wrote previously, FileMask property doesn't help - the file sizes

remain very different.

What I need to achieve is to reduce the second chart file to 20 KB down from

60 KB.

If 20 KB is necessary to store chart settings then let it be so. But 60 KB

for a very similar chart is not acceptable in this case.

We have complains from our customers asking "why this file is 1 MB while the

other is only 300 KB and both contain the same charts"?

SFS> If you only want to save a few properties, you may want to think

SFS> about saving them on your own (getting the values from the chart

SFS> and then saving them).

No, we need to save all properties so that a re-loaded chart looks exactly

the same as it was originally created and customized by the customers.

SFS> One thing I didn't get clearly was: How are these files different ?

SFS> where they saved with different Chart FX versions or with different

SFS> file masks ?

Different Chart FX versions - may be but I don't know for sure.

Different file masks - not. Our application uses _the_same_file_mask_ all

the time.

Our customers have sent us 2 files, 300 KB and 1 MB in size (let's call them

A and B), both containing 16 charts.

The corresponding charts in A and B are very similar or even the same.

I opened both files in our application and saved each chart as a separate

.CHD file.

Then compared the CHD files and found that all charts from A are about 20 KB

while the charts from B take 60-70 KB.

The customers say that the file A was created quite a long time ago while

the file B was created recently. (And they were very suprised that the new

file was 3 times bigger).

So it may be possible that the charts from the file A were created with an

older version of Chart FX.

My main question is what information takes those extra 40 KB in the larger

file?

I need to remove that extra data.

I don't have Chart FX source code so can't check what is stored in the file

by myself.

Could you please step the loading method under the debugger to see what

extra data is contained in the bigger file?

Also, I don't understand why the older (and smaller) file, when loaded and

re-saved with the latest build of Chart FX, remains small and doesn't

increase to 60 KB.

I can log this issue in your support DB if you like (I have a support

account).

Serge

SFS> FP

SFS> Software FX Support

SFS> "Serge S. Spiridonoff" <ns_serg2409@yandex.ru> wrote in message

SFS> news:qWb3Vns2DHA.3808@WEBSERVER1...

>> Hello!

>> Please look at the attached .zip file. It contain 2 chart files,

>> 4.chd and

>> 5.chd.

>> The charts are very similar but the file sizes are 20 and 60 KB (i.e.

>> 3 times different).

>> Both charts were saved using the same method.

>> m_pChartFX->ShowDialog(CDIALOG_EXPORTFILE, 0);

>> Using the Export() method with FileMask property set to FMASK_ALL &

>> ~(FMASK_PRINTERINFO|FMASK_DATA|FMASK_SIZEDATA) gives the same

>> results.

>> - Why there is such a big difference?

>> It looks to me that the 5.chd file contains lots of unnecessary

>> "garbage".

>> - How can I avoid it? Is there any flag to minimize the file size?

>> This problem is very important forour application because it saves

>> many charts into a single file and the file becomes very big.

>> Thanks in advance,

>> Serge S. Spiridonoff

With best regards, Serge S. Spiridonoff. E-mail: ns_serg2409@yandex.ru

Link to comment
Share on other sites

The files are different because the charts contain different information.

For example Per-Series attributes, more data, constant lines and stripes,

toolbar customization, etc. will affect the file size.

The bottom line is you can not control the file size, a default chart with

just a few points will occupy less space that a fully customized chart with

new toolbar icons, per-series attributes, lots of data, etc. The space used

is the space require no more and no less.

There is nothing I can do to help you reduce the file size other than limit

the functionality that you can use. Why is the file size such a big deal for

you ? I mean 60K is still pretty small for today's disk sizes.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

SFS> The files are different because the charts contain different

SFS> information.

And what are the differences between 4.CHD and 5.CHD from my original post?

Please be specific.

SFS> For example Per-Series attributes,

Both charts have the same attributes (type, colors, etc.)

SFS> more data,

One chart has 20 points, the other - 21 points. I doubt that 1 extra point

can take 40 KB.

SFS> constant lines and stripes,

No such things in both charts.

SFS> toolbar customization, etc.

Both charts have the same toolbar customizations, etc.

SFS> There is nothing I can do to help you reduce the file size other

SFS> than limit the functionality that you can use.

Sorry but I think you can, please.

- You know the file format but I don't.

- You have the library's source code and I have not.

So you can investigate the chart files and tell me what extra information is

present in the larger file (5.CHD) but absent in the smaller file (4.CHD).

I need this information as it may help me find a possible bug in the

application.

SFS> Why is the file size such a big deal for you ? I mean 60K is still

SFS> pretty small for today's disk sizes.

Our application can store up to 100 charts per document. This gives 6 MB per

document (not counting other, non-chart, data).

Transferring such files over _slow_ networks may be a problem.

Also, our customers have hundreds of saved documents. And this gives more

than 100 MB disk space.

Reducing file size by 60-70% will be a significant improvement.

However, my main goal is to find a possible bug. And I need your help to

understand the differences between the two files, please.

Serge

Link to comment
Share on other sites

The main difference I see is than one chart was saved in Windows XP and

another one in Windows 2K.

Since the ToolBar is customized, the icons are also saved. In Windows XP the

Icons are 256 colors while in Windows 2K they are 16 colors. There might be

more but I'm not going to go through all the differences in the debugger.

If you turn off FMASK_TOOLS, the toolbar will not get saved and you will

have to have the customization code run EVERY time the file is read.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...