Page 1 of 1

ImagePlugins: Remove unnecessary error texts in compiled exe

Posted: Sat Mar 27, 2010 7:32 pm
by c4s
When I'm using the image encoders and decoders a lot of their unused error messages are compiled into my executable, like "LZWDecode: Bogus encoding, loop in the code table; scanline %d" or "Application uses deprecated png_write_init() and should be recompiled."

Could you please edit the plugins so that these texts aren't in the final executable anymore?

Re: ImagePlugins: Remove unnecessary error texts in compiled

Posted: Sun Mar 28, 2010 8:29 am
by Michael Vogel
Haven't thought that such "waste" would be in the libs, but I would also ask for reducing as much overhead as possible. The new 4.40 release brought (between 20 and 30K) larger exe files, so the size of some smaller tools has been even doubled :shock: -- so loosing some weight would be nice :wink:

Michael

Re: ImagePlugins: Remove unnecessary error texts in compiled

Posted: Sun Mar 28, 2010 2:54 pm
by c4s
Yes...

When you are compiling the following code, nearly a third of the resulting executable will be of those unused messages:

Code: Select all

UseJPEGImageDecoder()
UseJPEGImageEncoder()
UsePNGImageDecoder()
UsePNGImageEncoder()
UseJPEG2000ImageDecoder()
UseJPEG2000ImageEncoder()
UseTGAImageDecoder()
UseTIFFImageDecoder()
So please PureBasic be yourself again. ;)
www.purebasic.com/faq.php wrote: Is PureBasic really small and fast ?

Yes. All has been optimized to give maximum speed and compactness to the programs created with PureBasic. The execution speed match almost any professional compiler like Visual C++ and the executable size is smaller, without the need for any runtime (small programmes are typically between 5 kb and 10 kb).

Re: ImagePlugins: Remove unnecessary error texts in compiled

Posted: Sun Mar 28, 2010 8:24 pm
by UserOfPure
From what I can see, those messages are part of the decoders that PureBasic uses, and therefore can't be removed. PureBasic itself doesn't decode them, the included decoders do it. Removing the messages (if possible) would probably be a violation of the licenses used by PureBasic.

But there's some code on the forums here that lets you load GIFs, PNGs, JPGs, etc using Windows itself, rather than needing all those included image decoders, and your executable size drops dramatically because they're not used. For example, I've been loading JPGs in my apps without needing UseJPEGImageDecoder() for years. I think netmaestro posted the tip. Do a search. ;)

Re: ImagePlugins: Remove unnecessary error texts in compiled

Posted: Wed Mar 31, 2010 5:17 pm
by c4s
UserOfPure wrote:From what I can see, those messages are part of the decoders that PureBasic uses, and therefore can't be removed. PureBasic itself doesn't decode them, the included decoders do it. Removing the messages (if possible) would probably be a violation of the licenses used by PureBasic.
Sure.
But don't these libs usually have a compiling flag like "NoErrorMessages" or something similar?
I mean as long as their copyright messages stay intact everything should be fine, right?