<?xml version="1.0" encoding="ISO-8859-1"?><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  <title>Implementation of geimage</title>
 </head>
 <body bgcolor="#FFFFFF">
  <table border="0" width="100%">
   <tr>
    <td><font size="6"><strong>Implementation of geimage</strong></font></td>
    <td align="right"><a href="usage.html"><img src="image/previous.gif" alt="Previous" border="0" /></a><a href="see_also.html"><img src="image/next.gif" alt="Next" border="0" /></a></td>
   </tr>
  </table>
  <hr size="1" />
  <p>
   A tool similar tool <i>geimage</i> is already available
   in <i>ISE EiffelStudio</i>'s package. It is called
   <i>Eiffel Image Embedder Tool</i> and is available
   in <font color="#800000"><i><tt>$ISE_EIFFEL/tools/spec/$ISE_PLATFORM/bin/eimgemb</tt></i></font>.
   Its documentation is <a href="https://www.eiffel.org/blog/larryliuming/eiffel_image_embedder_tool">here</a>.
   <i>Geimage</i> differs from this tool in different ways.
   
  </p>
  <div>
   <h2>Size of resulting executable</h2>
   
   <p>
    When embedding a png image whose file was 280 KB with
    <i>eimgemb</i>, the executable size increased by 3 MB.
    This is explained in the documentation of <i>eimgemb</i>:
    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.
    
   </p>
   
   <p>
    This is the primary reason why <i>geimage</i> 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 <i>geimage</i>
    looks pretty much the same as the one generated by <i>eimgemb</i>.
    In particular, it only uses routines from <i>EiffelVision2</i>.
    So it should work on all platforms supported by 
    <i>EiffelVision2</i>.
    
   </p>
   
  </div>
  <div>
   <h2>Use in scripts</h2>
   
   <p>
    As far as I can see, <i>eimgemb</i> is a GUI
    application, and cannot be used in scripts. On the other hand, 
    <i>geimage</i> 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.
    
   </p>
   
  </div>
  <div>
   <h2>Speed of generation</h2>
   
   <p>
    With the png file of size 280 KB mentioned above, with
    <i>eimgemb</i> takes 26 seconds to
    generate the corresonding class text (not taking into
    account the time to manually save it into a file).
    With <i>geimage</i> this operation
    is instantaneous, which is more practical when processing
    tens of such png files (270 files in my case).
    
   </p>
   
  </div>
  <hr size="1" />
  <table border="0" width="100%">
   <tr>
    <td>
     <address><font size="2"><b>Copyright © 2020, Eric Bezault</b><br /><b>mailto:</b><a href="mailto:ericb@gobosoft.com">ericb@gobosoft.com</a><br /><b>http://</b><a href="http://www.gobosoft.com">www.gobosoft.com</a><br /><b>Last Updated: </b>17 May 2020</font></address>
    </td>
    <td align="right" valign="top"><a href="http://www.gobosoft.com"><img src="image/home.gif" alt="Home" border="0" /></a><a href="index.html"><img src="image/toc.gif" alt="Toc" border="0" /></a><a href="usage.html"><img src="image/previous.gif" alt="Previous" border="0" /></a><a href="see_also.html"><img src="image/next.gif" alt="Next" border="0" /></a></td>
   </tr>
  </table>
 </body>
</html>