1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* GdkPixbuf library - PNM image loader
4 * Copyright (C) 1999 Red Hat, Inc.
6 * Authors: Jeffrey Stedfast <fejj@helixcode.com>
7 * Michael Fulbright <drmike@redhat.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
30 #include "gdk-pixbuf-private.h"
31 #include "gdk-pixbuf-io.h"
34 #define PNM_BUF_SIZE 4096
36 #define PNM_FATAL_ERR -1
50 guchar buffer[PNM_BUF_SIZE];
56 GdkPixbufModuleUpdatedFunc updated_func;
57 GdkPixbufModulePreparedFunc prepared_func;
58 GdkPixbufModuleSizeFunc size_func;
62 guchar *pixels; /* incoming pixel data buffer */
63 guchar *dptr; /* current position in pixbuf */
73 guint output_row; /* last row to be completed */
75 gboolean did_prescan; /* are we in image data yet? */
76 gboolean got_header; /* have we loaded pnm header? */
84 static GdkPixbuf *gdk_pixbuf__pnm_image_load (FILE *f, GError **error);
85 static gpointer gdk_pixbuf__pnm_image_begin_load (GdkPixbufModuleSizeFunc size_func,
86 GdkPixbufModulePreparedFunc func,
87 GdkPixbufModuleUpdatedFunc func2,
90 static gboolean gdk_pixbuf__pnm_image_stop_load (gpointer context, GError **error);
91 static gboolean gdk_pixbuf__pnm_image_load_increment (gpointer context,
92 const guchar *buf, guint size,
95 static void explode_bitmap_into_buf (PnmLoaderContext *context);
96 static void explode_gray_into_buf (PnmLoaderContext *context);
99 /* explode bitmap data into rgb components */
100 /* we need to know what the row so we can */
101 /* do sub-byte expansion (since 1 byte = 8 pixels) */
102 /* context->dptr MUST point at first byte in incoming data */
103 /* which corresponds to first pixel of row y */
105 explode_bitmap_into_buf (PnmLoaderContext *context)
108 guchar *from, *to, data;
113 g_return_if_fail (context != NULL);
114 g_return_if_fail (context->dptr != NULL);
116 /* I'm no clever bit-hacker so I'm sure this can be optimized */
117 dptr = context->dptr;
118 wid = context->width;
120 from = dptr + ((wid - 1) / 8);
121 to = dptr + (wid - 1) * 3;
122 bit = 7 - ((wid-1) % 8);
124 /* get first byte and align properly */
126 for (j = 0; j < bit; j++, data >>= 1);
128 for (x = wid-1; x >= 0; x--) {
129 /* g_print ("%c", (data & 1) ? '*' : ' '); */
131 to[0] = to[1] = to[2] = (data & 0x01) ? 0x00 : 0xff;
136 if (bit > 7 && x > 0) {
145 /* g_print ("\n"); */
148 /* explode gray image row into rgb components in pixbuf */
150 explode_gray_into_buf (PnmLoaderContext *context)
156 g_return_if_fail (context != NULL);
157 g_return_if_fail (context->dptr != NULL);
159 /* Expand grey->colour. Expand from the end of the
160 * memory down, so we can use the same buffer.
163 from = context->dptr + w - 1;
164 to = context->dptr + (w - 1) * 3;
165 for (j = w - 1; j >= 0; j--) {
174 /* skip over whitespace and comments in input buffer */
176 pnm_skip_whitespace (PnmIOBuffer *inbuf, GError **error)
178 register guchar *inptr;
181 g_return_val_if_fail (inbuf != NULL, PNM_FATAL_ERR);
182 g_return_val_if_fail (inbuf->byte != NULL, PNM_FATAL_ERR);
184 inend = inbuf->byte + inbuf->nbytes;
187 for ( ; inptr < inend; inptr++) {
189 /* in comment - skip to the end of this line */
190 for ( ; *inptr != '\n' && inptr < inend; inptr++)
193 if ( inptr == inend || *inptr != '\n' ) {
194 /* couldn't read whole comment */
198 } else if (!g_ascii_isspace (*inptr)) {
200 inbuf->nbytes = (guint) (inend - inptr);
206 inbuf->nbytes = (guint) (inend - inptr);
211 /* read next number from buffer */
213 pnm_read_next_value (PnmIOBuffer *inbuf, gint max_length, guint *value, GError **error)
215 register guchar *inptr, *word, *p;
216 guchar *inend, buf[129];
221 g_return_val_if_fail (inbuf != NULL, PNM_FATAL_ERR);
222 g_return_val_if_fail (inbuf->byte != NULL, PNM_FATAL_ERR);
223 g_return_val_if_fail (value != NULL, PNM_FATAL_ERR);
228 /* skip white space */
229 if ((retval = pnm_skip_whitespace (inbuf, error)) != PNM_OK)
232 inend = inbuf->byte + inbuf->nbytes;
235 /* copy this pnm 'word' into a temp buffer */
236 for (p = inptr, word = buf; (p < inend) && !g_ascii_isspace (*p) && (*p != '#') && (p - inptr < max_length); p++, word++)
240 /* hmmm, there must be more data to this 'word' */
241 if (p == inend || (!g_ascii_isspace (*p) && (*p != '#') && (p - inptr < max_length)))
245 result = strtol ((gchar *)buf, &endptr, 10);
246 if (*endptr != '\0' || result < 0 || result > G_MAXUINT) {
247 g_set_error_literal (error,
249 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
250 _("PNM loader expected to find an integer, but didn't"));
251 return PNM_FATAL_ERR;
256 inbuf->nbytes = (guint) (inend - p);
261 /* returns PNM_OK, PNM_SUSPEND, or PNM_FATAL_ERR */
263 pnm_read_header (PnmLoaderContext *context)
268 g_return_val_if_fail (context != NULL, PNM_FATAL_ERR);
270 inbuf = &context->inbuf;
272 if (!context->type) {
273 /* file must start with a 'P' followed by a numeral */
274 /* so loop till we get enough data to determine type */
275 if (inbuf->nbytes < 2)
278 if (*inbuf->byte != 'P') {
279 g_set_error_literal (context->error,
281 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
282 _("PNM file has an incorrect initial byte"));
283 return PNM_FATAL_ERR;
289 switch (*inbuf->byte) {
291 context->type = PNM_FORMAT_PBM;
294 context->type = PNM_FORMAT_PGM;
297 context->type = PNM_FORMAT_PPM;
300 context->type = PNM_FORMAT_PBM_RAW;
303 context->type = PNM_FORMAT_PGM_RAW;
306 context->type = PNM_FORMAT_PPM_RAW;
309 g_set_error_literal (context->error,
311 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
312 _("PNM file is not in a recognized PNM subformat"));
313 return PNM_FATAL_ERR;
323 if (!context->width) {
324 /* read the pixmap width */
327 retval = pnm_read_next_value (inbuf, -1, &width,
330 if (retval != PNM_OK)
334 g_set_error_literal (context->error,
336 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
337 _("PNM file has an image width of 0"));
338 return PNM_FATAL_ERR;
341 context->width = width;
344 if (!context->height) {
345 /* read the pixmap height */
348 retval = pnm_read_next_value (inbuf, -1, &height,
351 if (retval != PNM_OK)
355 g_set_error_literal (context->error,
357 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
358 _("PNM file has an image height of 0"));
359 return PNM_FATAL_ERR;
362 context->height = height;
365 switch (context->type) {
367 case PNM_FORMAT_PPM_RAW:
369 case PNM_FORMAT_PGM_RAW:
370 if (!context->maxval) {
371 retval = pnm_read_next_value (inbuf, -1, &context->maxval,
374 if (retval != PNM_OK)
377 if (context->maxval == 0) {
378 g_set_error_literal (context->error,
380 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
381 _("Maximum color value in PNM file is 0"));
382 return PNM_FATAL_ERR;
385 if (context->maxval > 65535) {
386 g_set_error_literal (context->error,
388 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
389 _("Maximum color value in PNM file is too large"));
390 return PNM_FATAL_ERR;
403 pnm_read_raw_scanline (PnmLoaderContext *context)
406 guint numbytes, offset;
411 g_return_val_if_fail (context != NULL, PNM_FATAL_ERR);
413 inbuf = &context->inbuf;
415 switch (context->type) {
416 case PNM_FORMAT_PBM_RAW:
417 numpix = inbuf->nbytes * 8;
419 case PNM_FORMAT_PGM_RAW:
420 numpix = inbuf->nbytes;
422 case PNM_FORMAT_PPM_RAW:
423 numpix = inbuf->nbytes / 3;
426 g_set_error_literal (context->error,
428 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
429 _("Raw PNM image type is invalid"));
430 return PNM_FATAL_ERR;
432 if(context->maxval>255)
435 numpix = MIN (numpix, context->width - context->output_col);
440 context->dptr = context->pixels + context->output_row * context->rowstride;
442 switch (context->type) {
443 case PNM_FORMAT_PBM_RAW:
444 numbytes = (numpix / 8) + ((numpix % 8) ? 1 : 0);
445 offset = context->output_col / 8;
447 case PNM_FORMAT_PGM_RAW:
449 offset = context->output_col;
451 case PNM_FORMAT_PPM_RAW:
452 numbytes = numpix * 3;
453 offset = context->output_col * 3;
456 g_set_error_literal (context->error,
458 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
459 _("Raw PNM image type is invalid"));
460 return PNM_FATAL_ERR;
462 if(context->maxval>255)
465 switch (context->type) {
466 case PNM_FORMAT_PBM_RAW:
467 dest = context->dptr + offset;
468 memcpy (dest, inbuf->byte, numbytes);
470 case PNM_FORMAT_PGM_RAW:
471 case PNM_FORMAT_PPM_RAW:
472 dest = context->dptr + offset;
474 if (context->maxval == 255) {
475 /* special-case optimization */
476 memcpy (dest, inbuf->byte, numbytes);
477 } else if(context->maxval == 65535) {
478 /* optimized version of the next case */
479 for(i=0; i < numbytes ; i+=2) {
480 *dest++=inbuf->byte[i];
482 } else if(context->maxval > 255) {
483 /* scale down to 256 colors */
484 for(i=0; i < numbytes ; i+=2) {
485 guint v=inbuf->byte[i]*256+inbuf->byte[i+1];
486 *dest++=v*255/context->maxval;
489 for (i = 0; i < numbytes; i++) {
490 guchar *byte = inbuf->byte + i;
492 /* scale the color to an 8-bit color depth */
493 if (*byte > context->maxval)
496 *dest++ = (guchar) (255 * *byte / context->maxval);
501 g_set_error_literal (context->error,
503 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
504 _("Raw PNM image type is invalid"));
505 return PNM_FATAL_ERR;
508 inbuf->byte += numbytes;
509 inbuf->nbytes -= numbytes;
511 context->output_col += numpix;
512 if (context->output_col == context->width) {
513 if (context->type == PNM_FORMAT_PBM_RAW)
514 explode_bitmap_into_buf (context);
515 else if (context->type == PNM_FORMAT_PGM_RAW)
516 explode_gray_into_buf (context);
518 context->output_col = 0;
519 context->output_row++;
528 pnm_read_ascii_mono_scanline (PnmLoaderContext *context)
536 if (context->type == PNM_FORMAT_PBM)
541 inbuf = &context->inbuf;
543 context->dptr = context->pixels + context->output_row * context->rowstride;
545 dptr = context->dptr + context->output_col * 3;
548 retval = pnm_read_next_value (inbuf, max_length, &value, context->error);
549 if (retval != PNM_OK)
552 if (context->type == PNM_FORMAT_PBM) {
553 value = value ? 0 : 0xff;
556 /* scale the color up or down to an 8-bit color depth */
557 if (value > context->maxval)
560 value = (guchar)(255 * value / context->maxval);
567 context->output_col++;
569 if (context->output_col == context->width) {
570 context->output_col = 0;
571 context->output_row++;
580 pnm_read_ascii_color_scanline (PnmLoaderContext *context)
587 inbuf = &context->inbuf;
589 context->dptr = context->pixels + context->output_row * context->rowstride;
591 dptr = context->dptr + context->output_col * 3 + context->scan_state;
594 for (i = context->scan_state; i < 3; i++) {
595 retval = pnm_read_next_value (inbuf, -1, &value, context->error);
596 if (retval != PNM_OK) {
597 /* save state and return */
598 context->scan_state = i;
602 if (value > context->maxval)
605 *dptr++ = (guchar)(255 * value / context->maxval);
608 context->scan_state = 0;
609 context->output_col++;
611 if (context->output_col == context->width) {
612 context->output_col = 0;
613 context->output_row++;
621 /* returns 1 if a scanline was converted, 0 means we ran out of data */
623 pnm_read_scanline (PnmLoaderContext *context)
627 g_return_val_if_fail (context != NULL, PNM_FATAL_ERR);
629 /* read in image data */
630 /* for raw formats this is trivial */
631 switch (context->type) {
632 case PNM_FORMAT_PBM_RAW:
633 case PNM_FORMAT_PGM_RAW:
634 case PNM_FORMAT_PPM_RAW:
635 retval = pnm_read_raw_scanline (context);
636 if (retval != PNM_OK)
641 retval = pnm_read_ascii_mono_scanline (context);
642 if (retval != PNM_OK)
646 retval = pnm_read_ascii_color_scanline (context);
647 if (retval != PNM_OK)
651 g_set_error_literal (context->error,
653 GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
654 _("PNM image loader does not support this PNM subformat"));
656 return PNM_FATAL_ERR;
662 /* Shared library entry point */
664 gdk_pixbuf__pnm_image_load (FILE *f, GError **error)
666 PnmLoaderContext context;
671 /* pretend to be doing progressive loading */
672 context.updated_func = NULL;
673 context.prepared_func = NULL;
674 context.user_data = NULL;
676 context.inbuf.nbytes = 0;
677 context.inbuf.byte = NULL;
681 context.pixels = NULL;
682 context.pixbuf = NULL;
683 context.got_header = FALSE;
684 context.did_prescan = FALSE;
685 context.scan_state = 0;
686 context.error = error;
688 inbuf = &context.inbuf;
693 /* keep buffer as full as possible */
694 num_to_read = PNM_BUF_SIZE - inbuf->nbytes;
696 if (inbuf->byte != NULL && inbuf->nbytes > 0)
697 memmove (inbuf->buffer, inbuf->byte, inbuf->nbytes);
699 nbytes = fread (inbuf->buffer + inbuf->nbytes, 1, num_to_read, f);
703 /* we ran out of data? */
705 g_object_unref (context.pixbuf);
706 g_set_error_literal (error,
708 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
709 _("Premature end-of-file encountered"));
713 inbuf->nbytes += nbytes;
714 inbuf->byte = inbuf->buffer;
716 /* get header if needed */
717 if (!context.got_header) {
718 retval = pnm_read_header (&context);
719 if (retval == PNM_FATAL_ERR)
721 else if (retval == PNM_SUSPEND)
724 context.got_header = TRUE;
727 /* scan until we hit image data */
728 if (!context.did_prescan) {
729 switch (context.type) {
730 case PNM_FORMAT_PBM_RAW:
731 case PNM_FORMAT_PGM_RAW:
732 case PNM_FORMAT_PPM_RAW:
733 if (inbuf->nbytes <= 0)
735 /* raw formats require exactly one whitespace */
736 if (!g_ascii_isspace(*(inbuf->byte)))
738 g_set_error_literal (error,
740 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
741 _("Raw PNM formats require exactly one whitespace before sample data"));
748 retval = pnm_skip_whitespace (inbuf,
750 if (retval == PNM_FATAL_ERR)
752 else if (retval == PNM_SUSPEND)
756 context.did_prescan = TRUE;
757 context.output_row = 0;
758 context.output_col = 0;
760 context.pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8,
761 context.width, context.height);
763 if (!context.pixbuf) {
764 /* Failed to allocate memory */
765 g_set_error_literal (error,
767 GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
768 _("Cannot allocate memory for loading PNM image"));
772 context.rowstride = context.pixbuf->rowstride;
773 context.pixels = context.pixbuf->pixels;
776 /* if we got here we're reading image data */
777 while (context.output_row < context.height) {
778 retval = pnm_read_scanline (&context);
780 if (retval == PNM_SUSPEND) {
782 } else if (retval == PNM_FATAL_ERR) {
784 g_object_unref (context.pixbuf);
790 if (context.output_row < context.height)
796 return context.pixbuf;
800 * func - called when we have pixmap created (but no image data)
801 * user_data - passed as arg 1 to func
802 * return context (opaque to user)
806 gdk_pixbuf__pnm_image_begin_load (GdkPixbufModuleSizeFunc size_func,
807 GdkPixbufModulePreparedFunc prepared_func,
808 GdkPixbufModuleUpdatedFunc updated_func,
812 PnmLoaderContext *context;
814 context = g_try_malloc (sizeof (PnmLoaderContext));
816 g_set_error_literal (error, GDK_PIXBUF_ERROR,
817 GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
818 _("Insufficient memory to load PNM context struct"));
821 memset (context, 0, sizeof (PnmLoaderContext));
822 context->size_func = size_func;
823 context->prepared_func = prepared_func;
824 context->updated_func = updated_func;
825 context->user_data = user_data;
829 context->pixbuf = NULL;
830 context->pixels = NULL;
831 context->got_header = FALSE;
832 context->did_prescan = FALSE;
833 context->scan_state = 0;
835 context->inbuf.nbytes = 0;
836 context->inbuf.byte = NULL;
838 context->error = error;
840 return (gpointer) context;
844 * context - returned from image_begin_load
846 * free context, unref gdk_pixbuf
849 gdk_pixbuf__pnm_image_stop_load (gpointer data,
852 PnmLoaderContext *context = (PnmLoaderContext *) data;
853 gboolean retval = TRUE;
855 g_return_val_if_fail (context != NULL, TRUE);
858 g_object_unref (context->pixbuf);
861 /* We should ignore trailing newlines and we can't
862 generally complain about trailing stuff at all, since
863 pnm allows to put multiple images in a file
865 if (context->inbuf.nbytes > 0) {
866 g_set_error_literal (error,
868 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
869 _("Unexpected end of PNM image data"));
880 * context - from image_begin_load
881 * buf - new image data
882 * size - length of new image data
884 * append image data onto inrecrementally built output image
887 gdk_pixbuf__pnm_image_load_increment (gpointer data,
888 const guchar *buf, guint size,
891 PnmLoaderContext *context = (PnmLoaderContext *)data;
894 guint num_left, spinguard;
897 g_return_val_if_fail (context != NULL, FALSE);
898 g_return_val_if_fail (buf != NULL, FALSE);
900 context->error = error;
903 inbuf = &context->inbuf;
910 /* keep buffer as full as possible */
911 num_to_copy = MIN (PNM_BUF_SIZE - inbuf->nbytes, num_left);
913 if (num_to_copy == 0)
919 if (inbuf->byte != NULL && inbuf->nbytes > 0)
920 memmove (inbuf->buffer, inbuf->byte, inbuf->nbytes);
922 memcpy (inbuf->buffer + inbuf->nbytes, bufhd, num_to_copy);
923 bufhd += num_to_copy;
924 inbuf->nbytes += num_to_copy;
925 inbuf->byte = inbuf->buffer;
926 num_left -= num_to_copy;
928 /* ran out of data and we haven't exited main loop */
929 if (inbuf->nbytes == 0)
932 /* get header if needed */
933 if (!context->got_header) {
934 retval = pnm_read_header (context);
936 if (retval == PNM_FATAL_ERR)
938 else if (retval == PNM_SUSPEND)
941 context->got_header = TRUE;
944 if (context->size_func) {
945 gint w = context->width;
946 gint h = context->height;
947 (*context->size_func) (&w, &h, context->user_data);
949 if (w == 0 || h == 0)
954 /* scan until we hit image data */
955 if (!context->did_prescan) {
956 switch (context->type) {
957 case PNM_FORMAT_PBM_RAW:
958 case PNM_FORMAT_PGM_RAW:
959 case PNM_FORMAT_PPM_RAW:
960 if (inbuf->nbytes <= 0)
962 /* raw formats require exactly one whitespace */
963 if (!g_ascii_isspace(*(inbuf->byte)))
965 g_set_error_literal (error,
967 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
968 _("Raw PNM formats require exactly one whitespace before sample data"));
975 retval = pnm_skip_whitespace (inbuf,
977 if (retval == PNM_FATAL_ERR)
979 else if (retval == PNM_SUSPEND)
983 context->did_prescan = TRUE;
984 context->output_row = 0;
985 context->output_col = 0;
987 context->pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
993 if (context->pixbuf == NULL) {
994 g_set_error_literal (error,
996 GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
997 _("Insufficient memory to load PNM file"));
1001 context->pixels = context->pixbuf->pixels;
1002 context->rowstride = context->pixbuf->rowstride;
1004 /* Notify the client that we are ready to go */
1005 if (context->prepared_func)
1006 (* context->prepared_func) (context->pixbuf,
1008 context->user_data);
1011 /* if we got here we're reading image data */
1012 while (context->output_row < context->height) {
1013 retval = pnm_read_scanline (context);
1015 if (retval == PNM_SUSPEND) {
1017 } else if (retval == PNM_FATAL_ERR) {
1019 } else if (retval == PNM_OK && context->updated_func) {
1020 /* send updated signal */
1021 (* context->updated_func) (context->pixbuf,
1023 context->output_row-1,
1026 context->user_data);
1030 if (context->output_row < context->height)
1040 #define MODULE_ENTRY(function) G_MODULE_EXPORT void function
1042 #define MODULE_ENTRY(function) void _gdk_pixbuf__pnm_ ## function
1045 MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module)
1047 module->load = gdk_pixbuf__pnm_image_load;
1048 module->begin_load = gdk_pixbuf__pnm_image_begin_load;
1049 module->stop_load = gdk_pixbuf__pnm_image_stop_load;
1050 module->load_increment = gdk_pixbuf__pnm_image_load_increment;
1053 MODULE_ENTRY (fill_info) (GdkPixbufFormat *info)
1055 static GdkPixbufModulePattern signature[] = {
1056 { "P1", NULL, 100 },
1057 { "P2", NULL, 100 },
1058 { "P3", NULL, 100 },
1059 { "P4", NULL, 100 },
1060 { "P5", NULL, 100 },
1061 { "P6", NULL, 100 },
1064 static gchar * mime_types[] = {
1065 "image/x-portable-anymap",
1066 "image/x-portable-bitmap",
1067 "image/x-portable-graymap",
1068 "image/x-portable-pixmap",
1071 static gchar * extensions[] = {
1080 info->signature = signature;
1081 info->description = N_("The PNM/PBM/PGM/PPM image format family");
1082 info->mime_types = mime_types;
1083 info->extensions = extensions;
1084 info->flags = GDK_PIXBUF_FORMAT_THREADSAFE;
1085 info->license = "LGPL";