1 /*
2  * libopenraw - gdk.c
3  *
4  * Copyright (C) 2007-2013 Hubert Figuiere
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
19  */
20 
21 
22 
23 #include <stdio.h>
24 
25 #include <libopenraw/libopenraw.h>
26 #include <libopenraw-gnome/gdkpixbuf.h>
27 
28 int
main(int argc,char ** argv)29 main(int argc, char **argv)
30 {
31     char *filename = argv[1];
32 
33     (void)argc;
34     or_debug_set_level(DEBUG2);
35 #if !GLIB_CHECK_VERSION(2,36,0)
36     /* deprecated in 2.36 */
37     g_type_init();
38 #endif
39 
40     if(filename && *filename)
41     {
42         GdkPixbuf *pixbuf;
43 
44         pixbuf = or_gdkpixbuf_extract_rotated_thumbnail(filename, 160);
45         if(pixbuf) {
46             gdk_pixbuf_save (pixbuf, "gdk.jpg", "jpeg", NULL,
47                              "quality", "100", NULL);
48             g_object_unref(pixbuf);
49         }
50         else {
51             printf("error\n");
52         }
53     }
54     else {
55         printf("No input file name\n");
56     }
57 
58     return 0;
59 }
60 /*
61   Local Variables:
62   mode:c++
63   c-file-style:"stroustrup"
64   c-file-offsets:((innamespace . 0))
65   indent-tabs-mode:nil
66   fill-column:80
67   End:
68 */
69