[simple-scan/gnome-3-4: 22/25] Store density information in bitmap formats (JPEG, PNG, TIFF). Requires gdk-pixbuf 2.32.2
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [simple-scan/gnome-3-4: 22/25] Store density information in bitmap formats (JPEG, PNG, TIFF). Requires gdk-pixbuf 2.32.2
- Date: Thu, 27 Apr 2017 09:18:40 +0000 (UTC)
commit e75b3468de78436b6ddc994e0b6a6695a8c331cb
Author: Robert Ancell <robert ancell canonical com>
Date: Fri Oct 31 12:22:29 2014 +1300
Store density information in bitmap formats (JPEG, PNG, TIFF). Requires gdk-pixbuf 2.32.2
src/page.vala | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/src/page.vala b/src/page.vala
index ef7ddb6..1758ef9 100644
--- a/src/page.vala
+++ b/src/page.vala
@@ -687,25 +687,26 @@ public class Page
if (strcmp (type, "jpeg") == 0)
{
- /* ICC profile is awaiting review in gtk2+ bugzilla */
- string[] keys = { "quality", /* "icc-profile", */ null };
- string[] values = { "90", /* icc_profile_data, */ null };
+ string[] keys = { "x-dpi", "y-dpi", "quality", "icc-profile", null };
+ string[] values = { "%d".printf (dpi), "%d".printf (dpi), "90", icc_profile_data, null };
+ if (icc_profile_data == null)
+ keys[3] = null;
writer.save (image, "jpeg", keys, values);
}
else if (strcmp (type, "png") == 0)
{
- string[] keys = { "icc-profile", null };
- string[] values = { icc_profile_data, null };
+ string[] keys = { "x-dpi", "y-dpi", "icc-profile", null };
+ string[] values = { "%d".printf (dpi), "%d".printf (dpi), icc_profile_data, null };
if (icc_profile_data == null)
- keys[0] = null;
+ keys[2] = null;
writer.save (image, "png", keys, values);
}
else if (strcmp (type, "tiff") == 0)
{
- string[] keys = { "compression", "icc-profile", null };
- string[] values = { "8" /* Deflate compression */, icc_profile_data, null };
+ string[] keys = { "x-dpi", "y-dpi", "compression", "icc-profile", null };
+ string[] values = { "%d".printf (dpi), "%d".printf (dpi), "8" /* Deflate compression */,
icc_profile_data, null };
if (icc_profile_data == null)
- keys[1] = null;
+ keys[3] = null;
writer.save (image, "tiff", keys, values);
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]