1 /* Copyright (C) 2001-2012 Artifex Software, Inc.
4 This software is provided AS-IS with no warranty, either express or
7 This software is distributed under license and may not be copied,
8 modified or distributed except as expressly authorized under the terms
9 of the license contained in the file LICENSE in this distribution.
11 Refer to licensing information at http://www.artifex.com or contact
12 Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
13 CA 94903, U.S.A., +1(415)492-9861, for further information.
22 #include "config_types.h"
24 #include "config_win32.h"
35 #include "jbig2_image.h"
37 int main(int argc, char *argv[])
43 /* we need a context for the allocators */
44 ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);
47 fprintf(stderr, "usage: %s <in.pbm> <out.png>\n\n", argv[0]);
51 image = jbig2_image_read_pbm_file(ctx, argv[1]);
53 fprintf(stderr, "error reading pbm file '%s'\n", argv[1]);
56 fprintf(stderr, "converting %dx%d image to png format\n", image->width, image->height);
59 error = jbig2_image_write_png_file(image, argv[2]);
61 fprintf(stderr, "error writing png file '%s' error %d\n", argv[2], error);