fix a typo in simconf, fix embedding of jpeg inside svg images
This commit is contained in:
parent
bf027bc4f8
commit
b46828ae3e
|
|
@ -4006,10 +4006,6 @@ int edit_image(int what, xRect *r)
|
|||
dbg(1, "size_x = %d, size_y = %d, stride = %d\n", size_x, size_y, stride);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAS_CAIRO==1
|
||||
|
||||
|
||||
/* returns a cairo surface.
|
||||
* `filename` should be a png or jpeg image or anything else that can be converted to png
|
||||
|
|
@ -4130,7 +4126,7 @@ static cairo_surface_t *get_surface_from_b64data(const char *attr)
|
|||
my_free(_ALLOC_ID_, &closure.buffer);
|
||||
return surface;
|
||||
}
|
||||
#endif
|
||||
#endif /* HAS_CAIRO==1 */
|
||||
|
||||
/* rot and flip for rotated / flipped symbols
|
||||
* dr: 1 draw image
|
||||
|
|
@ -4139,8 +4135,6 @@ static cairo_surface_t *get_surface_from_b64data(const char *attr)
|
|||
int draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2, int rot, int flip)
|
||||
{
|
||||
#if HAS_CAIRO==1
|
||||
#if defined(HAS_LIBJPEG)
|
||||
#endif
|
||||
const char *ptr;
|
||||
int w,h;
|
||||
double x, y, rw, rh;
|
||||
|
|
|
|||
|
|
@ -488,10 +488,10 @@ static void svg_embedded_image(xRect *r, double rx1, double ry1, double rx2, dou
|
|||
if(alpha == 1.0) strcpy(opacity, "");
|
||||
else my_snprintf(opacity, S(opacity), "style=\"opacity:%g;\"", alpha);
|
||||
if(ptr[0]) {
|
||||
if(!strncmp(ptr, "/9j/4", 5)) jpg = 1; /* jpeg base64 header (30 bits checked) */
|
||||
if(!strncmp(ptr, "/9j/", 4)) jpg = 1; /* jpeg base64 header (24 bits checked) */
|
||||
fprintf(fd, "<image x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\" %s %s "
|
||||
"xlink:href=\"data:image/%s;base64,%s\"/>\n",
|
||||
0.0, 0.0, w, h, transform, opacity, jpg ? "jpg" : "png", ptr);
|
||||
0.0, 0.0, w, h, transform, opacity, jpg ? "jpeg" : "png", ptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1478,7 +1478,7 @@ proc set_sim_defaults {{reset {}}} {
|
|||
set_ne sim(spicewave,0,st) 0
|
||||
|
||||
set_ne sim(spicewave,1,cmd) {$terminal -e ngspice}
|
||||
set sim(spicewave,1,name) {Ngpice Viewer}
|
||||
set sim(spicewave,1,name) {Ngspice Viewer}
|
||||
set_ne sim(spicewave,1,fg) 0
|
||||
set_ne sim(spicewave,1,st) 0
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue