assert(job);
assert(us);
assert(us->name);
- assert(us->f);
gvdevice_fputs(job, "<image xlink:href=\"");
gvdevice_fputs(job, us->name);
assert(job);
assert(us);
assert(us->name);
- assert(us->f);
BF2B(bf, b);
assert(us);
assert(us->name);
- assert(us->f);
n = job->obj->u.n;
assert(n);
fprintf(out, " texture ImageTexture { url \"%s\" }\n", us->name);
fprintf(out, " }\n");
fprintf(out, "}\n");
-
-
}
static void ps_freeimage(usershape_t *us)
assert(job);
assert(us);
assert(us->name);
- assert(us->f);
out = job->output_file;
assert(out);
}
if (!us->data) { /* read file into cache */
- int fd = fileno(us->f);
+ int fd;
struct stat statbuf;
- fseek(us->f, 0, SEEK_SET);
+ if (!gvusershape_file_access(us))
+ return;
+ fd = fileno(us->f);
switch (us->type) {
case FT_PS:
case FT_EPS:
}
if (us->data)
us->datafree = ps_freeimage;
+ gvusershape_file_release(us);
}
if (us->data) {
assert(job);
assert(us);
assert(us->name);
- assert(!(us->f));
out = job->output_file;
assert(out);
assert(job);
assert(us);
assert(us->name);
- assert(us->f);
if (us->data) {
if (us->datafree != gd_freeimage) {
}
}
if (!us->data) { /* read file into cache */
- fseek(us->f, 0, SEEK_SET);
+ if (!gvusershape_file_access(us))
+ return;
switch (us->type) {
#if 0
case FT_GD:
}
if (us->data)
us->datafree = gd_freeimage;
+
+ gvusershape_file_release(us);
}
return (gdImagePtr)(us->data);
}
assert(job);
assert(us);
assert(us->name);
- assert(us->f);
if (us->data) {
if (us->datafree == cairo_freeimage)
}
}
if (!surface) { /* read file into cache */
- fseek(us->f, 0, SEEK_SET);
+ if (!gvusershape_file_access(us))
+ return NULL;
switch (us->type) {
#ifdef CAIRO_HAS_PNG_FUNCTIONS
case FT_PNG:
us->data = (void*)surface;
us->datafree = cairo_freeimage;
}
+ gvusershape_file_release(us);
}
return surface;
}
static void pango_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
{
cairo_surface_t *surface; /* source surface */
+ cairo_format_t format;
FILE *out = job->output_file;
int X, Y, x, y, stride;
unsigned char *data, *ix, alpha, red, green, blue;
surface = cairo_loadimage(job, us);
- if (surface && (cairo_image_surface_get_format(surface) == CAIRO_FORMAT_ARGB32)) {
+ if (surface) {
+ format = cairo_image_surface_get_format(surface);
+ if ((format != CAIRO_FORMAT_ARGB32) && (format != CAIRO_FORMAT_RGB24))
+ return;
+
X = cairo_image_surface_get_width(surface);
Y = cairo_image_surface_get_height(surface);
stride = cairo_image_surface_get_stride(surface);
assert(job);
assert(us);
assert(us->name);
- assert(us->f);
if (us->data) {
if (us->datafree == gvloadimage_rsvg_free)
}
if (!rsvgh) { /* read file into cache */
+ if (!gvusershape_file_access(us))
+ return;
switch (us->type) {
case FT_SVG:
us->data = (void*)rsvgh;
us->datafree = gvloadimage_rsvg_free;
}
+
+ gvusershape_file_release(us);
}
return rsvgh;