--- CV/CV.xs 2005/08/14 02:25:44 1.22 +++ CV/CV.xs 2005/08/17 05:25:28 1.24 @@ -6,6 +6,8 @@ #include #include +#include +#include #include #include @@ -188,7 +190,7 @@ RETVAL GdkPixbuf_noinc * -load_jpeg (char *path, int thumbnail=0) +load_jpeg (SV *path, int thumbnail=0) CODE: { struct jpeg_decompress_struct cinfo; @@ -197,9 +199,15 @@ int rs; FILE *fp; volatile GdkPixbuf *pb = 0; + gchar *filename; + RETVAL = 0; - if (!(fp = fopen (path, "rb"))) + filename = g_filename_from_utf8 (SvPVutf8_nolen (path), -1, 0, 0, 0); + fp = fopen (filename, "rb"); + g_free (filename); + + if (!fp) XSRETURN_UNDEF; cinfo.err = jpeg_std_error (&jerr.err); @@ -327,13 +335,14 @@ RETVAL GdkPixbuf_noinc * -p7_to_pb (int w, int h, guchar *src) +p7_to_pb (int w, int h, SV *src_sv) PROTOTYPE: @ CODE: { int x, y; guchar *dst, *d; int dstr; + guchar *src = SvPVbyte_nolen (src_sv); RETVAL = gdk_pixbuf_new (GDK_COLORSPACE_RGB, 0, 8, w, h); dst = gdk_pixbuf_get_pixels (RETVAL);