[simple-scan] During first run create page with correct page size.
- From: Bartosz <bkosiorek src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [simple-scan] During first run create page with correct page size.
- Date: Sun, 19 Apr 2020 15:44:52 +0000 (UTC)
commit b7c9b75860864a68caa28c3e613149e00bd58347
Author: Bartosz Kosiorek <gang65 poczta onet pl>
Date: Sun Apr 19 01:19:00 2020 +0200
During first run create page with correct page size.
During creation of page, size and DPI is taken from previous page.
Unfortunately if it is a first page, then the page size is default
which is 100x100 and 100 DPI.
With this patch the page size/DPI is set correctly after press Scan button.
The issue is reproducible only on real scanner on the first scanned page.
src/simple-scan.vala | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/simple-scan.vala b/src/simple-scan.vala
index 46e4768..64562aa 100644
--- a/src/simple-scan.vala
+++ b/src/simple-scan.vala
@@ -1582,7 +1582,7 @@ public class SimpleScan : Gtk.Application
scanner.authorize (username, password);
}
- private Page append_page ()
+ private Page append_page (int width = 100, int height = 100, int dpi = 100)
{
/* Use current page if not used */
var page = book.get_page (-1);
@@ -1597,7 +1597,7 @@ public class SimpleScan : Gtk.Application
var scan_direction = ScanDirection.TOP_TO_BOTTOM;
bool do_crop = false;
string named_crop = null;
- var width = 100, height = 100, dpi = 100, cx = 0, cy = 0, cw = 0, ch = 0;
+ var cx = 0, cy = 0, cw = 0, ch = 0;
if (page != null)
{
scan_direction = page.scan_direction;
@@ -1817,7 +1817,7 @@ public class SimpleScan : Gtk.Application
debug ("Requesting scan at %d dpi from device '%s'", options.dpi, device);
if (!scanner.is_scanning ())
- append_page ();
+ append_page (options.paper_width, options.paper_height, options.dpi);
scanner.scan (device, options);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]