}
size = sb.st_size;
- fprintf(stderr, "size: %lld bytes\n", (long long) size);
-
buffer = malloc(size);
if (!buffer) {
fprintf(stderr, "Unable to allocate %lld bytes\n",
if (code != svgtiny_OK)
fprintf(stderr, "svgtiny_parse failed: %i\n", code);
+ free(buffer);
+
printf("viewbox 0 0 %i %i\n", diagram->width, diagram->height);
for (unsigned int i = 0; i != diagram->shape_count; i++) {
printf("stroke none ");
else
printf("stroke #%.6x ", diagram->shape[i].stroke);
+ printf("stroke-width %i ", diagram->shape[i].stroke_width);
if (diagram->shape[i].path) {
printf("path '");
for (unsigned int j = 0;
printf("\n");
}
+ svgtiny_free(diagram);
+
return 0;
}