From ed09b99cb3592f9afb57d2ae3fb88e7f1aca0eb4 Mon Sep 17 00:00:00 2001 From: miklosh Date: Mon, 30 Jul 2007 12:05:53 +0000 Subject: [PATCH] Do not flip non-top-level images --- src/extension/internal/pdfinput/svg-builder.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp index e52be554c..3f1416f16 100644 --- a/src/extension/internal/pdfinput/svg-builder.cpp +++ b/src/extension/internal/pdfinput/svg-builder.cpp @@ -1218,7 +1218,7 @@ Inkscape::XML::Node *SvgBuilder::_createImage(Stream *str, int width, int height png_set_write_fn(png_ptr, &base64_stream, png_write_base64stream, png_flush_base64stream); } else { static int counter = 0; - file_name = g_strdup_printf("createImage%d.png", counter++); + file_name = g_strdup_printf("%s_img%d.png", _docname, counter++); fp = fopen(file_name, "wb"); if ( fp == NULL ) { png_destroy_write_struct(&png_ptr, &info_ptr); @@ -1349,10 +1349,12 @@ Inkscape::XML::Node *SvgBuilder::_createImage(Stream *str, int width, int height // Create repr Inkscape::XML::Node *image_node = _xml_doc->createElement("svg:image"); - sp_repr_set_svg_double(image_node, "width", width); - sp_repr_set_svg_double(image_node, "height", height); + sp_repr_set_svg_double(image_node, "width", 1); + sp_repr_set_svg_double(image_node, "height", 1); // Set transformation - svgSetTransform(image_node, 1.0/(double)width, 0.0, 0.0, -1.0/(double)height, 0.0, 1.0); + if (_is_top_level) { + svgSetTransform(image_node, 1.0, 0.0, 0.0, -1.0, 0.0, 1.0); + } // Create href if (embed_image) { -- 2.30.2