Flare 4: Reducing .chm file size

This forum is for all Flare issues related to the Microsoft HTML Help target.
This target produces "CHM" files in the output.
Post Reply
JupiterJones
Propeller Head
Posts: 42
Joined: Fri May 23, 2008 2:09 am

Flare 4: Reducing .chm file size

Post by JupiterJones »

After inserting a few topics with screen shots in a project, the resulting .chm file can become very large.
I would like to discuss a way how to reduce this file size as much as possible, focussing not so much on image formats etc. but on which files are really included in a .chm file by Flare - if you don't take corrective action...

As far as I understand the compilation procedure, Flare puts all files of the content folder into the .chm - all topics, style sheets, images - whether used or not.
As my project is designed for single-sourcing (CHM and PDF) with two subtypes of manuals (quick guide, manual), much of the content is not required in the .chm, e.g. because it may only be necessary for the print target.
The first lesson I had to learn was, that only excluding the topic/image file itself (by conditions) will remove the file from the later .chm. Conditions in the Master TOC have no influence here.

Most space is required by (large) images. Therefore, I split my images in two folders: online version and print version. Thereby I can easily exclude the whole print images folder from the .chm output. The same principle works for topics and the different manual types.

To explain my current image strategy: I insert small screens, buttons etc. at 100% size, for both online and print. Large screenshots are used in full resolution for print (set to maximum width of the print space), for online I use a resized version (e.g. max. width 500px, depending on help window).

As long as I really use separate image files (low and high resolution) for online and print, I can easily exclude the print versions from the .chm.
But since Flare 4, there is the new and beautiful parameter "max-width" which can be applied to images (combined with the option in the HTMLhelp target to create a nicely resampled, clean new version of the image). This makes it possible for me to do "real" single-source-imaging: I include only the print version of the image in the topic (for print, the size is already fine), and for the non-print media, I create a IMG class with e.g. "max-width: 500px;" which will generate the resized version for the CHM target. Very comfortable, and finally with good quality also in the resized image (used to be very ugly in former Flare versions...).

Well, there is one downside using this procedure: The print image and the resized online version both are included in the .chm - which can lead again to rather large .chm file sizes. And unfortunately, I cannot exclude any images using conditions, since the only image I insert is the print image (and I cannot exclude that of course!), and the resized version is done automatically by Flare during compilation, so that I have no influence at this point.
It seems rather useless to me, that Flare includes both, the original AND the resized version of the image...

You see the dilemma? Do you have any idea if there are other ways to tell Flare which files to include in a .chm and which not?
Any tip would be highly appreciated. ;-)

JJ
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Flare 4: Reducing .chm file size

Post by LTinker68 »

JupiterJones wrote:But since Flare 4, there is the new and beautiful parameter "max-width" which can be applied to images (combined with the option in the HTMLhelp target to create a nicely resampled, clean new version of the image).
For the record, max-width is a CSS style that's been around for awhile. There's also a max-height property. However, neither of those is recognized in IE6 (don't know about IE7). Kind of surprising if it works in CHM. Also, if you specify a value for the max-width, you might also want to set max-height to "auto" -- that'll keep the aspect ratio of the image when it's resized.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Richard Ferrell
Propellus Maximus
Posts: 840
Joined: Mon May 01, 2006 10:11 am
Location: Inside California

Re: Flare 4: Reducing .chm file size

Post by Richard Ferrell »

Also on The Target there is an option to have Flare automatically resize your images, this can reduce file size also
Richard Ferrell

Certified Madcap Trainer
Image
MikeKatz
Sr. Propeller Head
Posts: 133
Joined: Tue Mar 07, 2006 5:54 pm

Re: Flare 4: Reducing .chm file size

Post by MikeKatz »

How are you saving your images? If you save them as PNG instead of JPG, you save a LOT of space and there's no difference in resolution.
Mike
JupiterJones
Propeller Head
Posts: 42
Joined: Fri May 23, 2008 2:09 am

Re: Flare 4: Reducing .chm file size

Post by JupiterJones »

LTinker68 wrote:
JupiterJones wrote:But since Flare 4, there is the new and beautiful parameter "max-width" which can be applied to images (combined with the option in the HTMLhelp target to create a nicely resampled, clean new version of the image).
For the record, max-width is a CSS style that's been around for awhile. There's also a max-height property. However, neither of those is recognized in IE6 (don't know about IE7). Kind of surprising if it works in CHM. Also, if you specify a value for the max-width, you might also want to set max-height to "auto" -- that'll keep the aspect ratio of the image when it's resized.
Yes, you're right - max-width is only supported by IE7. But since I use the option "Resizing images in online output" in the HTML Help target, resizing is apparently done during compilation, so that the user's browser does not need to resize anything. My resulting CHMs work fine with IE6.

The only problem remains the file size. Using this option includes both files in the CHM, the original and the resized version.
Is there any trick to influence that?
MikeKatz wrote:How are you saving your images? If you save them as PNG instead of JPG, you save a LOT of space and there's no difference in resolution.
Depends pretty much on the compression of the JPG/PNG, I think. But anyway - for screenshots, graphics etc. with text and large uniformly colored areas, PNG is always the better choice, since even low JPG compression would be visible here.
JupiterJones
Propeller Head
Posts: 42
Joined: Fri May 23, 2008 2:09 am

Re: Flare 4: Reducing .chm file size

Post by JupiterJones »

LTinker68 wrote:Also, if you specify a value for the max-width, you might also want to set max-height to "auto" -- that'll keep the aspect ratio of the image when it's resized.
If you only specify a "max-width" (in contrast to "width"!), the aspect ratio is automatically kept the same after resizing.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Flare 4: Reducing .chm file size

Post by LTinker68 »

JupiterJones wrote:If you only specify a "max-width" (in contrast to "width"!), the aspect ratio is automatically kept the same after resizing.
I would hope so, since I imagine the default value for max-width and max-height are "auto", but since support of those properties or their defaults may not be supported or supported equally by all browsers, it wouldn't hurt to specify the value in the stylesheet.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Post Reply