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).
|
will automatically be able to use it - without a restart).
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre><tt><font color="#660000">/* standard headers */
|
<pre><tt><font color="#660000">/* standard headers */
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <Imlib2.h>
|
#include <Imlib2.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* main program */
|
/* main program */
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
@ -201,11 +201,14 @@ int main(int argc, char **argv)
|
||||||
/* if the load was successful */
|
/* if the load was successful */
|
||||||
if (image)
|
if (image)
|
||||||
{
|
{
|
||||||
|
char *tmp;
|
||||||
/* set the image we loaded as the current context image to work on */
|
/* set the image we loaded as the current context image to work on */
|
||||||
imlib_context_set_image(image);
|
imlib_context_set_image(image);
|
||||||
/* set the image format to be the format of the extension of our last */
|
/* set the image format to be the format of the extension of our last */
|
||||||
/* argument - i.e. .png = png, .tif = tiff etc. */
|
/* 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 */
|
/* save the image */
|
||||||
imlib_save_image(argv[2]);
|
imlib_save_image(argv[2]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue