summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2014-10-03 14:05:13 +0000
committerMattia Rizzolo <mattia@mapreri.org>2014-10-03 14:05:13 +0000
commit947f2ec5da522dbe5b474fc7031cd3f224bd7ead (patch)
treeca9c7fb44299658f4a0bbb6875bb483edce2b972
parent6fceea28608be0fda32d94f59e1b1550774318a0 (diff)
Imported Upstream version 0.98bupstream/0.98b
-rwxr-xr-xconfigure2
-rw-r--r--configure.in2
-rw-r--r--include/config.h4
-rw-r--r--src/.xsane-front-gtk.h.swpbin0 -> 16384 bytes
-rw-r--r--src/xsane-front-gtk.c1
-rw-r--r--src/xsane-front-gtk.h4
-rw-r--r--src/xsane-save.c2
-rw-r--r--src/xsane-scan.c48
-rw-r--r--src/xsane.c43
-rw-r--r--src/xsane.h2
-rw-r--r--xsane.CHANGES18
-rw-r--r--xsane.FAQ30
-rw-r--r--xsane.spec2
13 files changed, 84 insertions, 74 deletions
diff --git a/configure b/configure
index 820b768..61f8ea2 100755
--- a/configure
+++ b/configure
@@ -1321,7 +1321,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# version code:
V_MAJOR=0
-V_MINOR=98
+V_MINOR=98b
PACKAGE=xsane
diff --git a/configure.in b/configure.in
index 096d4fd..786c8b4 100644
--- a/configure.in
+++ b/configure.in
@@ -6,7 +6,7 @@ AC_CONFIG_HEADER(include/config.h)
# version code:
V_MAJOR=0
-V_MINOR=98
+V_MINOR=98b
PACKAGE=xsane
diff --git a/include/config.h b/include/config.h
index 96fc6bc..d68bdd3 100644
--- a/include/config.h
+++ b/include/config.h
@@ -99,10 +99,10 @@
#define PACKAGE "xsane"
/* Define to the version of the distribution. */
-#define VERSION "0.98"
+#define VERSION "0.98b"
/* The concatenation of the strings PACKAGE, "-", and VERSION. */
-#define XSANE_PACKAGE_VERSION "xsane-0.98"
+#define XSANE_PACKAGE_VERSION "xsane-0.98b"
/* Define if you have the __argz_count function. */
#define HAVE___ARGZ_COUNT 1
diff --git a/src/.xsane-front-gtk.h.swp b/src/.xsane-front-gtk.h.swp
new file mode 100644
index 0000000..d971345
--- /dev/null
+++ b/src/.xsane-front-gtk.h.swp
Binary files differ
diff --git a/src/xsane-front-gtk.c b/src/xsane-front-gtk.c
index 2bf0fd9..3e9196c 100644
--- a/src/xsane-front-gtk.c
+++ b/src/xsane-front-gtk.c
@@ -24,6 +24,7 @@
#include "xsane.h"
#include "xsane-back-gtk.h"
+#include "xsane-front-gtk.h"
#include "xsane-preferences.h"
#include "xsane-preview.h"
#include "xsane-save.h"
diff --git a/src/xsane-front-gtk.h b/src/xsane-front-gtk.h
index 19aad87..53d63a6 100644
--- a/src/xsane-front-gtk.h
+++ b/src/xsane-front-gtk.h
@@ -35,7 +35,7 @@
extern int xsane_parse_options(char *options, char *argv[]);
extern void xsane_get_bounds(const SANE_Option_Descriptor *opt, double *minp, double *maxp);
extern double xsane_find_best_resolution(int well_known_option, double dpi);
-extern int xsane_set_resolution(int well_known_option, double resolution);
+extern double xsane_set_resolution(int well_known_option, double resolution);
extern void xsane_set_all_resolutions(void);
extern void xsane_define_maximum_output_size();
extern void xsane_close_dialog_callback(GtkWidget *widget, gpointer data);
@@ -77,7 +77,7 @@ extern void xsane_define_output_filename(void);
extern int xsane_identify_output_format(char *filename, char *filetype, char **ext);
extern void xsane_change_working_directory(void);
extern int xsane_display_eula(int ask_for_accept);
-extern int xsane_display_gpl(void);
+extern void xsane_display_gpl(void);
extern void xsane_window_get_position(GtkWidget *gtk_window, gint *x, gint *y);
extern void xsane_widget_test_uposition(GtkWidget *gtk_window);
extern int xsane_front_gtk_getname_dialog(const char *dialog_title, const char *desc_text, char *oldname, char **newname);
diff --git a/src/xsane-save.c b/src/xsane-save.c
index decd85a..2567898 100644
--- a/src/xsane-save.c
+++ b/src/xsane-save.c
@@ -4707,7 +4707,7 @@ static void xsane_gimp_run(char *name, int nparams, GimpParam *param, int *nretu
run_mode = param[0].data.d_int32;
xsane.mode = XSANE_GIMP_EXTENSION;
- preferences.xsane_mode = XSANE_SAVE;
+ xsane.xsane_mode = XSANE_SAVE;
*nreturn_vals = 1;
*return_vals = values;
diff --git a/src/xsane-scan.c b/src/xsane-scan.c
index 73953fe..7888a16 100644
--- a/src/xsane-scan.c
+++ b/src/xsane-scan.c
@@ -82,9 +82,9 @@ static int xsane_generate_dummy_filename(int conversion_level)
}
if ( (xsane.mode == XSANE_GIMP_EXTENSION) ||
- (preferences.xsane_mode == XSANE_COPY) ||
- (preferences.xsane_mode == XSANE_VIEWER) ||
- ( (preferences.xsane_mode == XSANE_SAVE) &&
+ (xsane.xsane_mode == XSANE_COPY) ||
+ (xsane.xsane_mode == XSANE_VIEWER) ||
+ ( (xsane.xsane_mode == XSANE_SAVE) &&
(xsane.xsane_output_format != XSANE_PNM) &&
(xsane.xsane_output_format != XSANE_RGBA) ) )
{
@@ -99,14 +99,14 @@ static int xsane_generate_dummy_filename(int conversion_level)
return TRUE;
}
- else if (preferences.xsane_mode == XSANE_FAX) /* no conversion following, save directly to the selected filename */
+ else if (xsane.xsane_mode == XSANE_FAX) /* no conversion following, save directly to the selected filename */
{
xsane.dummy_filename = strdup(xsane.fax_filename);
DBG(DBG_info, "xsane.dummy_filename = %s\n", xsane.dummy_filename);
return FALSE;
}
- else if (preferences.xsane_mode == XSANE_MAIL) /* no conversion following, save directly to the selected filename */
+ else if (xsane.xsane_mode == XSANE_MAIL) /* no conversion following, save directly to the selected filename */
{
xsane.dummy_filename = strdup(xsane.mail_filename);
DBG(DBG_info, "xsane.dummy_filename = %s\n", xsane.dummy_filename);
@@ -1185,13 +1185,13 @@ void xsane_scan_done(SANE_Status status)
}
}
- if (preferences.xsane_mode == XSANE_VIEWER)
+ if (xsane.xsane_mode == XSANE_VIEWER)
{
xsane_viewer_new(xsane.dummy_filename, TRUE, NULL, VIEWER_FULL_MODIFICATION);
xsane.expand_lineart_to_grayscale = 0;
}
- if ((preferences.xsane_mode == XSANE_FAX) || (preferences.xsane_mode == XSANE_MAIL))
+ if ((xsane.xsane_mode == XSANE_FAX) || (xsane.xsane_mode == XSANE_MAIL))
{
xsane.expand_lineart_to_grayscale = 0;
}
@@ -1207,7 +1207,7 @@ void xsane_scan_done(SANE_Status status)
}
}
- if (preferences.xsane_mode == XSANE_SAVE)
+ if (xsane.xsane_mode == XSANE_SAVE)
{
if ( ( (xsane.xsane_output_format != XSANE_PNM) && /* these files do not need any transformation */
(xsane.xsane_output_format != XSANE_RGBA) ) ||
@@ -1259,7 +1259,7 @@ void xsane_scan_done(SANE_Status status)
}
}
}
- else if (preferences.xsane_mode == XSANE_COPY)
+ else if (xsane.xsane_mode == XSANE_COPY)
{
FILE *outfile;
FILE *infile;
@@ -1378,7 +1378,7 @@ void xsane_scan_done(SANE_Status status)
}
}
- if ( (preferences.xsane_mode == XSANE_SAVE) && (xsane.mode == XSANE_STANDALONE) )
+ if ( (xsane.xsane_mode == XSANE_SAVE) && (xsane.mode == XSANE_STANDALONE) )
{
if (!xsane.force_filename) /* user filename selection active */
{
@@ -1395,7 +1395,7 @@ void xsane_scan_done(SANE_Status status)
xsane_update_counter_in_filename(&xsane.external_filename, TRUE, 1, 0);
}
}
- else if (preferences.xsane_mode == XSANE_FAX)
+ else if (xsane.xsane_mode == XSANE_FAX)
{
GtkWidget *list_item;
char *page;
@@ -1437,7 +1437,7 @@ void xsane_scan_done(SANE_Status status)
gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.fax_progress_bar), 0.0);
}
#ifdef XSANE_ACTIVATE_MAIL
- else if (preferences.xsane_mode == XSANE_MAIL)
+ else if (xsane.xsane_mode == XSANE_MAIL)
{
GtkWidget *list_item;
char *page;
@@ -1628,9 +1628,9 @@ static void xsane_start_scan(void)
}
if ((xsane.param.depth == 1) && ((xsane.scan_rotation) ||
- (preferences.xsane_mode == XSANE_VIEWER) ||
- (preferences.xsane_mode == XSANE_FAX) ||
- (preferences.xsane_mode == XSANE_MAIL))
+ (xsane.xsane_mode == XSANE_VIEWER) ||
+ (xsane.xsane_mode == XSANE_FAX) ||
+ (xsane.xsane_mode == XSANE_MAIL))
) /* We want to do a transformation with a lineart scan */
/* or use the viewer to display a lineart scan, */
/* so we save it as grayscale */
@@ -1755,7 +1755,7 @@ void xsane_scan_dialog(void)
sane_get_parameters(xsane.dev, &xsane.param); /* update xsane.param */
- if ( (xsane.mode == XSANE_STANDALONE) && (preferences.xsane_mode == XSANE_SAVE) )
+ if ( (xsane.mode == XSANE_STANDALONE) && (xsane.xsane_mode == XSANE_SAVE) )
{
/* correct length of filename counter if it is shorter than minimum length */
if (!xsane.force_filename)
@@ -1776,7 +1776,7 @@ void xsane_scan_dialog(void)
{
char *extension;
- if ( (preferences.xsane_mode == XSANE_SAVE) && (preferences.overwrite_warning) ) /* test if filename already used */
+ if ( (xsane.xsane_mode == XSANE_SAVE) && (preferences.overwrite_warning) ) /* test if filename already used */
{
FILE *testfile;
@@ -1798,7 +1798,7 @@ void xsane_scan_dialog(void)
xsane.xsane_output_format = xsane_identify_output_format(xsane.output_filename, preferences.filetype, &extension);
- if (preferences.xsane_mode == XSANE_SAVE)
+ if (xsane.xsane_mode == XSANE_SAVE)
{
if (xsane.xsane_output_format == XSANE_UNKNOWN)
{
@@ -1863,7 +1863,7 @@ void xsane_scan_dialog(void)
}
#endif
- if (preferences.xsane_mode == XSANE_FAX)
+ if (xsane.xsane_mode == XSANE_FAX)
{
mkdir(preferences.fax_project, 7*64 + 0*8 + 0);
}
@@ -1953,7 +1953,7 @@ void xsane_scan_dialog(void)
xsane.gamma_data_green = malloc(gamma_green_size * sizeof(SANE_Int));
xsane.gamma_data_blue = malloc(gamma_blue_size * sizeof(SANE_Int));
- if (preferences.xsane_mode == XSANE_COPY)
+ if (xsane.xsane_mode == XSANE_COPY)
{
gamma_red = xsane.gamma * xsane.gamma_red * preferences.printer[preferences.printernr]->gamma * preferences.printer[preferences.printernr]->gamma_red;
gamma_green = xsane.gamma * xsane.gamma_green * preferences.printer[preferences.printernr]->gamma * preferences.printer[preferences.printernr]->gamma_green;
@@ -2013,7 +2013,7 @@ void xsane_scan_dialog(void)
gamma_gray_size = opt->size / sizeof(opt->type);
gamma_gray_max = opt->constraint.range->max;
- if (preferences.xsane_mode == XSANE_COPY)
+ if (xsane.xsane_mode == XSANE_COPY)
{
gamma = xsane.gamma * preferences.printer[preferences.printernr]->gamma;
}
@@ -2087,7 +2087,7 @@ static void xsane_create_internal_gamma_tables(void)
xsane.gamma_data_green = malloc(size * sizeof(SANE_Int));
xsane.gamma_data_blue = malloc(size * sizeof(SANE_Int));
- if (preferences.xsane_mode == XSANE_COPY)
+ if (xsane.xsane_mode == XSANE_COPY)
{
gamma_red = xsane.gamma_red * preferences.printer[preferences.printernr]->gamma_red;
gamma_green = xsane.gamma_green * preferences.printer[preferences.printernr]->gamma_green;
@@ -2128,7 +2128,7 @@ static void xsane_create_internal_gamma_tables(void)
xsane.gamma_data_green = malloc(size * sizeof(SANE_Int));
xsane.gamma_data_blue = malloc(size * sizeof(SANE_Int));
- if (preferences.xsane_mode == XSANE_COPY)
+ if (xsane.xsane_mode == XSANE_COPY)
{
gamma_red = xsane.gamma * xsane.gamma_red * preferences.printer[preferences.printernr]->gamma * preferences.printer[preferences.printernr]->gamma_red;
gamma_green = xsane.gamma * xsane.gamma_green * preferences.printer[preferences.printernr]->gamma * preferences.printer[preferences.printernr]->gamma_green;
@@ -2173,7 +2173,7 @@ static void xsane_create_internal_gamma_tables(void)
DBG(DBG_info, "creating xsane internal gray gamma table with size %d\n", size);
- if (preferences.xsane_mode == XSANE_COPY)
+ if (xsane.xsane_mode == XSANE_COPY)
{
gamma = xsane.gamma * preferences.printer[preferences.printernr]->gamma;
}
diff --git a/src/xsane.c b/src/xsane.c
index d7cb4d0..30e093c 100644
--- a/src/xsane.c
+++ b/src/xsane.c
@@ -328,7 +328,7 @@ static void xsane_set_modus_defaults(void)
{
DBG(DBG_proc, "xsane_set_modus_defaults\n");
- switch(preferences.xsane_mode)
+ switch(xsane.xsane_mode)
{
case XSANE_VIEWER:
xsane_define_maximum_output_size();
@@ -398,23 +398,24 @@ static void xsane_modus_callback(GtkWidget *xsane_parent, int *num)
{
DBG(DBG_proc, "xsane_modus_callback\n");
+ xsane.xsane_mode = *num;
preferences.xsane_mode = *num;
xsane_set_modus_defaults(); /* set defaults and maximum output size */
xsane_refresh_dialog();
- if ((preferences.xsane_mode == XSANE_SAVE) || (preferences.xsane_mode == XSANE_VIEWER) || (preferences.xsane_mode == XSANE_COPY))
+ if ((xsane.xsane_mode == XSANE_SAVE) || (xsane.xsane_mode == XSANE_VIEWER) || (xsane.xsane_mode == XSANE_COPY))
{
gtk_widget_set_sensitive(GTK_WIDGET(xsane.start_button), TRUE);
}
- if (preferences.xsane_mode != XSANE_FAX)
+ if (xsane.xsane_mode != XSANE_FAX)
{
xsane_fax_dialog_close();
}
#ifdef XSANE_ACTIVATE_MAIL
- if (preferences.xsane_mode != XSANE_MAIL)
+ if (xsane.xsane_mode != XSANE_MAIL)
{
if (xsane.mail_project_save)
{
@@ -1206,7 +1207,7 @@ static void xsane_scanmode_menu_callback(GtkWidget *widget, gpointer data)
opt = xsane_get_option_descriptor(xsane.dev, opt_num);
xsane_back_gtk_set_option(opt_num, menu_item->label, SANE_ACTION_SET_VALUE);
- if (preferences.xsane_mode == XSANE_COPY)
+ if (xsane.xsane_mode == XSANE_COPY)
{
switch (xsane.param.format)
{
@@ -1336,7 +1337,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
xsane_back_gtk_set_tooltip(xsane.tooltips, xsane_modus_option_menu, DESC_XSANE_MODE);
gtk_box_pack_end(GTK_BOX(xsane_hbox_xsane_modus), xsane_modus_option_menu, FALSE, FALSE, 2);
gtk_option_menu_set_menu(GTK_OPTION_MENU(xsane_modus_option_menu), xsane_modus_menu);
- gtk_option_menu_set_history(GTK_OPTION_MENU(xsane_modus_option_menu), preferences.xsane_mode);
+ gtk_option_menu_set_history(GTK_OPTION_MENU(xsane_modus_option_menu), xsane.xsane_mode);
gtk_widget_show(xsane_modus_option_menu);
gtk_widget_show(xsane_hbox_xsane_modus);
@@ -1495,7 +1496,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
}
- if (preferences.xsane_mode == XSANE_SAVE)
+ if (xsane.xsane_mode == XSANE_SAVE)
{
xsane.copy_number_entry = NULL;
@@ -1505,7 +1506,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
}
}
- if ( (preferences.xsane_mode == XSANE_SAVE) || (preferences.xsane_mode == XSANE_VIEWER) )
+ if ( (xsane.xsane_mode == XSANE_SAVE) || (xsane.xsane_mode == XSANE_VIEWER) )
{
/* resolution selection */
if (!xsane_resolution_widget_new(xsane_vbox_xsane_modus, xsane.well_known.dpi_x, &xsane.resolution_x, resolution_x_xpm,
@@ -1520,7 +1521,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
DESC_RESOLUTION, XSANE_GTK_NAME_RESOLUTION);
}
}
- else if (preferences.xsane_mode == XSANE_COPY)
+ else if (xsane.xsane_mode == XSANE_COPY)
{
GtkWidget *pixmapwidget, *hbox, *xsane_printer_option_menu, *xsane_printer_menu, *xsane_printer_item;
GdkBitmap *mask;
@@ -1677,7 +1678,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
xsane.resolution, zoom_xpm, DESC_ZOOM);
}
}
- else if (preferences.xsane_mode == XSANE_FAX)
+ else if (xsane.xsane_mode == XSANE_FAX)
{
xsane.copy_number_entry = NULL;
@@ -1689,7 +1690,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
xsane_fax_dialog();
}
#ifdef XSANE_ACTIVATE_MAIL
- else if (preferences.xsane_mode == XSANE_MAIL)
+ else if (xsane.xsane_mode == XSANE_MAIL)
{
xsane.copy_number_entry = NULL;
@@ -2126,6 +2127,14 @@ static int xsane_pref_restore(void)
}
}
+ if (xsane.mode != XSANE_GIMP_EXTENSION)
+ {
+ if (xsane.xsane_mode < 0)
+ {
+ xsane.xsane_mode = preferences.xsane_mode;
+ }
+ }
+
return result;
}
@@ -8726,23 +8735,23 @@ static int xsane_init(int argc, char **argv)
break;
case 'V': /* --viewer, default */
- preferences.xsane_mode = XSANE_VIEWER;
+ xsane.xsane_mode = XSANE_VIEWER;
break;
case 's': /* --save */
- preferences.xsane_mode = XSANE_SAVE;
+ xsane.xsane_mode = XSANE_SAVE;
break;
case 'c': /* --copy */
- preferences.xsane_mode = XSANE_COPY;
+ xsane.xsane_mode = XSANE_COPY;
break;
case 'f': /* --fax */
- preferences.xsane_mode = XSANE_FAX;
+ xsane.xsane_mode = XSANE_FAX;
break;
case 'm': /* --mail */
- preferences.xsane_mode = XSANE_MAIL;
+ xsane.xsane_mode = XSANE_MAIL;
break;
case 'n': /* --No-mode-selection */
@@ -9009,7 +9018,7 @@ int main(int argc, char **argv)
xsane.main_window_fixed = -1; /* no command line option given, use preferences or fixed */
xsane.mode = XSANE_STANDALONE;
- preferences.xsane_mode = XSANE_VIEWER;
+ xsane.xsane_mode = -1;
xsane.lineart_mode = XSANE_LINEART_STANDARD;
xsane.xsane_output_format = XSANE_PNM;
xsane.mode_selection = 1; /* enable selection of xsane mode */
diff --git a/src/xsane.h b/src/xsane.h
index d26a89c..339cb49 100644
--- a/src/xsane.h
+++ b/src/xsane.h
@@ -711,7 +711,7 @@ typedef struct Xsane
/* saving and transformation values: */
FILE *out;
-// int xsane_mode;
+ int xsane_mode;
int xsane_output_format;
long header_size;
int expand_lineart_to_grayscale;
diff --git a/xsane.CHANGES b/xsane.CHANGES
index ae830b9..6eb2476 100644
--- a/xsane.CHANGES
+++ b/xsane.CHANGES
@@ -2732,3 +2732,21 @@ xsane-0.97 -> 0.98:
- translations: U=updated, N=not updated, A=added/new
cs da de es fr hu it ja nl pl pt pt_BR ro ru sk sl sr sv tr vi zh
U U U N N U U N N N N N N U U N N N N N N
+
+xsane-0.98 -> 0.98a:
+--------------------
+
+ - corrected gimp_plugin bug:
+ xsane_mode now is hold in xsane.xsane_mode like bevore xsane-0.98,
+ additionally preferences.xsane_mode is used to store the user
+ selection
+ the user selection is loaded at program start when nothing else is predefined
+
+
+xsane-0.98a -> 0.98b:
+---------------------
+
+ - changed bug in header file due to conficting types in xsane-front-gtk.h
+ from: int xsane_set_resolution(int well_known_option, double resolution);
+ to: double xsane_set_resolution(int well_known_option, double resolution);
+
diff --git a/xsane.FAQ b/xsane.FAQ
index 2b568f4..e28447e 100644
--- a/xsane.FAQ
+++ b/xsane.FAQ
@@ -1,26 +1,8 @@
+Q: scanimage does work, xsane does not (or vice versa). What can I do?
-================================================================================
-Q: Have you considered adding a scan to PDF multipage functionality to XSane?
---------------------------------------------------------------------------------
-A:
-I already made up my mind about scanning to a pdf file.
-The pdf format is a bad format for scanning images.
-When you scan a text document to a pdf file then there are
-two large differences to usual pdf documents:
+A1: in most cases this is caused by at least two installations of sane-backends.
+Make sure only ony sane-backends version is installed.
-- the size of the scanned documents is about 10-50 times larger than
-the size of a comparable text document
-- you can not search such a document
-
-So scanning text and saving it as image to pdf is no good idea.
-
-And for scanning photos:
-The PDF format is a document format, more comparable
-to the Microsoft Word format than to jpeg, png or Tiff.
-When you scanned 100 pictures to a pdf document, how
-will you extract one of the pictures?
-
-I plan to include multipage tiff and postscript files.
-But not in the near future - I do not have the time for it
-in the moment.
-================================================================================
+A2: may be /usr/local/lib/sane, /usr/lib/sane or /lib/sane is listed in /etc/ld.so.conf
+this is not allowed. Remove theses lines from /etc/ld.so.conf and call
+ldconfig as root.
diff --git a/xsane.spec b/xsane.spec
index 391d035..559241b 100644
--- a/xsane.spec
+++ b/xsane.spec
@@ -1,5 +1,5 @@
%define name xsane
-%define version 0.98
+%define version 0.98b
%define release 1
%define prefix /usr