* Since this is based off the libgd implementation, no extended headers implemented (not required for a WAP client)
*/
-#include <config.h>
+#include "config.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
get_mbi(struct wbmp_progressive_state *context, const guchar **buf, guint *buf_size, int *val)
{
guchar intbuf[16];
- int i, n;
+ int n;
gboolean rv;
*val = 0;
- n = i = 0;
+ n = 0;
do {
rv = getin(context, buf, buf_size, intbuf+n, 1);
if(!rv)
context->need_width = FALSE;
if (context->width <= 0) {
- g_set_error (error,
- GDK_PIXBUF_ERROR,
- GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
- _("Image has zero width"));
+ g_set_error_literal (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Image has zero width"));
return FALSE;
}
context->need_height = FALSE;
if (context->height <= 0) {
- g_set_error (error,
- GDK_PIXBUF_ERROR,
- GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
- _("Image has zero height"));
+ g_set_error_literal (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Image has zero height"));
return FALSE;
}
context->pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, context->width, context->height);
if (!context->pixbuf) {
- g_set_error (error,
- GDK_PIXBUF_ERROR,
- GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
- _("Not enough memory to load image"));
+ g_set_error_literal (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
+ _("Not enough memory to load image"));
return FALSE;
}
if(size) {
bv = save_rest(context, buf, size);
if (!bv) {
- g_set_error (error,
- GDK_PIXBUF_ERROR,
- GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
- _("Couldn't save the rest"));
+ g_set_error_literal (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Couldn't save the rest"));
return FALSE;
}
return TRUE;
}
-void
-MODULE_ENTRY (wbmp, fill_vtable) (GdkPixbufModule *module)
+#ifndef INCLUDE_wbmp
+#define MODULE_ENTRY(function) G_MODULE_EXPORT void function
+#else
+#define MODULE_ENTRY(function) void _gdk_pixbuf__wbmp_ ## function
+#endif
+
+MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module)
{
module->begin_load = gdk_pixbuf__wbmp_image_begin_load;
module->stop_load = gdk_pixbuf__wbmp_image_stop_load;
module->load_increment = gdk_pixbuf__wbmp_image_load_increment;
}
-void
-MODULE_ENTRY (wbmp, fill_info) (GdkPixbufFormat *info)
+MODULE_ENTRY (fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
- { " ", "z", 1 },
+ { " ", "zz", 1 },
+ { " \140", "z ", 1 },
+ { " \100", "z ", 1 },
+ { " \040", "z ", 1 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {