-/**
- * @brief Create a GdkPixbuf from an SVG filestream.
- *
- * This is essentially a wrapper around @gdk_pixbuf_from_svg_buffer
- * that reads a @c FILE pointer into a buffer.
- *
- * @param fp
- * A pointer to a @c FILE containing the SVG document.
- *
- * @param error
- * The address of a @c GError pointer that we use to return errors.
- *
- * @return If successful, a valid pointer to a @c GdkPixbuf is
- * returned; if not, @c NULL is returned and @c error is populated.
- */
-static GdkPixbuf* gdk_pixbuf_from_svg_file_stream(FILE *fp, GError** error) {
- size_t bytecount, bytesread;
- char* buffer;
-
- /* Find the size of the file stream */
- fseek(fp, 0L, SEEK_END);
- bytecount = ftell(fp);
- rewind(fp);
-
- /* YOLO, no error checking */
- buffer = g_malloc(bytecount);
-
- bytesread = fread(buffer, 1, bytecount, fp);
- if (bytesread != bytecount) {
- g_set_error(error,
- G_FILE_ERROR,
- G_FILE_ERROR_FAILED,
- "read only %zd of %zd bytes from stream",
- bytesread,
- bytecount);
- return NULL;
- }
-
- return gdk_pixbuf_from_svg_buffer(buffer, bytecount, error);
-}
-
-