rename ps_drawPNG to ps_embedded_image for consistency with svg

This commit is contained in:
stefan schippers 2024-03-13 16:03:27 +01:00
parent c747d59a90
commit b1b2c3797b
2 changed files with 6 additions and 4 deletions

View File

@ -77,7 +77,7 @@ static Ps_color *ps_colors;
static char ps_font_name[80] = "Helvetica"; /* Courier Times Helvetica Symbol */
static char ps_font_family[80] = "Helvetica"; /* Courier Times Helvetica Symbol */
void ps_drawPNG(xRect* r, double x1, double y1, double x2, double y2, int rot, int flip)
void ps_embedded_image(xRect* r, double x1, double y1, double x2, double y2, int rot, int flip)
{
#if defined(HAS_LIBJPEG) && HAS_CAIRO==1
int i;
@ -929,7 +929,7 @@ static void ps_draw_symbol(int n,int layer, int what, short tmp_flip, short rot,
RECTORDER(x1,y1,x2,y2);
if (rect.flags & 1024) /* image */
{
ps_drawPNG(&rect, x0 + x1, y0 + y1, x0 + x2, y0 + y2, rot, flip);
ps_embedded_image(&rect, x0 + x1, y0 + y1, x0 + x2, y0 + y2, rot, flip);
continue;
}
ps_filledrect(layer, x0+x1, y0+y1, x0+x2, y0+y2, rect.dash, rect.fill);
@ -1293,7 +1293,7 @@ void create_ps(char **psfile, int what, int fullzoom, int eps)
if (c == GRIDLAYER && (xctx->rect[c][i].flags & 1024)) { /* image */
xRect* r = &xctx->rect[c][i];
/* PNG Code Here */
ps_drawPNG(r, r->x1, r->y1, r->x2, r->y2,0 ,0);
ps_embedded_image(r, r->x1, r->y1, r->x2, r->y2,0 ,0);
continue;
}
if (c == GRIDLAYER && (xctx->rect[c][i].flags & 1)) { /* graph */

View File

@ -768,8 +768,10 @@ char *base64_from_file(const char *f, size_t *length)
unsigned char *s = NULL;
char *b64s = NULL;
size_t len;
int stat_res;
if (stat(f, &st) == 0 && ( (st.st_mode & S_IFMT) == S_IFREG) ) {
stat_res = stat(f, &st);
if (stat_res == 0 && ( (st.st_mode & S_IFMT) == S_IFREG) ) {
len = st.st_size;
fd = fopen(f, fopen_read_mode);
if(fd) {