source: libpipi/trunk/src/pipi.c @ 2693

Last change on this file since 2693 was 2693, checked in by Sam Hocevar, 15 years ago
  • Start working on "pipi", a command-line libpipi tool. It will be similar to convert, display, mogrify, animate etc. It can already convert between image formats (eg. "pipi src.png -o dest.jpeg").
File size: 702 bytes
Line 
1#include "config.h"
2#include "common.h"
3
4#include <stdio.h>
5#include <stdlib.h>
6#include <string.h>
7
8#include <pipi.h>
9
10int main(int argc, char *argv[])
11{
12    pipi_context_t *ctx;
13
14    ctx = pipi_create_context();
15
16    while(*++argv)
17    {
18        if(!strcmp(argv[0], "--output") || !strcmp(argv[0], "-o"))
19        {
20            if(argv[1] == NULL)
21                return EXIT_FAILURE;
22            if(pipi_command(ctx, "save", argv[1]) != 0)
23                return EXIT_FAILURE;
24            argv++;
25        }
26        else
27        {
28            if(pipi_command(ctx, "load", argv[0]) != 0)
29                return EXIT_FAILURE;
30        }
31    }
32
33    pipi_destroy_context(ctx);
34
35    return EXIT_SUCCESS;
36}
37
Note: See TracBrowser for help on using the repository browser.