2001-04-28 Henning Meier-Geinitz <henning@meier-geinitz.de>

* TODO: Removed entries about >8bit support for xscanimage, xcam doc
	  strings, and hand-scanner mode in xscanimage.
	* src/xscanimage.c: Print an error when hand-scanner mode is requested.
	  Don't try to calculate image size in this case.
DEVEL_2_0_BRANCH-1
Henning Geinitz 2001-04-28 16:12:22 +00:00
rodzic 20a007a0a2
commit 9b79ce28a8
2 zmienionych plików z 42 dodań i 23 usunięć

24
TODO
Wyświetl plik

@ -1,4 +1,4 @@
TODO (2000-12-23) TODO (2001-04-28)
******** todo ******** ******** todo ********
@ -7,16 +7,7 @@ TODO (2000-12-23)
* add possibility to use external filters to xscanimage/xsane (?) * add possibility to use external filters to xscanimage/xsane (?)
* xscanimage/xcam: support depths > 8 bits/channel * xcam: support depths > 8 bits/channel
* xscanimage: provide both scale and textentry for ranges (make new widget)
* xcam: provide access to option doc strings
* xscanimage: scanning of images whose heights is not known a priori is not
supported yet; this is going to be important for handheld scanners. At
least the frontend shouldn't crash or produce invalid pnm files when
it gets a length of -1.
* xcam: add dithering and support for SANE depths other than 8 bit (test * xcam: add dithering and support for SANE depths other than 8 bit (test
with Mustek backend, for example) with Mustek backend, for example)
@ -41,6 +32,17 @@ TODO (2000-12-23)
******** done ******** ******** done ********
* xscanimage: scanning of images whose heights is not known a priori is not
supported yet; this is going to be important for handheld scanners. At
least the frontend shouldn't crash or produce invalid pnm files when
it gets a length of -1. (fixed size output and print an error when
hand-scanner mode is requested. If this feature is really needed, put
it into xsane).
* xcam: provide access to option doc strings.(seems to be added long
time ago but TODO list entry was forgotten).
* xscanimage: support depths > 8 bits/channel (--> xsane)
* xscanimage: provide both scale and textentry for ranges (make new widget)
(--> xsane)
* Adapt xscanimage to new GIMP API. Try to make it backwards compatible * Adapt xscanimage to new GIMP API. Try to make it backwards compatible
with old GIMP versions if possible. Maybe two source/header files with old GIMP versions if possible. Maybe two source/header files
for compatibility with old API? for compatibility with old API?

Wyświetl plik

@ -400,24 +400,32 @@ update_param (GSGDialog *dialog, void *arg)
double size = params.bytes_per_line * params.lines; double size = params.bytes_per_line * params.lines;
const char *unit = "B"; const char *unit = "B";
if (params.format >= SANE_FRAME_RED && params.format <= SANE_FRAME_BLUE) if (params.lines == -1)
size *= 3;
if (size >= 1024 * 1024)
{ {
size /= 1024 * 1024; snprintf (buf, sizeof (buf), "%dxunknown: unknown size",
unit = "MB"; params.pixels_per_line);
} }
else if (size >= 1024) else
{ {
size /= 1024; if (params.format >= SANE_FRAME_RED && params.format <= SANE_FRAME_BLUE)
unit = "KB"; size *= 3;
if (size >= 1024 * 1024)
{
size /= 1024 * 1024;
unit = "MB";
}
else if (size >= 1024)
{
size /= 1024;
unit = "KB";
}
snprintf (buf, sizeof(buf), "%dx%d: %1.1f %s", params.pixels_per_line,
params.lines, size, unit);
} }
sprintf (buf, "%dx%d: %1.1f %s", params.pixels_per_line,
params.lines, size, unit);
} }
else else
sprintf (buf, "Invalid parameters."); snprintf (buf, sizeof(buf), "Invalid parameters.");
gtk_label_set (GTK_LABEL (scan_win.info_label), buf); gtk_label_set (GTK_LABEL (scan_win.info_label), buf);
if (scan_win.preview) if (scan_win.preview)
@ -884,6 +892,15 @@ scan_start (void)
return; return;
} }
if (scan_win.param.lines == -1)
{
gsg_set_sensitivity (dialog, TRUE);
snprintf (buf, sizeof (buf), "Hand-Scanner mode not supported");
gsg_error (buf);
sane_cancel (dev);
return;
}
scan_win.num_bytes = scan_win.param.lines * scan_win.param.bytes_per_line; scan_win.num_bytes = scan_win.param.lines * scan_win.param.bytes_per_line;
scan_win.bytes_read = 0; scan_win.bytes_read = 0;