--- CV/CV.xs 2005/08/14 02:25:44 1.22 +++ CV/CV.xs 2005/08/16 23:50:39 1.23 @@ -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);