Implementation of geimage PreviousNext

A tool similar tool geimage is already available in ISE EiffelStudio's package. It is called Eiffel Image Embedder Tool and is available in $ISE_EIFFEL/tools/spec/$ISE_PLATFORM/bin/eimgemb. Its documentation is here. Geimage differs from this tool in different ways.

Size of resulting executable

When embedding a png image whose file was 280 KB with eimgemb, the executable size increased by 3 MB. This is explained in the documentation of eimgemb: the tool does not compress target image contents, so the size of the image generated in executables is larger than original png file. But with tens of such png files to be embedded in the executable, the resulting size would have been impractical.

This is the primary reason why geimage has been introduced. It embeds the image's bytes as-is, keeping the compression of the original png file. As a result, the size of the executable only increased by 300 KB, which is more reasonable. Apart from that, the class text generated by geimage looks pretty much the same as the one generated by eimgemb. In particular, it only uses routines from EiffelVision2. So it should work on all platforms supported by EiffelVision2.

Use in scripts

As far as I can see, eimgemb is a GUI application, and cannot be used in scripts. On the other hand, geimage is a console application, which makes it possible to automate the pocessing of files. For example a script can traverse all png files in a given folder and generate the corresponding Eiffel classes before launching the compilation.

Speed of generation

With the png file of size 280 KB mentioned above, with eimgemb takes 26 seconds to generate the corresonding class text (not taking into account the time to manually save it into a file). With geimage this operation is instantaneous, which is more practical when processing tens of such png files (270 files in my case).


Copyright © 2020, Eric Bezault
mailto:ericb@gobosoft.com
http://www.gobosoft.com
Last Updated: 17 May 2020
HomeTocPreviousNext