Need help to make my program smaller

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
gnaiqiz

Need help to make my program smaller

Post by gnaiqiz »

Hi,

I wanted to use the Image and blob class in Magick++ for resizing and converting of PNG files to JPEG. These are the only functions i needed. I am doing so as i wanted the program to be small. I do not need the other functions. Right now, the dlls required are 2MB. I suppose there are a lot of unused functions being stored in the dll too.

I have tried removing the unneeded classes from MagickCore but doing so seems very complicated as there are alot of dependancies.

I also tried to use static libraries, hoping that it will extract only the required functions and build it into the executable, but i have not been successful so far.

Any comments on how i should go about doing it? I have been researching on it for 1 weeks already. Hope some one can enlighten me. Thanks

Regards
gnaiqiz
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Need help to make my program smaller

Post by magick »

The only method for reducing the MagickCore API overhead is exactly what you are doing. You need to remove whatever modules you do not need and hand edit the build files. As you have seen there are many dependencies. In the magick folder you can probably remove the image processing modules such as enhance.c, fx.c, resize.c, etc. You can leave the X11 modules (animate, import, xwindow, widget, etc) since they are not compiled unless X11 is defined. You can move almost all the coders, except the ones you need and xc.c and pattern.c. You won't need the utilities or the Wand API at all.
gnaiqiz

Re: Need help to make my program smaller

Post by gnaiqiz »

Hi,

thanks alot for your advice, i manage to make the dll even smaller.thasnk!

Regards
gnaiqiz
Post Reply