forked from old/legacy-imlib2
let's not have a coredumping example app ;-)
SVN revision: 3803
This commit is contained in:
parent
2e758a7c94
commit
6fad346907
|
@ -183,10 +183,10 @@ be dropped into the loaders directory with the others and all Imlib2 programs
|
|||
will automatically be able to use it - without a restart).
|
||||
<blockquote>
|
||||
<pre><tt><font color="#660000">/* standard headers */
|
||||
#include <X11/Xlib.h>
|
||||
#include <Imlib2.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <Imlib2.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* main program */
|
||||
int main(int argc, char **argv)
|
||||
|
@ -201,11 +201,14 @@ int main(int argc, char **argv)
|
|||
/* if the load was successful */
|
||||
if (image)
|
||||
{
|
||||
char *tmp;
|
||||
/* set the image we loaded as the current context image to work on */
|
||||
imlib_context_set_image(image);
|
||||
/* set the image format to be the format of the extension of our last */
|
||||
/* argument - i.e. .png = png, .tif = tiff etc. */
|
||||
imlib_image_set_format(strrchr(argv[2], '.') + 1);
|
||||
tmp = strrchr(argv[2], '.');
|
||||
if(tmp)
|
||||
imlib_image_set_format(tmp + 1);
|
||||
/* save the image */
|
||||
imlib_save_image(argv[2]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue