summaryrefslogtreecommitdiffstats
path: root/src/sp-image.cpp
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2013-05-11 05:35:12 +0000
committerJohn Smith <john.smith7545@yahoo.com>2013-05-11 05:35:12 +0000
commitca6da31c170148cb396d4f0a023c54e202716bdd (patch)
tree4789f8500589a5d9e7f8140419522bccb31c0a36 /src/sp-image.cpp
parentImprove code documentation for symbols (diff)
downloadinkscape-ca6da31c170148cb396d4f0a023c54e202716bdd.tar.gz
inkscape-ca6da31c170148cb396d4f0a023c54e202716bdd.zip
Fix for 871563 : JPG images are recompressed with lower quality when embedded
(bzr r12325)
Diffstat (limited to 'src/sp-image.cpp')
-rw-r--r--src/sp-image.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index dacea3417..d60fbc181 100644
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
@@ -42,6 +42,7 @@
#include "xml/quote.h"
#include "xml/repr.h"
#include "snap-candidate.h"
+#include "preferences.h"
#include "io/sys.h"
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
@@ -63,7 +64,7 @@
g_message( __VA_ARGS__ );\
}
-#include "preferences.h"
+
#include <gtk/gtk.h>
#endif // DEBUG_LCMS
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
@@ -1469,9 +1470,12 @@ void sp_embed_image( Inkscape::XML::Node *image_node, GdkPixbuf *pb, Glib::ustri
format = "png";
}
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ Glib::ustring quality = Glib::ustring::format(prefs->getInt("/dialogs/import/quality", 100));
+
gchar *data = 0;
gsize length = 0;
- gdk_pixbuf_save_to_buffer(pb, &data, &length, format.data(), NULL, NULL);
+ gdk_pixbuf_save_to_buffer(pb, &data, &length, format.data(), NULL, "quality", quality.c_str(), NULL);
// Save base64 encoded data in image node
// this formula taken from Glib docs