mirror of
https://github.com/StefanSchippers/xschem.git
synced 2026-08-22 06:07:29 +02:00
useful coments added
This commit is contained in:
+3
-1
@@ -2620,13 +2620,14 @@ int draw_images_all(void)
|
|||||||
cairo_save(xctx->cairo_ctx);
|
cairo_save(xctx->cairo_ctx);
|
||||||
cairo_save(xctx->cairo_save_ctx);
|
cairo_save(xctx->cairo_save_ctx);
|
||||||
|
|
||||||
|
/* read PNG from in-memory buffer ... */
|
||||||
if(r->data && r->data_size) {
|
if(r->data && r->data_size) {
|
||||||
/* read PNG from in-memory buffer */
|
|
||||||
closure.buffer = r->data;
|
closure.buffer = r->data;
|
||||||
closure.pos = 0;
|
closure.pos = 0;
|
||||||
closure.size = r->data_size; /* should not be necessary */
|
closure.size = r->data_size; /* should not be necessary */
|
||||||
image = cairo_image_surface_create_from_png_stream(png_reader, &closure);
|
image = cairo_image_surface_create_from_png_stream(png_reader, &closure);
|
||||||
dbg(1, "draw_images_all(): length1 = %d\n", closure.pos);
|
dbg(1, "draw_images_all(): length1 = %d\n", closure.pos);
|
||||||
|
/* ... or read PNG from image_data attribute */
|
||||||
} else if( (attr = get_tok_value(r->prop_ptr, "image_data", 0))[0] ) {
|
} else if( (attr = get_tok_value(r->prop_ptr, "image_data", 0))[0] ) {
|
||||||
r->data = base64_decode(attr, strlen(attr), &r->data_size);
|
r->data = base64_decode(attr, strlen(attr), &r->data_size);
|
||||||
closure.buffer = r->data;
|
closure.buffer = r->data;
|
||||||
@@ -2634,6 +2635,7 @@ int draw_images_all(void)
|
|||||||
closure.size = r->data_size; /* should not be necessary */
|
closure.size = r->data_size; /* should not be necessary */
|
||||||
image = cairo_image_surface_create_from_png_stream(png_reader, &closure);
|
image = cairo_image_surface_create_from_png_stream(png_reader, &closure);
|
||||||
dbg(1, "draw_images_all(): length2 = %d\n", closure.pos);
|
dbg(1, "draw_images_all(): length2 = %d\n", closure.pos);
|
||||||
|
/* ... or read PNG from file (image attribute) */
|
||||||
} else if( (filename = get_tok_value(r->prop_ptr, "image", 0))[0] && !stat(filename, &buf)) {
|
} else if( (filename = get_tok_value(r->prop_ptr, "image", 0))[0] && !stat(filename, &buf)) {
|
||||||
char *image_data = NULL;
|
char *image_data = NULL;
|
||||||
size_t olength;
|
size_t olength;
|
||||||
|
|||||||
Reference in New Issue
Block a user