diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_SVG_Image.cxx | 15 | ||||
| -rw-r--r-- | src/fl_images_core.cxx | 5 |
2 files changed, 7 insertions, 13 deletions
diff --git a/src/Fl_SVG_Image.cxx b/src/Fl_SVG_Image.cxx index 3c8957afd..45b0f74c4 100644 --- a/src/Fl_SVG_Image.cxx +++ b/src/Fl_SVG_Image.cxx @@ -76,24 +76,15 @@ float Fl_SVG_Image::svg_scaling_(int W, int H) { return (f1 < f2) ? f1 : f2; } -/** Opens for reading a potentially gzip'ed file identified by a UTF-8 encoded filename. */ -void* Fl_SVG_Image::fl_gzopen(const char *fname) { -#if defined(HAVE_LIBZ) - int fd = fl_open_ext(fname, 0, 0); - if (fd < 0) return NULL; - return gzdopen(fd, "r"); -#else - return NULL; -#endif // HAVE_LIBZ -} - #if defined(HAVE_LIBZ) static char *svg_inflate(const char *fname) { struct stat b; fl_stat(fname, &b); long size = b.st_size; - gzFile gzf = (gzFile)Fl_SVG_Image::fl_gzopen(fname); + int fd = fl_open_ext(fname, 0, 0); + if (fd < 0) return NULL; + gzFile gzf = gzdopen(fd, "r"); if (!gzf) return NULL; int l; int direct = gzdirect(gzf); diff --git a/src/fl_images_core.cxx b/src/fl_images_core.cxx index b44fd6b23..0aa5bc49d 100644 --- a/src/fl_images_core.cxx +++ b/src/fl_images_core.cxx @@ -32,6 +32,7 @@ #include <FL/Fl_PNG_Image.H> #include <FL/Fl_PNM_Image.H> #include <FL/Fl_SVG_Image.H> +#include <FL/fl_utf8.h> #include <stdio.h> #include <stdlib.h> #include "flstring.h" @@ -94,7 +95,9 @@ fl_check_images(const char *name, // I - Filename #ifdef FLTK_USE_NANOSVG # if defined(HAVE_LIBZ) if (header[0] == 0x1f && header[1] == 0x8b) { // denotes gzip'ed data - gzFile gzf = (gzFile)Fl_SVG_Image::fl_gzopen(name); + int fd = fl_open_ext(name, 0, 0); + if (fd < 0) return NULL; + gzFile gzf = gzdopen(fd, "r"); if (gzf) { gzread(gzf, header, headerlen); gzclose(gzf); |
