diff options
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | include/config.h | 4 | ||||
-rw-r--r-- | po/it.gmo | bin | 50679 -> 59505 bytes | |||
-rw-r--r-- | po/it.po | 295 | ||||
-rw-r--r-- | src/xsane-back-gtk.c | 14 | ||||
-rw-r--r-- | src/xsane-batch-scan.c | 14 | ||||
-rw-r--r-- | src/xsane-device-preferences.c | 10 | ||||
-rw-r--r-- | src/xsane-email-project.c | 38 | ||||
-rw-r--r-- | src/xsane-fax-project.c | 32 | ||||
-rw-r--r-- | src/xsane-front-gtk.c | 30 | ||||
-rw-r--r-- | src/xsane-gamma.c | 4 | ||||
-rw-r--r-- | src/xsane-multipage-project.c | 74 | ||||
-rw-r--r-- | src/xsane-preview.c | 24 | ||||
-rw-r--r-- | src/xsane-save.c | 90 | ||||
-rw-r--r-- | src/xsane-scan.c | 38 | ||||
-rw-r--r-- | src/xsane-setup.c | 6 | ||||
-rw-r--r-- | src/xsane-viewer.c | 48 | ||||
-rw-r--r-- | src/xsane.c | 237 | ||||
-rw-r--r-- | src/xsane.h | 10 | ||||
-rw-r--r-- | xsane.CHANGES | 38 | ||||
-rw-r--r-- | xsane.TODO | 6 | ||||
-rw-r--r-- | xsane.spec | 2 |
24 files changed, 474 insertions, 550 deletions
@@ -1321,7 +1321,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # version code: V_MAJOR=0 -V_MINOR=99 +V_MINOR=991 PACKAGE=xsane diff --git a/configure.in b/configure.in index 7585bad..f942795 100644 --- a/configure.in +++ b/configure.in @@ -6,7 +6,7 @@ AC_CONFIG_HEADER(include/config.h) # version code: V_MAJOR=0 -V_MINOR=99 +V_MINOR=991 PACKAGE=xsane diff --git a/debian/changelog b/debian/changelog index 113b378..722b5e2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xsane (0.99+0.991-1) unstable; urgency=low + + * New upstream bugfix release (0.991). + + -- Julien BLACHE <jblache@debian.org> Tue, 24 Jan 2006 23:14:44 +0100 + xsane (0.99-1) unstable; urgency=low * New upstream release. diff --git a/include/config.h b/include/config.h index 87cd1a0..43f2485 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.99" +#define VERSION "0.991" /* The concatenation of the strings PACKAGE, "-", and VERSION. */ -#define XSANE_PACKAGE_VERSION "xsane-0.99" +#define XSANE_PACKAGE_VERSION "xsane-0.991" /* Define if you have the __argz_count function. */ #define HAVE___ARGZ_COUNT 1 Binary files differ@@ -1,13 +1,13 @@ -# translation of xsane-0.98pre3_it.po to Italiano -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. -# Kostantino <ciclope10ATalice.it>, 2005. -# Kostantino <ciclope10ATalice.it>, 2005. +# translation of xsane-0.99_it.po to Italiano +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Kostantino <ciclope10ATalice.it>, 2006. +# Kostantino <ciclope10ATalice.it>, 2006. # msgid "" msgstr "" -"Project-Id-Version: xsane-0.98pre3_it\n" +"Project-Id-Version: xsane-0.99_it\n" "POT-Creation-Date: 2006-01-07 00:26+0100\n" -"PO-Revision-Date: 2005-10-29 20:59+0200\n" +"PO-Revision-Date: 2006-01-09 21:47+0100\n" "Last-Translator: Kostantino <ciclope10ATalice.it>\n" "Language-Team: Italiano <tp@lists.linux.it>\n" "MIME-Version: 1.0\n" @@ -19,7 +19,7 @@ msgstr "" #. Please translate this to the correct directory name (eg. german=>de) #. XSANE_LANGUAGE_DIR msgid "language_dir" -msgstr "Cartella_lingua" +msgstr "it" #. XSANE_COPYRIGHT_SIGN msgid "(c)" @@ -83,24 +83,20 @@ msgid "insert ps-file into fax" msgstr "Inserisci file PS nel fax" #. WINDOW_EMAIL_PROJECT -#, fuzzy msgid "E-mail project" -msgstr "Progetto posta" +msgstr "Progetto e-mail" #. WINDOW_EMAIL_RENAME -#, fuzzy msgid "rename e-mail image" -msgstr "Rinomina l'immagine della posta" +msgstr "Rinomina l'immagine e-mail" #. WINDOW_EMAIL_INSERT -#, fuzzy msgid "insert file into e-mail" -msgstr "Inserisci un file nella posta" +msgstr "Inserisci un file nell'e-mail" #. WINDOW_MULTIPAGE_PROJECT -#, fuzzy msgid "multipage project" -msgstr "Elimina progetto" +msgstr "Progetto multipagina" #. WINDOW_PRESET_AREA_RENAME msgid "rename preset area" @@ -391,9 +387,8 @@ msgid "Send project" msgstr "Invia progetto" #. BUTTON_SAVE_MULTIPAGE -#, fuzzy msgid "Save multipage file" -msgstr "Salva immagine" +msgstr "Salva file multipagina" #. BUTTON_DELETE_PROJECT msgid "Delete project" @@ -436,9 +431,8 @@ msgid "Fine mode" msgstr "Modalità fine" #. RADIO_BUTTON_HTML_EMAIL -#, fuzzy msgid "HTML e-mail" -msgstr "Posta in HTML" +msgstr "Posta HTML" #. RADIO_BUTTON_SAVE_DEVPREFS_AT_EXIT msgid "Save device preferences at exit" @@ -454,11 +448,11 @@ msgstr "Salta i nomi dei file esistenti" #. RADIO_BUTTON_SAVE_PS_FLATDECODED msgid "Save postscript zlib compressed (ps level 3)" -msgstr "" +msgstr "Salva come postscript compresso zlib (ps di livello 3)" #. RADIO_BUTTON_SAVE_PDF_FLATDECODED msgid "Save PDF zlib compressed" -msgstr "" +msgstr "Salva come PDF compresso zlib" #. RADIO_BUTTON_SAVE_PNM16_AS_ASCII msgid "Save 16bit pnm in ascii format" @@ -697,7 +691,6 @@ msgstr "" "VENDIBILITA' o di UTILITA' PER UN SCOPO PARTICOLARE.\n" #. TEXT_EMAIL_ADR -#, fuzzy msgid "E-mail:" msgstr "Posta elettronica:" @@ -718,15 +711,14 @@ msgstr "Traduzione: " #. by YOUR NAME\n #. E-mail: your.name@yourdomain.com\n #. TEXT_TRANSLATION_INFO -#, fuzzy msgid "" "untranslated original english text\n" "by Oliver Rauch\n" "E-mail: Oliver.Rauch@rauch-domain.de\n" msgstr "" -"Testo originale inglese non tradottot\n" -"a cura di Oliver Rauch\n" -"Posta elettronica: Oliver.Rauch@rauch-domain.de\n" +"Testo originale inglese tradotto in italiano\n" +"a cura di Costantino Ceoldo\n" +"Posta elettronica: ciclope10ATalice.it\n" #. TEXT_INFO_BOX msgid "0x0: 0KB" @@ -737,9 +729,8 @@ msgid "Scanned pages: " msgstr "Pagine acquisite: " #. TEXT_EMAIL_TEXT -#, fuzzy msgid "E-mail text:" -msgstr "Testo di posta elettronica:" +msgstr "Testo dell'e-mail:" #. TEXT_ATTACHMENTS msgid "Attachments:" @@ -750,19 +741,16 @@ msgid "Project status:" msgstr "Stato progetto:" #. TEXT_EMAIL_FILETYPE -#, fuzzy msgid "E-mail image filetype:" -msgstr "Tipo di file dell'immagine di posta:" +msgstr "Tipo di file dell'e-mail:" #. TEXT_PAGES -#, fuzzy msgid "Pages:" -msgstr "Utilizzo:" +msgstr "Pagine:" #. TEXT_MULTIPAGE_FILETYPE -#, fuzzy msgid "Multipage document filetype:" -msgstr "Tipo di file dell'immagine di posta:" +msgstr "Tipo di documento multipagina:" #. TEXT_MEDIUM_DEFINITION_NAME msgid "Medium Name:" @@ -879,6 +867,7 @@ msgstr "Blu della gamma della stampante:" #. TEXT_SETUP_PRINTER_PS_FLATDECODED msgid "Create zlib compressed postscript image (ps level 3) for printing" msgstr "" +"Per la stampa crea immagine postscript compressa zlib (PS di livello 3) " #. TEXT_SETUP_TMP_PATH msgid "Temporary directory" @@ -905,9 +894,8 @@ msgid "Filename counter length" msgstr "Lunghezza del contatore dei nomi file" #. TEXT_SETUP_TIFF_ZIP_COMPRESSION -#, fuzzy msgid "TIFF zip compression rate" -msgstr "Compressione dell'immagine TIFF a 8 bit" +msgstr "Tasso di compressione zip TIFF" #. TEXT_SETUP_TIFF_COMPRESSION_16 msgid "TIFF 16 bit image compression" @@ -1003,7 +991,7 @@ msgstr "Visualizzatore (Postscript):" #. TEXT_SETUP_FAX_PS_FLATDECODED msgid "Create zlib compressed postscript image (ps level 3) for fax" -msgstr "" +msgstr "Per il fax crea immagine postscript compressa zlib (PS livello 3)" #. TEXT_SETUP_SMTP_SERVER msgid "SMTP server:" @@ -1022,17 +1010,14 @@ msgid "Reply to:" msgstr "Rispondi a:" #. TEXT_SETUP_EMAIL_AUTHENTICATION -#, fuzzy msgid "E-mail authentication" -msgstr "Autenticazione POP3" +msgstr "Autenticazione e-mail" #. TEXT_SETUP_EMAIL_AUTH_USER -#, fuzzy msgid "User:" -msgstr "Utilizzo:" +msgstr "Utente:" #. TEXT_SETUP_EMAIL_AUTH_PASS -#, fuzzy msgid "Password:" msgstr "Password:" @@ -1088,9 +1073,8 @@ msgid "Save" msgstr "Salva" #. NOTEBOOK_FILETYPE_OPTIONS -#, fuzzy msgid "Filetype" -msgstr "File " +msgstr "Tipo file" #. NOTEBOOK_COPY_OPTIONS msgid "Copy" @@ -1101,9 +1085,8 @@ msgid "Fax" msgstr "Fax " #. NOTEBOOK_EMAIL_OPTIONS -#, fuzzy msgid "E-mail" -msgstr "Posta elettronica" +msgstr "E-mail" #. NOTEBOOK_OCR_OPTIONS msgid "OCR" @@ -1119,7 +1102,7 @@ msgstr "Miglioramento" #. MENU_ITEM_MULTIPAGE msgid "Multipage" -msgstr "" +msgstr "Multipagina" #. MENU_ITEM_SHOW_TOOLTIPS msgid "Show tooltips" @@ -1266,9 +1249,8 @@ msgid "pack bits" msgstr "comprimi bit" #. MENU_ITEM_TIFF_COMP_DEFLATE -#, fuzzy msgid "deflate" -msgstr "ritardata" +msgstr "ridimensiona" #. MENU_ITEM_RANGE_SCALE msgid "Slider (Scale)" @@ -1335,25 +1317,24 @@ msgid "Move item down" msgstr "Sposta in giù l'oggetto" #. MENU_ITEM_AUTH_NONE -#, fuzzy msgid "no authentication" -msgstr "Autenticazione POP3" +msgstr "nessuna autenticazione" #. MENU_ITEM_AUTH_POP3 msgid "POP3 before SMTP" -msgstr "" +msgstr "POP3 prima di SMTP" #. MENU_ITEM_AUTH_ASMTP_PLAIN msgid "ASMTP Plain" -msgstr "" +msgstr "Piano ASMTP" #. MENU_ITEM_AUTH_ASMTP_LOGIN msgid "ASMTP Login" -msgstr "" +msgstr "Login ASMTP" #. MENU_ITEM_AUTH_ASMTP_CRAM_MD5 msgid "ASMTP CRAM-MD5" -msgstr "" +msgstr "ASMTP CRAM-MD5" #. PROGRESS_SCANNING msgid "Scanning" @@ -1365,9 +1346,8 @@ msgid "Receiving %s data" msgstr "Sto ricevendo %s dati" #. PROGRESS_PAGE -#, fuzzy msgid "page" -msgstr "pacchetto" +msgstr "pagina" #. PROGRESS_TRANSFERING_DATA msgid "Transfering image" @@ -1430,13 +1410,12 @@ msgid "Cancel preview scan <Alt-ESC>" msgstr "Annulla anteprima <Alt-ESC>" #. DESC_XSANE_MODE -#, fuzzy msgid "" "viewer-<Ctrl-v>, save-<Ctrl-s>, photocopy-<Ctrl-c>, multipage-<Ctrl-m>, fax-" "<Ctrl-f> or e-mail-<Ctrl-e>" msgstr "" -"Salva <Ctrl-s>, Visualizza <Ctrl-v>, Fotocopia <Ctrl-c>, Fax <Ctrl-f> o " -"invia come Posta Elettronica <Ctrl-m>" +"visualizzatore-<Ctrl-v>, salva-<Ctrl-s>, fotocopia-<Ctrl-c>, multipagina-" +"<Ctrl-m>, fax-<Ctrl-f> oppure e-mail-<Ctrl-e>" #. DESC_XSANE_MEDIUM msgid "" @@ -1485,38 +1464,32 @@ msgid "Enter receiver phone number or address" msgstr "Inserisci numero telefonico o indirizzo del ricevente" #. DESC_EMAIL_PROJECT -#, fuzzy msgid "Enter name of e-mail project" -msgstr "Inserisci nome del Progetto Posta" +msgstr "Inserisci nome del progetto e-mail" #. DESC_EMAIL_IMAGENAME -#, fuzzy msgid "Enter new name for e-mail image" -msgstr "Inserisci nuovo nome per l'immagine della posta elettronica" +msgstr "Inserisci nuovo nome per l'immagine e-mail" #. DESC_EMAIL_RECEIVER -#, fuzzy msgid "Enter e-mail address" msgstr "Inserisci indirizzo di posta elettronica" #. DESC_EMAIL_SUBJECT -#, fuzzy msgid "Enter subject of e-mail" -msgstr "Inserisci argomento della posta elettronica" +msgstr "Inserisci argomento dell'e-mail" #. DESC_EMAIL_FILETYPE msgid "Select filetype for image attachments" msgstr "Seleziona il tipo di file per le immagini allegate" #. DESC_MULTIPAGE_PROJECT -#, fuzzy msgid "Enter name of multipage project" -msgstr "Inserisci nome del Progetto Posta" +msgstr "Inserisci nome del progetto multipagina" #. DESC_MULTIPAGE_FILETYPE -#, fuzzy msgid "Select filetype for multipage file" -msgstr "Seleziona il tipo di file per le immagini allegate" +msgstr "Seleziona il tipo di file multipagina" #. DESC_PRESET_AREA_RENAME msgid "Enter new name for preset area" @@ -1568,7 +1541,7 @@ msgstr "Imposta numero copie" #. DESC_NEGATIVE msgid "Negative: Invert colors for scanning negatives <Ctrl-n>" -msgstr "Negativo: inverte i colori per la scansione di negativi <Shift-n>" +msgstr "Negativo: inverte i colori per la scansione di negativi <Ctrl-n>" #. DESC_GAMMA msgid "Set gamma value" @@ -1639,7 +1612,7 @@ msgstr "" #. DESC_ENH_AUTO msgid "Autoadjust gamma, brightness and contrast <Ctrl-e>" msgstr "" -"Calibrazione automatica della gamma, della luminosità e del contrasto <Shift-" +"Calibrazione automatica della gamma, della luminosità e del contrasto <Ctrl-" "e>" #. DESC_ENH_DEFAULT @@ -1656,11 +1629,11 @@ msgstr "" #. DESC_ENH_RESTORE msgid "Restore enhancement values from preferences <Ctrl-r>" -msgstr "Ripristina i valori di miglioramento dalle preferenze <Shift-r>" +msgstr "Ripristina i valori di miglioramento dalle preferenze <Ctrl-r>" #. DESC_ENH_STORE msgid "Store active enhancement values to preferences <Ctrl-+>" -msgstr "Salva i valori attivi di miglioramento nelle preferenze <Shift-m>" +msgstr "Salva i valori attivi di miglioramento nelle preferenze <Ctrl-+>" #. DESC_HIST_INTENSITY msgid "Show histogram of intensity/gray <Alt-i>" @@ -1761,6 +1734,8 @@ msgid "" "Create zlib compressed postscript image for printer (flatdecode).\n" "The printer has to understand postscript level 3!" msgstr "" +"Crea immagine postscript compressa zlib per la stampa (decodifica flat).\n" +"La stampante deve capire il linguaggio postscript di livello 3!" #. DESC_TMP_PATH msgid "Path to temp directory" @@ -1786,9 +1761,9 @@ msgid "Minimum length of counter in filename" msgstr "Lunghezza minima del contatore nel nome file" #. DESC_TIFF_ZIP_COMPRESSION -#, fuzzy msgid "Compression rate for zip compressed tiff (deflate)" -msgstr "Tipo di compressione se l'immagine a 8 bit viene salvata come TIFF" +msgstr "" +"Tasso di compressione per le immagini TIFF compresse zip (ridimensiona)" #. DESC_TIFF_COMPRESSION_16 msgid "Compression type if 16 bit image is saved as tiff" @@ -1824,10 +1799,13 @@ msgid "" "compress postscript image with zlib algorithm (flatdecode). When you want to " "print such a file your printer has to understand postscript level 3" msgstr "" +"comprimi immagine postscript con un algoritmo zlib (decodifica flat). La tua " +"stampante deve comprendere il linguaggio postscript di livello 3 quando vuoi " +"stampare un simile file." #. DESC_SAVE_PDF_FLATDECODED msgid "compress PDF image with zlib algorithm (flatdecode)." -msgstr "" +msgstr "comprimi immagine PDF con algoritmo zlib (decodifica flat)." #. DESC_SAVE_PNM16_AS_ASCII msgid "" @@ -1959,7 +1937,7 @@ msgstr "" #. DESC_ADF_PAGES_MAX msgid "Number of pages to scan" -msgstr "" +msgstr "Numero di pagine da scannerizzare" #. DESC_PREVIEW_PIPETTE_RANGE msgid "dimension of square that is used to average color for pipette function" @@ -2020,7 +1998,7 @@ msgstr "" #. DESC_FAX_PS_FLATDECODED msgid "Create zlib compressed postscript image for fax (flatdecode)" -msgstr "" +msgstr "Crea immagine postscript compressa zlib per il fax (decodifica flat)" #. DESC_SMTP_SERVER msgid "IP Address or Domain name of SMTP server" @@ -2031,29 +2009,24 @@ msgid "port to connect to SMTP server" msgstr "Porta del server SMTP a cui connettersi" #. DESC_EMAIL_FROM -#, fuzzy msgid "enter your e-mail address" -msgstr "Inserisci il tuo indirizzo di posta elettronica" +msgstr "inserisci il tuo indirizzo di posta elettronica" #. DESC_EMAIL_REPLY_TO -#, fuzzy msgid "enter e-mail address for replied e-mails" -msgstr "Inserisci l'indirizzo a cui inviare le risposte" +msgstr "inserisci l'indirizzo a cui inviare le risposte" #. DESC_EMAIL_AUTHENTICATION -#, fuzzy msgid "Type of authentication before sending e-mail" -msgstr "Autenticati sul server POP3 prima di inviare della posta elettronica" +msgstr "Tipo di autenticazione prima di spedire un'email" #. DESC_EMAIL_AUTH_USER -#, fuzzy msgid "user name for e-mail server" -msgstr "Nome utente per il server POP3" +msgstr "nome utente per il server di posta" #. DESC_EMAIL_AUTH_PASS -#, fuzzy msgid "password for e-mail server" -msgstr "Password per il server POP3" +msgstr "password per il server di posta" #. DESC_POP3_SERVER msgid "IP Address or Domain name of POP3 server" @@ -2064,7 +2037,6 @@ msgid "port to connect to POP3 server" msgstr "Porta del server POP3 a cui connettersi" #. DESC_HTML_EMAIL -#, fuzzy msgid "E-mail is sent in html mode, place image with: <IMAGE>" msgstr "" "La posta viene spedita in formato HTML, posiziona l'immagine con: <IMMAGINE>" @@ -2297,6 +2269,10 @@ msgid "" "select a temporary directory where you have\n" "write permissions." msgstr "" +"Non posso creare un file temporaneo.\n" +"Apri Menu Preferenze->Impostazioni Linguetta Salva e\n" +"seleziona una cartella temporanea nella quale hai\n" +"permessi di scrittura." #. ERR_SET_OPTION msgid "Failed to set value of option" @@ -2454,7 +2430,7 @@ msgstr "Versione superiore dei backend =" #. ERR_PROGRAM_ABORTED msgid "*** PROGRAM ABORTED ***" -msgstr "*** PROGRAMMA ANNULLATO ***" +msgstr "*** PROGRAMMA ABORTITO ***" #. ERR_FAILED_ALLOCATE_IMAGE msgid "Failed to allocate image memory:" @@ -2582,7 +2558,6 @@ msgid "[OPTION]... [DEVICE]" msgstr "[OPZIONE]...[DISPOSITIVO]" #. TEXT_HELP -#, fuzzy msgid "" "Start up graphical user interface to access SANE (Scanner Access Now Easy) " "devices.\n" @@ -2674,15 +2649,15 @@ msgstr "" #. Menu path must not be translated, this is done by the gimp. Only translate the text behind the last "/" #. XSANE_GIMP_MENU_DIALOG msgid "<Toolbox>/File/Acquire/XSane: Device dialog..." -msgstr "<Toolbox>/File/Acquire/XSane: finestra dispositivo..." +msgstr "<Toolbox>/File/Acquisisci/XSane: Dialogo dispositivo..." #. XSANE_GIMP_MENU msgid "<Toolbox>/File/Acquire/XSane: " -msgstr "<Toolbox>/File/Acquire/XSane: " +msgstr "<Toolbox>/File/Acquisisci/XSane: " #. XSANE_GIMP_MENU_DIALOG_OLD msgid "<Toolbox>/Xtns/XSane/Device dialog..." -msgstr "<Toolbox>/Xtns/XSane/Finestra dispositivo..." +msgstr "<Toolbox>/Xtns/XSane/Dialogo dispositivo..." #. XSANE_GIMP_MENU_OLD msgid "<Toolbox>/Xtns/XSane/" @@ -2825,44 +2800,36 @@ msgid "Rossmann negative HR 100" msgstr "Negativo Rossmann HR 100" #. TEXT_PROJECT_STATUS_NOT_CREATED -#, fuzzy msgid "Project not created" -msgstr "Il progetto fax non è stato creato" +msgstr "Il progetto non è stato creato" #. TEXT_PROJECT_STATUS_CREATED -#, fuzzy msgid "Project created" -msgstr "Il progetto fax è stato creato" +msgstr "Il progetto è stato creato" #. TEXT_PROJECT_STATUS_CHANGED -#, fuzzy msgid "Project changed" -msgstr "Il progetto fax è stato cambiato" +msgstr "Il progetto è stato cambiato" #. TEXT_PROJECT_STATUS_ERR_READ_PROJECT -#, fuzzy msgid "Error reading project" -msgstr "Si è verificato un errore leggendo il progetto di posta" +msgstr "Si è verificato un errore leggendo il progetto" #. TEXT_PROJECT_STATUS_FILE_SAVING_ERROR -#, fuzzy msgid "Error saving file" -msgstr "Salvataggio immagine" +msgstr "Si è verificato un errore salvando il file" #. TEXT_PROJECT_STATUS_FILE_SAVING -#, fuzzy msgid "Saving file" -msgstr "Salvataggio immagine" +msgstr "Salvataggio del file" #. TEXT_PROJECT_STATUS_FILE_SAVING_ABORTED -#, fuzzy msgid "Aborted saving file" -msgstr "Salvataggio immagine" +msgstr "Il salvataggio del file è abortito" #. TEXT_PROJECT_STATUS_FILE_SAVED -#, fuzzy msgid "File has been saved" -msgstr "La posta è stata spedita" +msgstr "Il file è stato salvato" #. TEXT_EMAIL_STATUS_POP3_CONNECTION_FAILED msgid "POP3 connection failed" @@ -2873,9 +2840,8 @@ msgid "POP3 login failed" msgstr "Il login POP3 è fallito" #. TEXT_EMAIL_STATUS_ASMTP_AUTH_FAILED -#, fuzzy msgid "ASMTP authentication failed" -msgstr "La connessione SMTP è fallita" +msgstr "L'autenticazione ASMTP non è riuscita" #. TEXT_EMAIL_STATUS_SMTP_CONNECTION_FAILED msgid "SMTP connection failed" @@ -2890,17 +2856,14 @@ msgid "Receiver entry not accepted" msgstr "La voce Ricevente non è stata accettata" #. TEXT_EMAIL_STATUS_SMTP_ERR_DATA -#, fuzzy msgid "E-mail data not accepted" -msgstr "I dati di posta non sono stati accettati" +msgstr "I dati dell'e-mail non sono stati accettati" #. TEXT_EMAIL_STATUS_SENDING -#, fuzzy msgid "Sending e-mail" -msgstr "Invio posta" +msgstr "Invio della posta" #. TEXT_EMAIL_STATUS_SENT -#, fuzzy msgid "E-mail has been sent" msgstr "La posta è stata spedita" @@ -2950,7 +2913,7 @@ msgid "End of file reached" msgstr "E' stata raggiunta la fine del file" msgid "Document feeder jammed" -msgstr "Si è inceppato l'alimentatore dei fogli" +msgstr "L'alimentatore dei fogli si è inceppato" msgid "Document feeder out of documents" msgstr "L'alimentatore dei fogli ha esaurito la carta" @@ -2966,95 +2929,3 @@ msgstr "La memoria è esaurita" msgid "Access to resource has been denied" msgstr "L'accesso alla risorsa è negato" - -#~ msgid "Could not create temporary file" -#~ msgstr "Non è possibile creare alcun file temporaneo" - -#~ msgid "Could not create temporary preview files" -#~ msgstr "Non è possibile creare file temporanei per l'anteprima" - -#~ msgid "Could not create filenames for preview files" -#~ msgstr "Non è possibile creare i nomi dei file per l'anteprima" - -#, fuzzy -#~ msgid "POP3 authentication" -#~ msgstr "Autenticazione POP3" - -#~ msgid "XSane mode" -#~ msgstr "Modalità di XSane" - -#~ msgid "POP3 user:" -#~ msgstr "Utente POP3:" - -#~ msgid "POP3 password:" -#~ msgstr "Password POP3:" - -#~ msgid "Automatic Document Feeder Modus:" -#~ msgstr "Modalità automatica dell'alimentatore dei fogli:" - -#~ msgid "" -#~ "Select scansource for Automatic Document feeder. If this scansource is " -#~ "selected XSane scans until \"out of paper\" or error." -#~ msgstr "" -#~ "Seleziona l'alimentatore ADF. Se viene selezionato, XSane acquisisce fino " -#~ "a \"Fine carta\" o ad un errore." - -#, fuzzy -#~ msgid "E-mail project not created" -#~ msgstr "Il progetto di posta non è stato creato" - -#, fuzzy -#~ msgid "E-mail project created" -#~ msgstr "Il progetto di posta è stato creato" - -#, fuzzy -#~ msgid "E-mail project changed" -#~ msgstr "Il progetto di posta è stato cambiato" - -#, fuzzy -#~ msgid "Multipage project not created" -#~ msgstr "Il progetto di posta non è stato creato" - -#, fuzzy -#~ msgid "Multipage project created" -#~ msgstr "Il progetto di posta è stato creato" - -#, fuzzy -#~ msgid "Multipage project changed" -#~ msgstr "Il progetto di posta è stato cambiato" - -#, fuzzy -#~ msgid "Error reading multipage project" -#~ msgstr "Si è verificato un errore leggendo il progetto di posta" - -#, fuzzy -#~ msgid "Saving multipage file" -#~ msgstr "Salvataggio immagine" - -#, fuzzy -#~ msgid "Multipage saving aborted" -#~ msgstr "Il progetto di posta è stato creato" - -#~ msgid "Image" -#~ msgstr "Immagine" - -#~ msgid "Viewer (png):" -#~ msgstr "Visualizzatore (PNG):" - -#, fuzzy -#~ msgid "Enter command to be executed to view an e-mail image" -#~ msgstr "" -#~ "Inserisci il comando da eseguire per visualizzare un'immagine via posta " -#~ "elettronica" - -#, fuzzy -#~ msgid "Failed to execute e-mail image viewer:" -#~ msgstr "" -#~ "Non è possibile eseguire il visualizzatore dell'immagine via posta " -#~ "elettronica:" - -#~ msgid "Step" -#~ msgstr "Incremento" - -#~ msgid "Mail" -#~ msgstr "Posta" diff --git a/src/xsane-back-gtk.c b/src/xsane-back-gtk.c index 6599c98..10ac0b3 100644 --- a/src/xsane-back-gtk.c +++ b/src/xsane-back-gtk.c @@ -406,7 +406,7 @@ int xsane_back_gtk_make_path(size_t buf_size, char *buf, const char *prog_name, if (location == XSANE_PATH_TMP) /* tmp dir, add uid */ { - char tmpbuf[256]; + char tmpbuf[TEXTBUFSIZE]; uid_t uid; int fd; @@ -469,7 +469,7 @@ void xsane_back_gtk_set_option(int opt_num, void *val, SANE_Action action) { SANE_Status status; SANE_Int info; - char buf[256]; + char buf[TEXTBUFSIZE]; int old_colors = xsane.xsane_colors; int update_gamma = FALSE; @@ -789,12 +789,12 @@ gint xsane_back_gtk_decision(gchar *title, gchar **xpm_d, gchar *message, gchar void xsane_back_gtk_ipc_dialog_callback(gpointer data, gint source, GdkInputCondition cond) { - char message[256]; + char message[TEXTBUFSIZE]; size_t bytes; DBG(DBG_proc, "xsane_back_gtk_message\n"); - bytes = read(xsane.ipc_pipefd[0], message, 255); + bytes = read(xsane.ipc_pipefd[0], message, sizeof(message)-1); message[bytes] = 0; xsane_back_gtk_decision(ERR_HEADER_CHILD_PROCESS_ERROR, (gchar **) error_xpm, message, BUTTON_CLOSE, 0 /* no reject text */, FALSE); @@ -877,7 +877,7 @@ char *fileselection_filetype = NULL; static void xsane_back_gtk_filetype_callback(GtkWidget *widget, gpointer data) { char *extension, *filename; - char buffer[256]; + char buffer[PATH_MAX]; char *new_filetype = (char *) data; DBG(DBG_proc, "xsane_filetype_callback\n"); @@ -1302,7 +1302,7 @@ static gint xsane_back_gtk_autobutton_update(GtkWidget *widget, DialogElement *e const SANE_Option_Descriptor *opt; SANE_Status status; SANE_Word val; - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_back_gtk_autobutton_update\n"); @@ -1466,7 +1466,7 @@ static void xsane_back_gtk_value_update(GtkAdjustment *adj_data, DialogElement * static void xsane_back_gtk_range_display_value_right_callback(GtkAdjustment *adjust, gpointer data) { - gchar buf[256]; + gchar buf[TEXTBUFSIZE]; int digits = (int) data; GtkLabel *label; diff --git a/src/xsane-batch-scan.c b/src/xsane-batch-scan.c index a356612..604e052 100644 --- a/src/xsane-batch-scan.c +++ b/src/xsane-batch-scan.c @@ -81,7 +81,7 @@ desc[] = static void xsane_batch_scan_get_parameters(Batch_Scan_Parameters *parameters) { - char buf[255]; + char buf[TEXTBUFSIZE]; SANE_Int unit; DBG(DBG_proc, "xsane_batch_scan_get_parameters\n"); @@ -336,7 +336,7 @@ int xsane_batch_scan_load_list_from_file(char *filename) static void xsane_batch_scan_load_list(void) { char filename[PATH_MAX]; - char windowname[256]; + char windowname[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_batch_scan_load_list\n"); @@ -349,7 +349,7 @@ static void xsane_batch_scan_load_list(void) { if (xsane_batch_scan_load_list_from_file(filename)) /* error while loading file ? */ { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, filename, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -387,7 +387,7 @@ static void xsane_batch_scan_save_list(void) int fd; Wire w; char filename[PATH_MAX]; - char windowname[256]; + char windowname[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_batch_scan_save_list\n"); @@ -429,7 +429,7 @@ static void xsane_batch_scan_save_list(void) } else { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, filename, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -599,7 +599,7 @@ static void xsane_batch_scan_delete(void) static void xsane_batch_scan_update_label(Batch_Scan_Parameters *parameters) { - char buf[256]; + char buf[TEXTBUFSIZE]; const char *unit_str; double tl_x = parameters->tl_x; double tl_y = parameters->tl_y; @@ -847,7 +847,7 @@ static void xsane_batch_scan_rename_callback(GtkWidget *widget, gpointer data) GtkWidget *text; GtkWidget *button; GtkWidget *vbox, *hbox; - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_batch_scan_rename\n"); diff --git a/src/xsane-device-preferences.c b/src/xsane-device-preferences.c index 57c5ae8..003cb77 100644 --- a/src/xsane-device-preferences.c +++ b/src/xsane-device-preferences.c @@ -366,7 +366,7 @@ static int xsane_device_preferences_save_values(Wire *w, SANE_Handle device) void xsane_device_preferences_load_file(char *filename) { int fd; - char buf[256]; + char buf[TEXTBUFSIZE]; #if 0 char *version = 0; #endif @@ -461,7 +461,7 @@ void xsane_device_preferences_load_file(char *filename) if (w.status) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s\n%s %s", ERR_LOAD_DEVICE_SETTINGS, filename, ERR_NO_DRC_FILE); xsane_back_gtk_error(buf, TRUE); @@ -612,7 +612,7 @@ void xsane_device_preferences_restore(void) void xsane_device_preferences_load(void) { char filename[PATH_MAX]; - char windowname[256]; + char windowname[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_device_preferences_load\n"); @@ -649,7 +649,7 @@ void xsane_device_preferences_save_file(char *filename) fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (fd < 0) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s.", ERR_FAILED_CREATE_FILE, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -763,7 +763,7 @@ void xsane_device_preferences_store(void) void xsane_device_preferences_save(void) { char filename[PATH_MAX]; - char windowname[256]; + char windowname[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_device_preferences_save\n"); diff --git a/src/xsane-email-project.c b/src/xsane-email-project.c index 67713ec..79df15b 100644 --- a/src/xsane-email-project.c +++ b/src/xsane-email-project.c @@ -489,7 +489,7 @@ static void xsane_email_project_set_sensitive(int sensitive) static void xsane_email_project_display_status() { FILE *lockfile; - char buf[256]; + char buf[TEXTBUFSIZE]; char filename[PATH_MAX]; int val; int i, c; @@ -606,10 +606,10 @@ static gint xsane_email_send_timer_callback(gpointer data) static void xsane_email_project_load() { FILE *projectfile; - char page[256]; + char page[TEXTBUFSIZE]; char *type; char *extension; - char buf[256]; + char buf[TEXTBUFSIZE]; char filename[PATH_MAX]; GtkWidget *list_item; int i; @@ -858,7 +858,7 @@ static void xsane_email_project_delete() { char *page; char *type; - char file[256]; + char file[PATH_MAX]; GList *list = (GList *) GTK_LIST(xsane.project_list)->children; GtkObject *list_item; @@ -890,7 +890,7 @@ static void xsane_email_project_update_project_status() { FILE *projectfile; char filename[PATH_MAX]; - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(filename, sizeof(filename), "%s/xsane-mail-list", preferences.email_project); projectfile = fopen(filename, "r+b"); /* r+ = read and write, position = start of file */ @@ -911,7 +911,7 @@ void xsane_email_project_save() char *page; char *type; gchar *email_text; - char filename[256]; + char filename[PATH_MAX]; DBG(DBG_proc, "xsane_email_project_save\n"); @@ -922,7 +922,7 @@ void xsane_email_project_save() if (xsane_create_secure_file(filename)) /* remove possibly existing symbolic links for security */ { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s %s\n", ERR_DURING_SAVE, ERR_CREATE_SECURE_FILE, filename); xsane_back_gtk_error(buf, TRUE); @@ -933,7 +933,7 @@ void xsane_email_project_save() if (xsane.email_status) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, 32, "%s@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", xsane.email_status); /* fill 32 characters status line */ fprintf(projectfile, "%s\n", buf); /* first line is status of email */ @@ -1224,8 +1224,8 @@ static void xsane_email_entry_rename_callback(GtkWidget *widget, gpointer list) char *oldpage; char *newpage; char *type; - char oldfile[256]; - char newfile[256]; + char oldfile[PATH_MAX]; + char newfile[PATH_MAX]; DBG(DBG_proc, "xsane_email_entry_rename_callback\n"); @@ -1344,7 +1344,7 @@ static void xsane_email_entry_delete_callback(GtkWidget *widget, gpointer list) GList *select; char *page; char *type; - char file[256]; + char file[PATH_MAX]; DBG(DBG_proc, "xsane_email_entry_delete_callback\n"); @@ -1378,7 +1378,7 @@ static void xsane_email_show_callback(GtkWidget *widget, gpointer list) GList *select; char *page; char *type; - char filename[256]; + char filename[PATH_MAX]; DBG(DBG_proc, "xsane_email_entry_show_callback\n"); @@ -1406,8 +1406,8 @@ static void xsane_email_edit_callback(GtkWidget *widget, gpointer list) GList *select; char *page; char *type; - char filename[256]; - char outfilename[256]; + char filename[PATH_MAX]; + char outfilename[PATH_MAX]; Image_info image_info; int cancel_save = 0; @@ -1447,10 +1447,10 @@ static void xsane_create_email(int fd) char *email_text_pos = NULL; char **attachment_filename = NULL; char *mime_type = NULL; - char buf[256]; - char filename[256]; - char content_id[256]; - char image[256]; + char buf[TEXTBUFSIZE]; + char filename[PATH_MAX]; + char content_id[TEXTBUFSIZE]; + char image[TEXTBUFSIZE]; int i, j; int c; int attachments = 0; @@ -1536,7 +1536,7 @@ static void xsane_create_email(int fd) if (strcmp("mailtext:", image) && (c > 1)) { - char imagename[256]; + char imagename[PATH_MAX]; char *filename; char *extension; diff --git a/src/xsane-fax-project.c b/src/xsane-fax-project.c index 0d0e4dc..8f23bf2 100644 --- a/src/xsane-fax-project.c +++ b/src/xsane-fax-project.c @@ -277,7 +277,7 @@ void xsane_fax_dialog() static void xsane_fax_project_load() { FILE *projectfile; - char page[256]; + char page[TEXTBUFSIZE]; char filename[PATH_MAX]; GtkWidget *list_item; int i; @@ -417,7 +417,7 @@ static void xsane_fax_project_load() static void xsane_fax_project_delete() { char *page; - char file[256]; + char file[PATH_MAX]; GList *list = (GList *) GTK_LIST(xsane.project_list)->children; GtkObject *list_item; @@ -447,7 +447,7 @@ static void xsane_fax_project_update_project_status() { FILE *projectfile; char filename[PATH_MAX]; - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(filename, sizeof(filename), "%s/xsane-fax-list", preferences.fax_project); projectfile = fopen(filename, "r+b"); /* r+ = read and write, position = start of file */ @@ -465,7 +465,7 @@ void xsane_fax_project_save() FILE *projectfile; char *page; char *type; - char filename[256]; + char filename[PATH_MAX]; GList *list = (GList *) GTK_LIST(xsane.project_list)->children; GtkObject *list_item; @@ -479,7 +479,7 @@ void xsane_fax_project_save() if (xsane_create_secure_file(filename)) /* remove possibly existing symbolic links for security */ { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s %s\n", ERR_DURING_SAVE, ERR_CREATE_SECURE_FILE, filename); xsane_back_gtk_error(buf, TRUE); @@ -496,7 +496,7 @@ void xsane_fax_project_save() if (xsane.fax_status) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, 32, "%s@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", xsane.fax_status); /* fill 32 characters status line */ fprintf(projectfile, "%s\n", buf); /* first line is status of mail */ @@ -708,8 +708,8 @@ static void xsane_fax_entry_rename_callback(GtkWidget *widget, gpointer list) char *oldpage; char *newpage; char *type; - char oldfile[256]; - char newfile[256]; + char oldfile[PATH_MAX]; + char newfile[PATH_MAX]; DBG(DBG_proc, "xsane_fax_entry_rename_callback\n"); @@ -822,7 +822,7 @@ static void xsane_fax_entry_insert_callback(GtkWidget *widget, gpointer list) { GtkWidget *list_item; char filename[PATH_MAX]; - char windowname[255]; + char windowname[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_fax_entry_insert_callback\n"); @@ -917,7 +917,7 @@ static void xsane_fax_entry_insert_callback(GtkWidget *widget, gpointer list) } else { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), ERR_FILE_NOT_EXISTS, filename); xsane_back_gtk_decision(ERR_HEADER_ERROR, (gchar **) error_xpm, buf, BUTTON_OK, NULL, TRUE /* wait */); } @@ -964,7 +964,7 @@ static void xsane_fax_show_callback(GtkWidget *widget, gpointer list) GList *select; char *page; char *type; - char filename[256]; + char filename[PATH_MAX]; DBG(DBG_proc, "xsane_fax_entry_show_callback\n"); @@ -1042,7 +1042,7 @@ static int xsane_fax_convert_pnm_to_ps(char *source_filename, char *fax_filename FILE *outfile; FILE *infile; Image_info image_info; - char buf[256]; + char buf[TEXTBUFSIZE]; int cancel_save; /* open progressbar */ @@ -1089,7 +1089,7 @@ static int xsane_fax_convert_pnm_to_ps(char *source_filename, char *fax_filename } else { - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_info, "open of faxfile `%s'failed : %s\n", fax_filename, strerror(errno)); @@ -1101,7 +1101,7 @@ static int xsane_fax_convert_pnm_to_ps(char *source_filename, char *fax_filename } else { - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_info, "open of faxfile `%s'failed : %s\n", source_filename, strerror(errno)); @@ -1132,7 +1132,7 @@ static void xsane_fax_send() GtkObject *list_item; pid_t pid; char *arg[1000]; - char buf[256]; + char buf[TEXTBUFSIZE]; char source_filename[PATH_MAX]; char fax_filename[PATH_MAX]; int argnr = 0; @@ -1190,7 +1190,7 @@ static void xsane_fax_send() snprintf(fax_filename, sizeof(fax_filename), "%s/%s-fax%s", preferences.fax_project, page, fax_type); if (xsane_create_secure_file(fax_filename)) /* remove possibly existing symbolic links for security */ { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s %s\n", ERR_DURING_SAVE, ERR_CREATE_SECURE_FILE, fax_filename); xsane_back_gtk_error(buf, TRUE); diff --git a/src/xsane-front-gtk.c b/src/xsane-front-gtk.c index 4eb4add..a11779e 100644 --- a/src/xsane-front-gtk.c +++ b/src/xsane-front-gtk.c @@ -93,7 +93,7 @@ int xsane_parse_options(char *options, char *argv[]) int optpos = 0; int bufpos = 0; int arg = 0; - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_parse_options\n"); @@ -171,11 +171,11 @@ void xsane_get_bounds(const SANE_Option_Descriptor *opt, double *minp, double *m { if (min > -INF && min < INF) { - min = SANE_UNFIX (min); + min = SANE_UNFIX(min); } if (max > -INF && max < INF) { - max = SANE_UNFIX (max); + max = SANE_UNFIX(max); } } *minp = min; @@ -397,10 +397,6 @@ void xsane_set_all_resolutions(void) printer_resolution = preferences.printer[preferences.printernr]->color_resolution; break; } - - xsane.zoom = xsane.resolution / printer_resolution; - xsane.zoom_x = xsane.resolution_x / printer_resolution; - xsane.zoom_y = xsane.resolution_y / printer_resolution; } /* ---------------------------------------------------------------------------------------------------------------------- */ @@ -433,15 +429,15 @@ void xsane_define_maximum_output_size() if (preferences.paper_orientation >= 8) /* rotate: landscape */ { preview_set_maximum_output_size(xsane.preview, - preferences.printer[preferences.printernr]->height / xsane.zoom_y, - preferences.printer[preferences.printernr]->width / xsane.zoom_x, + preferences.printer[preferences.printernr]->height / xsane.zoom, + preferences.printer[preferences.printernr]->width / xsane.zoom, preferences.paper_orientation); } else /* do not rotate: portrait */ { preview_set_maximum_output_size(xsane.preview, - preferences.printer[preferences.printernr]->width / xsane.zoom_x, - preferences.printer[preferences.printernr]->height / xsane.zoom_y, + preferences.printer[preferences.printernr]->width / xsane.zoom, + preferences.printer[preferences.printernr]->height / xsane.zoom, preferences.paper_orientation); } break; @@ -1062,7 +1058,7 @@ void xsane_option_menu_new_with_pixmap(GdkWindow *window, GtkBox *parent, const static void xsane_range_display_value_right_callback(GtkAdjustment *adjust, gpointer data) { - gchar buf[256]; + gchar buf[TEXTBUFSIZE]; int digits = (int) data; GtkLabel *label; @@ -1264,8 +1260,8 @@ void xsane_range_new_with_pixmap(GdkWindow *window, GtkBox *parent, const char * static void xsane_browse_filename_callback(GtkWidget *widget, gpointer data) { - char filename[1024]; - char windowname[256]; + char filename[PATH_MAX]; + char windowname[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_browse_filename_callback\n"); @@ -1792,7 +1788,7 @@ int xsane_identify_output_format(char *filename, char *filetype, char **ext) void xsane_change_working_directory(void) { char filename[PATH_MAX]; - char windowname[256]; + char windowname[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_change_working_directory\n"); @@ -1804,7 +1800,7 @@ void xsane_change_working_directory(void) xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, NULL, TRUE, FALSE, TRUE, FALSE); if (chdir(filename)) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s (%s).", ERR_CHANGE_WORKING_DIR, filename, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -2362,7 +2358,7 @@ int xsane_front_gtk_getname_dialog(const char *dialog_title, const char *desc_te GtkWidget *button; GtkWidget *vbox, *hbox; GtkAccelGroup *accelerator_group; - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_getname_dialog, oldname = %s\n", oldname); diff --git a/src/xsane-gamma.c b/src/xsane-gamma.c index fdae222..40fe835 100644 --- a/src/xsane-gamma.c +++ b/src/xsane-gamma.c @@ -2173,7 +2173,7 @@ static gint xsane_histogram_win_delete(GtkWidget *widget, gpointer data) void xsane_create_histogram_dialog(const char *devicetext) { - char windowname[255]; + char windowname[TEXTBUFSIZE]; GtkWidget *xsane_color_hbox; GtkWidget *xsane_histogram_vbox; GtkWidget *button; @@ -2498,7 +2498,7 @@ GtkWidget* xsane_gamma_curve_notebook_page_new(GtkWidget *notebook, char *title) void xsane_create_gamma_dialog(const char *devicetext) { - char windowname[255]; + char windowname[TEXTBUFSIZE]; GtkWidget *xsane_vbox_gamma, *notebook; DBG(DBG_proc, "xsane_create_free_gamma_dialog\n"); diff --git a/src/xsane-multipage-project.c b/src/xsane-multipage-project.c index 5a6f1ab..20a1cc3 100644 --- a/src/xsane-multipage-project.c +++ b/src/xsane-multipage-project.c @@ -324,7 +324,7 @@ static void xsane_multipage_project_set_sensitive(int sensitive) static void xsane_multipage_project_load() { FILE *projectfile; - char page[256]; + char page[TEXTBUFSIZE]; char filename[PATH_MAX]; GtkWidget *list_item; int i; @@ -467,7 +467,7 @@ static void xsane_multipage_project_delete() { char *page; char *type; - char file[256]; + char file[PATH_MAX]; GList *list = (GList *) GTK_LIST(xsane.project_list)->children; GtkObject *list_item; @@ -502,7 +502,7 @@ void xsane_multipage_project_save() GtkObject *list_item; char *page; char *type; - char filename[256]; + char filename[PATH_MAX]; DBG(DBG_proc, "xsane_multipage_project_save\n"); @@ -513,7 +513,7 @@ void xsane_multipage_project_save() if (xsane_create_secure_file(filename)) /* remove possibly existing symbolic links for security */ { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s %s\n", ERR_DURING_SAVE, ERR_CREATE_SECURE_FILE, filename); xsane_back_gtk_error(buf, TRUE); @@ -524,7 +524,7 @@ void xsane_multipage_project_save() if (xsane.multipage_status) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, 32, "%s@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", xsane.multipage_status); /* fill 32 characters status line */ fprintf(projectfile, "%s\n", buf); /* first line is status of multipage */ @@ -694,7 +694,7 @@ static void xsane_multipage_entry_delete_callback(GtkWidget *widget, gpointer li GList *select; char *page; char *type; - char file[256]; + char file[PATH_MAX]; DBG(DBG_proc, "xsane_multipage_entry_delete_callback\n"); @@ -728,7 +728,7 @@ static void xsane_multipage_show_callback(GtkWidget *widget, gpointer list) GList *select; char *page; char *type; - char filename[256]; + char filename[PATH_MAX]; DBG(DBG_proc, "xsane_multipage_entry_show_callback\n"); @@ -805,8 +805,9 @@ static void xsane_multipage_save_file() Image_info image_info; long int source_size = 0; float imagewidth, imageheight; - char buf[255]; + char buf[TEXTBUFSIZE]; struct pdf_xref xref; + int remove_lineart_file = FALSE; DBG(DBG_proc, "xsane_multipage_save_file\n"); @@ -854,7 +855,7 @@ static void xsane_multipage_save_file() testfile = fopen(multipage_filename, "rb"); /* read binary (b for win32) */ if (testfile) /* filename used: skip */ { - char buf[256]; + char buf[TEXTBUFSIZE]; fclose(testfile); @@ -972,9 +973,6 @@ static void xsane_multipage_save_file() xsane_convert_text_to_filename(&image); snprintf(source_filename, sizeof(source_filename), "%s/%s%s", preferences.multipage_project, image, type); - snprintf(buf, sizeof(buf), "%s %s %d/%d", _(xsane.multipage_status), PROGRESS_PAGE, page, pages); - gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), buf); - imagefile = fopen(source_filename, "rb"); /* read binary (b for win32) */ if (!imagefile) { @@ -984,6 +982,48 @@ static void xsane_multipage_save_file() xsane_read_pnm_header(imagefile, &image_info); + /* reduce lineart images to lineart before conversion */ + if (image_info.reduce_to_lineart) + { + char lineart_filename[PATH_MAX]; + + DBG(DBG_info, "original image is a lineart => reduce to lineart\n"); + fclose(imagefile); + xsane_back_gtk_make_path(sizeof(lineart_filename), lineart_filename, 0, 0, "xsane-conversion-", xsane.dev_name, ".pbm", XSANE_PATH_TMP); + + snprintf(buf, sizeof(buf), "%s", PROGRESS_PACKING_DATA); + + gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), buf); + gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + + while (gtk_events_pending()) + { + gtk_main_iteration(); + } + + xsane_save_image_as_lineart(lineart_filename, source_filename, xsane.project_progress_bar, &cancel_save); + + strncpy(source_filename, lineart_filename, sizeof(source_filename)); + remove_lineart_file = TRUE; + + imagefile = fopen(source_filename, "rb"); /* read binary (b for win32) */ + if (imagefile == 0) + { + char buf[TEXTBUFSIZE]; + snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, source_filename, strerror(errno)); + xsane_back_gtk_error(buf, TRUE); + + return; + } + + xsane_read_pnm_header(imagefile, &image_info); + } + + + snprintf(buf, sizeof(buf), "%s %s %d/%d", _(xsane.multipage_status), PROGRESS_PAGE, page, pages); + gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), buf); + + if (output_format == XSANE_PS) { imagewidth = 72.0 * image_info.image_width/image_info.resolution_x; /* width in 1/72 inch */ @@ -1014,6 +1054,11 @@ static void xsane_multipage_save_file() } #endif + if (remove_lineart_file) + { + remove(source_filename); /* remove lineart pbm file */ + } + free(image); free(type); list = list->next; @@ -1027,7 +1072,7 @@ static void xsane_multipage_save_file() if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -1043,7 +1088,7 @@ static void xsane_multipage_save_file() if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -1076,7 +1121,6 @@ static void xsane_multipage_save_file() } xsane_multipage_project_save(); - gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.multipage_status)); gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); diff --git a/src/xsane-preview.c b/src/xsane-preview.c index b59ef1b..46d8611 100644 --- a/src/xsane-preview.c +++ b/src/xsane-preview.c @@ -1317,7 +1317,7 @@ static void preview_restore_option(Preview *p, int option, void *saved_value, in if (status != SANE_STATUS_GOOD) { - char buf[256]; + char buf[TEXTBUFSIZE]; opt = xsane_get_option_descriptor(dev, option); if (opt && opt->name) { @@ -1400,7 +1400,7 @@ static int preview_test_image_y(Preview *p) { if (p->image_y >= p->image_height) /* make sure backend does not send more data then expected */ { - char buf[256]; + char buf[TEXTBUFSIZE]; --p->image_y; preview_scan_done(p, 1); @@ -1417,7 +1417,7 @@ static int preview_test_image_y(Preview *p) static int preview_increment_image_y(Preview *p) { size_t extra_size, offset; - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_proc, "preview_increment_image_y\n"); @@ -1894,7 +1894,7 @@ static void preview_scan_done(Preview *p, int save_image) static int preview_get_memory(Preview *p) { - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_proc, "preview_get_memory\n"); @@ -1960,7 +1960,7 @@ static void preview_scan_start(Preview *p) { SANE_Handle dev = xsane.dev; SANE_Status status; - char buf[256]; + char buf[TEXTBUFSIZE]; int fd, y; DBG(DBG_proc, "preview_scan_start\n"); @@ -2065,7 +2065,7 @@ static void preview_scan_start(Preview *p) static int preview_make_image_path(Preview *p, size_t filename_size, char *filename, int level) { - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_proc, "preview_make_image_path\n"); @@ -2085,7 +2085,7 @@ int preview_create_batch_icon_from_file(Preview *p, FILE *in, Batch_Scan_Paramet int time; float psurface[4]; float dsurface[4]; - char buf[255]; + char buf[TEXTBUFSIZE]; float scale; int header = 0; int rotate16 = 16 - preview_gamma_input_bits; @@ -2456,7 +2456,7 @@ static int preview_restore_image_from_file(Preview *p, FILE *in, int min_quality size_t nread; guint16 *imagep; guint16 *imagepx; - char buf[255]; + char buf[TEXTBUFSIZE]; DBG(DBG_proc, "preview_restore_image_from_file\n"); @@ -2959,7 +2959,7 @@ static void preview_display_zoom(Preview *p, int x, int y, int zoom) static void preview_display_color_components(Preview *p, int x, int y) { - char buffer[256]; + char buffer[TEXTBUFSIZE]; int raw_red, raw_green, raw_blue, enh_red, enh_green, enh_blue; if (! preview_get_pixel_color(p, x, y, &raw_red, &raw_green, &raw_blue, &enh_red, &enh_green, &enh_blue)) @@ -4189,7 +4189,7 @@ Preview *preview_new(void) GtkWidget *pixmapwidget; Preview *p; int i; - char buf[256]; + char buf[TEXTBUFSIZE]; int ratio_nr = 0; DBG(DBG_proc, "preview_new\n"); @@ -5730,7 +5730,7 @@ static gint preview_preset_area_add_callback(GtkWidget *widget, GtkWidget *prese int selection, i, old_selection = 0; Preview *p; float coord[4]; - char suggested_name[256]; + char suggested_name[PATH_MAX]; char *newname; GtkWidget *old_preset_area_menu; @@ -5925,7 +5925,7 @@ static gint preview_preset_area_context_menu_callback(GtkWidget *widget, GdkEven GtkWidget *menu_item; GdkEventButton *event_button; int selection; - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_proc, "preview_preset_area_context_menu_callback\n"); diff --git a/src/xsane-save.c b/src/xsane-save.c index 9c3784b..a56e2ce 100644 --- a/src/xsane-save.c +++ b/src/xsane-save.c @@ -163,7 +163,7 @@ void xsane_convert_text_to_filename(char **text) if (text) { char *filename = *text; - char buf[256]; + char buf[TEXTBUFSIZE]; int buflen=0; int txtlen=0; @@ -418,7 +418,7 @@ void xsane_update_counter_in_filename(char **filename, int skip, int step, int m void xsane_read_pnm_header(FILE *file, Image_info *image_info) { int max_val, filetype_nr; - char buf[256]; + char buf[TEXTBUFSIZE]; fgets(buf, sizeof(buf)-1, file); DBG(DBG_info, "filetype header :%s", buf); @@ -703,7 +703,7 @@ int xsane_copy_file(FILE *outfile, FILE *infile, GtkProgressBar *progress_bar, i if (ferror(infile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_READ, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -714,7 +714,7 @@ int xsane_copy_file(FILE *outfile, FILE *infile, GtkProgressBar *progress_bar, i if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -756,7 +756,7 @@ int xsane_copy_file_by_name(char *output_filename, char *input_filename, GtkProg if (outfile == 0) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, output_filename, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -766,7 +766,7 @@ int xsane_copy_file_by_name(char *output_filename, char *input_filename, GtkProg infile = fopen(input_filename, "rb"); /* read binary (b for win32) */ if (infile == 0) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, input_filename, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -839,7 +839,7 @@ int xsane_save_grayscale_image_as_lineart(FILE *outfile, FILE *imagefile, Image_ if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -1042,7 +1042,7 @@ int xsane_save_scaled_image(FILE *outfile, FILE *imagefile, Image_info *image_in if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -1352,7 +1352,7 @@ int xsane_save_despeckle_image(FILE *outfile, FILE *imagefile, Image_info *image if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -1568,7 +1568,7 @@ int xsane_save_blur_image(FILE *outfile, FILE *imagefile, Image_info *image_info if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -1799,7 +1799,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -1858,7 +1858,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -1912,7 +1912,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -1971,7 +1971,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -2024,7 +2024,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -2083,7 +2083,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -2137,7 +2137,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -2196,7 +2196,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -2756,7 +2756,7 @@ static int xsane_save_ps_pdf_bw(FILE *outfile, FILE *imagefile, Image_info *imag if (line == NULL) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s malloc failed", ERR_DURING_SAVE); DBG(DBG_error, "%s\n", buf); @@ -2791,7 +2791,7 @@ static int xsane_save_ps_pdf_bw(FILE *outfile, FILE *imagefile, Image_info *imag if ((ret != 0) || (ferror(outfile))) { - char buf[255]; + char buf[TEXTBUFSIZE]; if (ret == 0) { @@ -2836,7 +2836,7 @@ static int xsane_save_ps_pdf_gray(FILE *outfile, FILE *imagefile, Image_info *im if (line == NULL) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s malloc failed", ERR_DURING_SAVE); DBG(DBG_error, "%s\n", buf); @@ -2878,7 +2878,7 @@ static int xsane_save_ps_pdf_gray(FILE *outfile, FILE *imagefile, Image_info *im if ((ret != 0) || (ferror(outfile))) { - char buf[255]; + char buf[TEXTBUFSIZE]; if (ret == 0) { @@ -2929,7 +2929,7 @@ static int xsane_save_ps_pdf_color(FILE *outfile, FILE *imagefile, Image_info *i if (line == NULL) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s malloc failed", ERR_DURING_SAVE); DBG(DBG_error, "%s\n", buf); @@ -2985,7 +2985,7 @@ static int xsane_save_ps_pdf_color(FILE *outfile, FILE *imagefile, Image_info *i if ((ret != 0) || (ferror(outfile))) { - char buf[255]; + char buf[TEXTBUFSIZE]; if (ret == 0) { @@ -3050,7 +3050,7 @@ int xsane_save_ps_page(FILE *outfile, int page, if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -3084,7 +3084,7 @@ int xsane_save_ps(FILE *outfile, FILE *imagefile, Image_info *image_info, float if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -3417,7 +3417,7 @@ int xsane_save_pdf_page(FILE *outfile, struct pdf_xref *xref, int page, if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -3453,7 +3453,7 @@ int xsane_save_pdf(FILE *outfile, FILE *imagefile, Image_info *image_info, float if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -3477,7 +3477,7 @@ typedef xsane_jpeg_error_mgr *xsane_jpeg_error_mgr_ptr; static void xsane_jpeg_error_exit(j_common_ptr cinfo) { - char buf[256]; + char buf[TEXTBUFSIZE]; /* cinfo->err points to a xsane_jpeg_error_mgr struct */ xsane_jpeg_error_mgr_ptr xsane_jpeg_error_mgr_data = (xsane_jpeg_error_mgr_ptr) cinfo->err; @@ -3497,7 +3497,7 @@ static void xsane_jpeg_error_exit(j_common_ptr cinfo) int xsane_save_jpeg(FILE *outfile, FILE *imagefile, Image_info *image_info, int quality, GtkProgressBar *progress_bar, int *cancel_save) { unsigned char *data; - char buf[256]; + char buf[TEXTBUFSIZE]; int components = 1; int x,y; int bytespp = 1; @@ -3634,7 +3634,7 @@ int xsane_save_tiff_page(TIFF *tiffile, int page, int pages, FILE *imagefile, Im GtkProgressBar *progress_bar, int *cancel_save) { char *data; - char buf[256]; + char buf[TEXTBUFSIZE]; int y, w; int components; int compression; @@ -3764,7 +3764,7 @@ int xsane_save_tiff_page(TIFF *tiffile, int page, int pages, FILE *imagefile, Im if (TIFFWriteScanline(tiffile, data, y, 0) != 1) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s", ERR_DURING_SAVE); DBG(DBG_error, "%s\n", buf); @@ -3800,7 +3800,7 @@ int xsane_save_png(FILE *outfile, FILE *imagefile, Image_info *image_info, int c png_bytep row_ptr; png_color_8 sig_bit; unsigned char *data; - char buf[256]; + char buf[TEXTBUFSIZE]; int colortype, components, byte_width; int y; @@ -3936,7 +3936,7 @@ int xsane_save_png_16(FILE *outfile, FILE *imagefile, Image_info *image_info, in png_bytep row_ptr; png_color_8 sig_bit; /* should be 16, but then I get a warning about wrong type */ unsigned char *data; - char buf[256]; + char buf[TEXTBUFSIZE]; int colortype, components; int x,y; guint16 val; @@ -4072,7 +4072,7 @@ static int xsane_save_pnm_16_ascii_gray(FILE *outfile, FILE *imagefile, Image_in if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -4132,7 +4132,7 @@ static int xsane_save_pnm_16_ascii_color(FILE *outfile, FILE *imagefile, Image_i if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -4186,7 +4186,7 @@ static int xsane_save_pnm_16_binary_gray(FILE *outfile, FILE *imagefile, Image_i if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -4244,7 +4244,7 @@ static int xsane_save_pnm_16_binary_color(FILE *outfile, FILE *imagefile, Image_ if (ferror(outfile)) { - char buf[255]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, strerror(errno)); DBG(DBG_error, "%s\n", buf); @@ -4306,7 +4306,7 @@ int xsane_save_image_as_lineart(char *output_filename, char *input_filename, Gtk { FILE *outfile; FILE *infile; - char buf[256]; + char buf[TEXTBUFSIZE]; Image_info image_info; *cancel_save = 0; @@ -4323,7 +4323,7 @@ int xsane_save_image_as_lineart(char *output_filename, char *input_filename, Gtk infile = fopen(input_filename, "rb"); /* read binary (b for win32) */ if (infile == 0) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, input_filename, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -4352,7 +4352,7 @@ int xsane_save_image_as_lineart(char *output_filename, char *input_filename, Gtk int xsane_save_image_as_text(char *output_filename, char *input_filename, GtkProgressBar *progress_bar, int *cancel_save) { char *arg[1000]; - char buf[256]; + char buf[TEXTBUFSIZE]; int argnr; pid_t pid; int i; @@ -4528,7 +4528,7 @@ int xsane_save_image_as(char *output_filename, char *input_filename, int output_ { FILE *outfile; FILE *infile; - char buf[256]; + char buf[TEXTBUFSIZE]; Image_info image_info; char lineart_filename[PATH_MAX]; int remove_input_file = FALSE; @@ -4540,7 +4540,7 @@ int xsane_save_image_as(char *output_filename, char *input_filename, int output_ infile = fopen(input_filename, "rb"); /* read binary (b for win32) */ if (infile == 0) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, input_filename, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -4573,7 +4573,7 @@ int xsane_save_image_as(char *output_filename, char *input_filename, int output_ infile = fopen(input_filename, "rb"); /* read binary (b for win32) */ if (infile == 0) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, input_filename, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -5122,7 +5122,7 @@ int xsane_transfer_to_gimp(char *input_filename, GtkProgressBar *progress_bar, i imagefile = fopen(input_filename, "rb"); /* read binary (b for win32) */ if (imagefile == 0) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, input_filename, strerror(errno)); xsane_back_gtk_error(buf, TRUE); diff --git a/src/xsane-scan.c b/src/xsane-scan.c index bf054dc..578cc57 100644 --- a/src/xsane-scan.c +++ b/src/xsane-scan.c @@ -140,7 +140,7 @@ static void xsane_read_image_data(gpointer data, gint source, GdkInputCondition SANE_Status status; SANE_Int len; int i, j; - char buf[255]; + char buf[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_read_image_data\n"); @@ -480,7 +480,7 @@ static void xsane_read_image_data(gpointer data, gint source, GdkInputCondition guint16 *buf16ptr; unsigned char *buf8 = (unsigned char *) buf16; unsigned char *buf8ptr; - char buf[255]; + char buf[TEXTBUFSIZE]; DBG(DBG_info, "depth = 16 bit\n"); @@ -963,7 +963,7 @@ static int xsane_reduce_to_lineart() /* no temporary file */ if (xsane_create_secure_file(xsane.dummy_filename)) /* remove possibly existing symbolic links for security */ { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s %s\n", ERR_DURING_SAVE, ERR_CREATE_SECURE_FILE, xsane.dummy_filename); xsane_back_gtk_error(buf, TRUE); @@ -1127,7 +1127,7 @@ void xsane_scan_done(SANE_Status status) /* no temporary file */ if (xsane_create_secure_file(xsane.dummy_filename)) /* remove possibly existing symbolic links for security */ { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s %s\n", ERR_DURING_SAVE, ERR_CREATE_SECURE_FILE, xsane.dummy_filename); xsane_back_gtk_error(buf, TRUE); @@ -1149,7 +1149,7 @@ void xsane_scan_done(SANE_Status status) } else { - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_info, "open of file `%s'failed : %s\n", xsane.dummy_filename, strerror(errno)); snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, xsane.dummy_filename, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -1167,7 +1167,7 @@ void xsane_scan_done(SANE_Status status) } else { - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_info, "open of file `%s'failed : %s\n", xsane.dummy_filename, strerror(errno)); snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, xsane.dummy_filename, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -1271,7 +1271,7 @@ void xsane_scan_done(SANE_Status status) { FILE *outfile; FILE *infile; - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_info, "XSANE_COPY\n"); @@ -1326,15 +1326,16 @@ void xsane_scan_done(SANE_Status status) xsane_read_pnm_header(infile, &image_info); - imagewidth = 72.0 * image_info.image_width/(float)printer_resolution; /* width in 1/72 inch */ - imageheight = 72.0 * image_info.image_height/(float)printer_resolution; /* height in 1/72 inch */ + imagewidth = 72.0 * image_info.image_width /image_info.resolution_x * xsane.zoom; /* desired width in 1/72 inch */ + imageheight = 72.0 * image_info.image_height/image_info.resolution_y * xsane.zoom; /* desired height in 1/72 inch */ memset (&act, 0, sizeof (act)); /* define broken pipe handler */ act.sa_handler = xsane_sigpipe_handler; sigaction (SIGPIPE, &act, 0); - DBG(DBG_info, "imagewidth = %f\n 1/72 inch", imagewidth); - DBG(DBG_info, "imageheight = %f\n 1/72 inch", imageheight); + DBG(DBG_info, "imagewidth = %f 1/72 inch\n", imagewidth); + DBG(DBG_info, "imageheight = %f 1/72 inch\n", imageheight); + DBG(DBG_info, "zoom = %f\n", xsane.zoom); xsane_save_ps(outfile, infile, &image_info, @@ -1350,7 +1351,7 @@ void xsane_scan_done(SANE_Status status) } else { - char buf[256]; + char buf[TEXTBUFSIZE]; if (!infile) { @@ -1616,7 +1617,7 @@ static void xsane_start_scan(void) SANE_Status status; SANE_Handle dev = xsane.dev; const char *frame_type = 0; - char buf[256]; + char buf[TEXTBUFSIZE]; int fd; Image_info image_info; @@ -1680,6 +1681,7 @@ static void xsane_start_scan(void) if ((xsane.param.depth == 1) && ((xsane.scan_rotation) || (xsane.xsane_mode == XSANE_VIEWER) || + (xsane.xsane_mode == XSANE_MULTIPAGE) || (xsane.xsane_mode == XSANE_FAX) || (xsane.xsane_mode == XSANE_EMAIL)) ) /* We want to do a transformation with a lineart scan */ @@ -1769,14 +1771,14 @@ static void xsane_start_scan(void) if (preferences.adf_pages_max > 1) { - char buf2[255]; + char buf2[TEXTBUFSIZE]; if (preferences.adf_pages_max > 1) { - snprintf(buf2, sizeof(buf), "%s (%d/%d)", PROGRESS_SCANNING, xsane.adf_page_counter+1, preferences.adf_pages_max); + snprintf(buf2, sizeof(buf2), "%s (%d/%d)", PROGRESS_SCANNING, xsane.adf_page_counter+1, preferences.adf_pages_max); } else { - snprintf(buf2, sizeof(buf), "%s (%d)", PROGRESS_SCANNING, xsane.adf_page_counter+1); + snprintf(buf2, sizeof(buf2), "%s (%d)", PROGRESS_SCANNING, xsane.adf_page_counter+1); } xsane_progress_new(buf, buf2, (GtkSignalFunc) xsane_cancel, NULL); } @@ -1814,7 +1816,7 @@ static void xsane_start_scan(void) /* and return value 0 is used to tell the timeout handler to stop timer */ gint xsane_scan_dialog(gpointer *data) { - char buf[256]; + char buf[TEXTBUFSIZE]; const SANE_Option_Descriptor *opt; DBG(DBG_proc, "xsane_scan_dialog\n"); @@ -1854,7 +1856,7 @@ gint xsane_scan_dialog(gpointer *data) testfile = fopen(xsane.output_filename, "rb"); /* read binary (b for win32) */ if (testfile) /* filename used: skip */ { - char buf[256]; + char buf[TEXTBUFSIZE]; fclose(testfile); diff --git a/src/xsane-setup.c b/src/xsane-setup.c index f97e7ef..c0c9000 100644 --- a/src/xsane-setup.c +++ b/src/xsane-setup.c @@ -242,7 +242,7 @@ static int xsane_update_double(GtkWidget *widget, double *val) static void xsane_setup_printer_update() { - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_setup_printer_update\n"); @@ -1327,8 +1327,8 @@ static void xsane_printer_notebook(GtkWidget *notebook) static void xsane_setup_browse_tmp_path_callback(GtkWidget *widget, gpointer data) { const gchar *old_tmp_path; - char tmp_path[256]; - char windowname[256]; + char tmp_path[PATH_MAX]; + char windowname[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_setup_browse_tmp_path_callback\n"); diff --git a/src/xsane-viewer.c b/src/xsane-viewer.c index 718ab6d..d1d8e5e 100644 --- a/src/xsane-viewer.c +++ b/src/xsane-viewer.c @@ -163,7 +163,7 @@ static gint xsane_viewer_close_callback(GtkWidget *widget, gpointer data) if (!v->image_saved) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), WARN_VIEWER_IMAGE_NOT_SAVED); xsane_viewer_set_sensitivity(v, FALSE); @@ -252,10 +252,10 @@ static void xsane_viewer_save_callback(GtkWidget *window, gpointer data) Viewer *v = (Viewer *) data; char outputfilename[1024]; char *inputfilename; - char windowname[256]; + char windowname[TEXTBUFSIZE]; int output_format; int abort = 0; - char buf[256]; + char buf[TEXTBUFSIZE]; if (v->block_actions) /* actions blocked: return */ { @@ -312,7 +312,7 @@ static void xsane_viewer_save_callback(GtkWidget *window, gpointer data) testfile = fopen(v->output_filename, "rb"); /* read binary (b for win32) */ if (testfile) /* filename used: skip */ { - char buf[256]; + char buf[TEXTBUFSIZE]; fclose(testfile); snprintf(buf, sizeof(buf), WARN_FILE_EXISTS, v->output_filename); @@ -333,7 +333,7 @@ static void xsane_viewer_save_callback(GtkWidget *window, gpointer data) { if (xsane_create_secure_file(v->output_filename)) /* remove possibly existing symbolic links for security */ { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s %s\n", ERR_DURING_SAVE, ERR_CREATE_SECURE_FILE, v->output_filename); xsane_back_gtk_error(buf, TRUE); @@ -385,7 +385,7 @@ static void xsane_viewer_ocr_callback(GtkWidget *window, gpointer data) Viewer *v = (Viewer *) data; char outputfilename[1024]; char *extensionptr; - char windowname[256]; + char windowname[TEXTBUFSIZE]; int abort = 0; if (v->block_actions) /* actions blocked: return */ @@ -435,7 +435,7 @@ static void xsane_viewer_ocr_callback(GtkWidget *window, gpointer data) static void xsane_viewer_clone_callback(GtkWidget *window, gpointer data) { Viewer *v = (Viewer *) data; - char outfilename[256]; + char outfilename[PATH_MAX]; if (v->block_actions) /* actions blocked: return */ { @@ -456,7 +456,7 @@ static void xsane_viewer_clone_callback(GtkWidget *window, gpointer data) if (v->last_saved_filename) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s%s", FILENAME_PREFIX_CLONE_OF, v->last_saved_filename); xsane_viewer_new(outfilename, v->selection_filetype, v->allow_reduction_to_lineart, buf, v->allow_modification, IMAGE_NOT_SAVED); } @@ -576,7 +576,7 @@ static void xsane_viewer_scale_callback(GtkWidget *window, gpointer data) GdkPixmap *pixmap; GdkBitmap *mask; GtkWidget *pixmapwidget; - char buf[256]; + char buf[TEXTBUFSIZE]; FILE *infile; Image_info image_info; @@ -831,7 +831,7 @@ static void xsane_viewer_despeckle_callback(GtkWidget *window, gpointer data) GtkWidget *hbox, *vbox; GtkWidget *label, *spinbutton, *button; GtkAdjustment *adjustment; - char buf[256]; + char buf[TEXTBUFSIZE]; if (v->block_actions) /* actions blocked: return */ { @@ -925,7 +925,7 @@ static void xsane_viewer_blur_callback(GtkWidget *window, gpointer data) GtkWidget *hbox, *vbox; GtkWidget *label, *spinbutton, *button; GtkAdjustment *adjustment; - char buf[256]; + char buf[TEXTBUFSIZE]; if (v->block_actions) /* actions blocked: return */ { @@ -1036,7 +1036,7 @@ static void xsane_viewer_undo_callback(GtkWidget *window, gpointer data) if (v->last_saved_filename) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s (%s) - %s", WINDOW_VIEWER, v->last_saved_filename, xsane.device_text); gtk_window_set_title(GTK_WINDOW(v->top), buf); } @@ -1051,7 +1051,7 @@ static void xsane_viewer_scale_image(GtkWidget *window, gpointer data) { FILE *outfile; FILE *infile; - char outfilename[256]; + char outfilename[PATH_MAX]; Viewer *v = (Viewer *) data; Image_info image_info; @@ -1119,7 +1119,7 @@ static void xsane_viewer_scale_image(GtkWidget *window, gpointer data) if (v->last_saved_filename) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s (%s) - %s", WINDOW_VIEWER, v->last_saved_filename, xsane.device_text); gtk_window_set_title(GTK_WINDOW(v->top), buf); } @@ -1133,7 +1133,7 @@ static void xsane_viewer_despeckle_image(GtkWidget *window, gpointer data) { FILE *outfile; FILE *infile; - char outfilename[256]; + char outfilename[PATH_MAX]; Viewer *v = (Viewer *) data; Image_info image_info; @@ -1196,7 +1196,7 @@ static void xsane_viewer_despeckle_image(GtkWidget *window, gpointer data) if (v->last_saved_filename) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s (%s) - %s", WINDOW_VIEWER, v->last_saved_filename, xsane.device_text); gtk_window_set_title(GTK_WINDOW(v->top), buf); } @@ -1210,7 +1210,7 @@ static void xsane_viewer_blur_image(GtkWidget *window, gpointer data) { FILE *outfile; FILE *infile; - char outfilename[256]; + char outfilename[PATH_MAX]; Viewer *v = (Viewer *) data; Image_info image_info; @@ -1273,7 +1273,7 @@ static void xsane_viewer_blur_image(GtkWidget *window, gpointer data) if (v->last_saved_filename) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s (%s) - %s", WINDOW_VIEWER, v->last_saved_filename, xsane.device_text); gtk_window_set_title(GTK_WINDOW(v->top), buf); } @@ -1287,7 +1287,7 @@ static void xsane_viewer_rotate(Viewer *v, int rotation) { FILE *outfile; FILE *infile; - char outfilename[256]; + char outfilename[PATH_MAX]; Image_info image_info; if (v->block_actions) /* actions blocked: return */ @@ -1363,7 +1363,7 @@ static void xsane_viewer_rotate(Viewer *v, int rotation) if (v->last_saved_filename) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s (%s) - %s", WINDOW_VIEWER, v->last_saved_filename, xsane.device_text); gtk_window_set_title(GTK_WINDOW(v->top), buf); } @@ -1663,7 +1663,7 @@ static int xsane_viewer_read_image(Viewer *v) int pos0; FILE *infile; Image_info image_info; - char buf[256]; + char buf[TEXTBUFSIZE]; float size; char *size_unit; int width, height; @@ -1804,7 +1804,7 @@ static int xsane_viewer_read_image(Viewer *v) size *= 2.0; } - if ((v->allow_reduction_to_lineart) && (image_info.reduce_to_lineart)) + if (image_info.reduce_to_lineart) { size /= 8.0; } @@ -1822,7 +1822,7 @@ static int xsane_viewer_read_image(Viewer *v) size_unit = "KB"; } - if ((v->allow_reduction_to_lineart) && (image_info.reduce_to_lineart)) + if (image_info.reduce_to_lineart) { snprintf(buf, sizeof(buf), TEXT_VIEWER_IMAGE_INFO, image_info.image_width, image_info.image_height, 1, image_info.colors, image_info.resolution_x, image_info.resolution_y, size, size_unit); @@ -1870,7 +1870,7 @@ static int xsane_viewer_read_image(Viewer *v) Viewer *xsane_viewer_new(char *filename, char *selection_filetype, int allow_reduction_to_lineart, char *output_filename, viewer_modification allow_modification, int image_saved) { - char buf[256]; + char buf[TEXTBUFSIZE]; Viewer *v; GtkWidget *vbox, *hbox; GtkWidget *menubar, *menubar_item; diff --git a/src/xsane.c b/src/xsane.c index 279df23..9254ea7 100644 --- a/src/xsane.c +++ b/src/xsane.c @@ -133,10 +133,6 @@ int xsane_scanmode_number[] = { XSANE_VIEWER, XSANE_SAVE, XSANE_COPY, XSANE_MULT #define XSANE_GTK_NAME_X_RESOLUTION "GtkMenuXResolution" #define XSANE_GTK_NAME_Y_RESOLUTION "GtkMenuYResolution" -#define XSANE_GTK_NAME_ZOOM "GtkMenuZoom" -#define XSANE_GTK_NAME_X_ZOOM "GtkMenuXZoom" -#define XSANE_GTK_NAME_Y_ZOOM "GtkMenuYZoom" - /* ---------------------------------------------------------------------------------------------------------------------- */ /* forward declarations: */ @@ -307,12 +303,10 @@ static void xsane_set_modus_defaults(void) break; } xsane.zoom = 1.0; - xsane.zoom_x = 1.0; - xsane.zoom_y = 1.0; - xsane.resolution = xsane.zoom * printer_resolution; - xsane.resolution_x = xsane.zoom_x * printer_resolution; - xsane.resolution_y = xsane.zoom_y * printer_resolution; + xsane.resolution = xsane.zoom * printer_resolution; + xsane.resolution_x = xsane.zoom * printer_resolution; + xsane.resolution_y = xsane.zoom * printer_resolution; xsane_set_all_resolutions(); xsane_define_maximum_output_size(); /* must come before select_full_preview_area */ @@ -623,9 +617,9 @@ static void xsane_printer_callback(GtkWidget *widget, gpointer data) break; } - xsane.resolution = xsane.zoom * printer_resolution; - xsane.resolution_x = xsane.zoom_x * printer_resolution; - xsane.resolution_y = xsane.zoom_y * printer_resolution; + xsane.resolution = xsane.zoom * printer_resolution; + xsane.resolution_x = xsane.zoom * printer_resolution; + xsane.resolution_y = xsane.zoom * printer_resolution; xsane_set_all_resolutions(); xsane_define_maximum_output_size(); @@ -654,8 +648,6 @@ static gint xsane_resolution_timer_callback(GtkAdjustment *adj) static void xsane_resolution_scale_update(GtkAdjustment *adj, double *val) { - int printer_resolution; - /* gtk does not make sure that the value is quantisized correct */ float diff, old, new, quant; @@ -687,34 +679,8 @@ static void xsane_resolution_scale_update(GtkAdjustment *adj, double *val) *val = adj->value; } - switch (xsane.param.format) - { - case SANE_FRAME_GRAY: - if (xsane.param.depth == 1) - { - printer_resolution = preferences.printer[preferences.printernr]->lineart_resolution; - } - else - { - printer_resolution = preferences.printer[preferences.printernr]->grayscale_resolution; - } - break; - - case SANE_FRAME_RGB: - case SANE_FRAME_RED: - case SANE_FRAME_GREEN: - case SANE_FRAME_BLUE: - default: - printer_resolution = preferences.printer[preferences.printernr]->color_resolution; - break; - } - xsane_set_all_resolutions(); - xsane_update_param(0); - xsane.zoom = xsane.resolution / printer_resolution; - xsane.zoom_x = xsane.resolution_x / printer_resolution; - xsane.zoom_y = xsane.resolution_y / printer_resolution; } /* ---------------------------------------------------------------------------------------------------------------------- */ @@ -763,8 +729,6 @@ static void xsane_resolution_list_callback(GtkWidget *widget, gpointer data) xsane_set_resolution(xsane.well_known.dpi_y, xsane.resolution_y); xsane.zoom = xsane.resolution / printer_resolution; - xsane.zoom_x = xsane.resolution_x / printer_resolution; - xsane.zoom_y = xsane.resolution_y / printer_resolution; } else if (!strcmp(name, XSANE_GTK_NAME_X_RESOLUTION)) { @@ -1018,9 +982,9 @@ static void xsane_zoom_update(GtkAdjustment *adj, double *val) } /* update all resolutions */ - xsane.resolution = xsane.zoom * printer_resolution; - xsane.resolution_x = xsane.zoom_x * printer_resolution; - xsane.resolution_y = xsane.zoom_y * printer_resolution; + xsane.resolution = xsane.zoom * printer_resolution; + xsane.resolution_x = xsane.zoom * printer_resolution; + xsane.resolution_y = xsane.zoom * printer_resolution; xsane_set_all_resolutions(); @@ -1031,11 +995,42 @@ static void xsane_zoom_update(GtkAdjustment *adj, double *val) /* ---------------------------------------------------------------------------------------------------------------------- */ -static int xsane_zoom_widget_new(GtkWidget *parent, int well_known_option, double *zoom, double resolution, - const char *image_xpm[], const gchar *desc) +static int xsane_get_zoom_range(int printer_resolution, int well_known_option, double *min, double *max) +{ + const SANE_Option_Descriptor *opt; + + DBG(DBG_proc, "xsane_get_zoom_range\n"); + + opt = xsane_get_option_descriptor(xsane.dev, well_known_option); + if (!opt) + { + return -1; /* option not available */ + } + else + { + if (SANE_OPTION_IS_ACTIVE(opt->cap)) + { + xsane_get_bounds(opt, min, max); + *min = *min / printer_resolution; + *max = *max / printer_resolution; + + return 0; /* everything is ok */ + } + return 1; /* option not active */ + } +} + +/* ---------------------------------------------------------------------------------------------------------------------- */ + +static int xsane_zoom_widget_new(GtkWidget *parent) { const SANE_Option_Descriptor *opt; int printer_resolution; + double min = 0.0; + double max = 0.0; + double min2 = 0.0; + double max2 = 0.0; + int well_known_option = 0; DBG(DBG_proc, "xsane_zoom_widget_new\n"); @@ -1061,68 +1056,53 @@ static int xsane_zoom_widget_new(GtkWidget *parent, int well_known_option, doubl break; } - opt = xsane_get_option_descriptor(xsane.dev, well_known_option); - if (!opt) + if (!xsane_get_zoom_range(printer_resolution, xsane.well_known.dpi, &min, &max)) /* we have well_known.dpi: */ { - return -1; /* option not available */ + well_known_option = xsane.well_known.dpi; } else { - if (SANE_OPTION_IS_ACTIVE(opt->cap)) + if (!xsane_get_zoom_range(printer_resolution, xsane.well_known.dpi_x, &min, &max)) /* we have well.known.dpi_x */ { - double min = 0.0; - double max = 0.0; - SANE_Word val = 0.0; - - xsane_control_option(xsane.dev, well_known_option, SANE_ACTION_GET_VALUE, &val, 0); - - switch (opt->constraint_type) + well_known_option = xsane.well_known.dpi_x; + if (!xsane_get_zoom_range(printer_resolution, xsane.well_known.dpi_y, &min2, &max2)) /* we have well.known.dpi_y */ { - case SANE_CONSTRAINT_RANGE: - switch (opt->type) - { - case SANE_TYPE_INT: - min = ((double) opt->constraint.range->min) / printer_resolution; - max = ((double) opt->constraint.range->max) / printer_resolution; - break; - - case SANE_TYPE_FIXED: - min = SANE_UNFIX(opt->constraint.range->min) / printer_resolution; - max = SANE_UNFIX(opt->constraint.range->max) / printer_resolution; - val = SANE_UNFIX(val); - break; - - default: - DBG(DBG_error, "zoom_scale_update: %s %d\n", ERR_UNKNOWN_TYPE, opt->type); - } - break; - - case SANE_CONSTRAINT_WORD_LIST: - xsane_get_bounds(opt, &min, &max); - min = min / printer_resolution; - max = max / printer_resolution; - break; + if (min < min2) + { + min = min2; + } - default: - DBG(DBG_error, "zoom_scale_update: %s %d\n", ERR_UNKNOWN_CONSTRAINT_TYPE, opt->constraint_type); + if (max > max2) + { + max = max2; + } } + } + else + { + return -1; /* no zoom widget created */ + } + } - if (resolution == 0) /* no prefered value */ - { - resolution = val; /* set backend predefined value */ - } + if (min < 0.01) + { + min = 0.01; + } - *zoom = resolution / printer_resolution; + opt = xsane_get_option_descriptor(xsane.dev, well_known_option); + xsane_range_new_with_pixmap(xsane.xsane_window->window, GTK_BOX(parent), zoom_xpm, DESC_ZOOM, min, max, 0.01, 0.1, 2, + &xsane.zoom, &xsane.zoom_widget, well_known_option, xsane_zoom_update, + SANE_OPTION_IS_SETTABLE(opt->cap)); - xsane_range_new_with_pixmap(xsane.xsane_window->window, GTK_BOX(parent), image_xpm, desc, min, max, 0.01, 0.1, 2, - zoom, &xsane.zoom_widget, well_known_option, xsane_zoom_update, - SANE_OPTION_IS_SETTABLE(opt->cap)); + xsane.resolution = xsane.zoom * printer_resolution; + xsane.resolution_x = xsane.zoom * printer_resolution; + xsane.resolution_y = xsane.zoom * printer_resolution; - return 0; /* everything is ok */ - } - return 1; /* option not active */ - } + xsane_set_all_resolutions(); + + return 0; /* everything ok */ } + /* ---------------------------------------------------------------------------------------------------------------------- */ static void xsane_scanmode_menu_callback(GtkWidget *widget, gpointer data) @@ -1132,14 +1112,9 @@ static void xsane_scanmode_menu_callback(GtkWidget *widget, gpointer data) const SANE_Option_Descriptor *opt; int opt_num; int printer_resolution; - double zoom, zoom_x, zoom_y; DBG(DBG_proc, "xsane_scanmode_menu_callback\n"); - zoom = xsane.zoom; - zoom_x = xsane.zoom_x; - zoom_y = xsane.zoom_y; - opt_num = elem - xsane.element; opt = xsane_get_option_descriptor(xsane.dev, opt_num); xsane_back_gtk_set_option(opt_num, menu_item->label, SANE_ACTION_SET_VALUE); @@ -1168,9 +1143,9 @@ static void xsane_scanmode_menu_callback(GtkWidget *widget, gpointer data) break; } - xsane.resolution = xsane_find_best_resolution(xsane.well_known.dpi, zoom * printer_resolution); - xsane.resolution_x = xsane_find_best_resolution(xsane.well_known.dpi_x, zoom_x * printer_resolution); - xsane.resolution_y = xsane_find_best_resolution(xsane.well_known.dpi_y, zoom_y * printer_resolution); + xsane.resolution = xsane_find_best_resolution(xsane.well_known.dpi, xsane.zoom * printer_resolution); + xsane.resolution_x = xsane_find_best_resolution(xsane.well_known.dpi_x, xsane.zoom * printer_resolution); + xsane.resolution_y = xsane_find_best_resolution(xsane.well_known.dpi_y, xsane.zoom * printer_resolution); xsane_set_all_resolutions(); /* make sure resolution, resolution_x and resolution_y are up to date */ xsane_back_gtk_refresh_dialog(); /* update resolution - a bit overkill, any better idea? */ @@ -1319,11 +1294,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ } -#if 0 - if (xsane.xsane_mode == XSANE_SAVE) -#else if ( (xsane.xsane_mode == XSANE_SAVE) || (xsane.xsane_mode == XSANE_VIEWER) ) -#endif { xsane.copy_number_entry = NULL; @@ -1633,18 +1604,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ } else if (xsane.xsane_mode == XSANE_COPY) { - /* zoom selection */ - if (!xsane_zoom_widget_new(xsane_vbox_xsane_modus, xsane.well_known.dpi_x, &xsane.zoom_x, - xsane.resolution_x, zoom_x_xpm, DESC_ZOOM_X)) - { - xsane_zoom_widget_new(xsane_vbox_xsane_modus, xsane.well_known.dpi_y, &xsane.zoom_y, - xsane.resolution_y, zoom_y_xpm, DESC_ZOOM_Y); - } - else - { - xsane_zoom_widget_new(xsane_vbox_xsane_modus, xsane.well_known.dpi, &xsane.zoom, - xsane.resolution, zoom_xpm, DESC_ZOOM); - } + xsane_zoom_widget_new(xsane_vbox_xsane_modus); } else if (xsane.xsane_mode == XSANE_MULTIPAGE) { @@ -1880,7 +1840,7 @@ void xsane_pref_save(void) if (fd < 0) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s.", ERR_FAILED_CREATE_FILE, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -2082,6 +2042,11 @@ static int xsane_pref_restore(void) preferences.multipage_project = strdup(MULTIPAGEPROJECT); } + if (!preferences.multipage_filetype) + { + preferences.multipage_filetype = strdup(MULTIPAGEFILETYPE); + } + if (!preferences.ocr_command) { preferences.ocr_command = strdup(OCRCOMMAND); @@ -2148,7 +2113,7 @@ void xsane_pref_save_media(void) if (fd < 0) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s %s.", ERR_FAILED_CREATE_FILE, strerror(errno)); xsane_back_gtk_error(buf, TRUE); @@ -2411,7 +2376,7 @@ static gint xsane_scan_win_delete(GtkWidget *w, gpointer data) if (unsaved_images) { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), WARN_UNSAVED_IMAGES, unsaved_images); if (!xsane_back_gtk_decision(ERR_HEADER_WARNING, (gchar **) warning_xpm, buf, BUTTON_DO_NOT_CLOSE, BUTTON_DISCARD_ALL_IMAGES, TRUE /* wait */) == FALSE) @@ -2762,7 +2727,7 @@ static gint xsane_medium_context_menu_callback(GtkWidget *widget, GdkEvent *even if (event_button->button == 3) { - char buf[256]; + char buf[TEXTBUFSIZE]; menu = gtk_menu_new(); @@ -3017,7 +2982,7 @@ static gint xsane_close_info_callback(GtkWidget *widget, gpointer data) static void xsane_info_dialog(GtkWidget *widget, gpointer data) { GtkWidget *info_dialog, *vbox, *button, *label, *frame, *framebox, *hbox, *table; - char buf[256]; + char buf[TEXTBUFSIZE]; char *bufptr; GtkAccelGroup *accelerator_group; @@ -3549,7 +3514,7 @@ static void xsane_show_gpl(GtkWidget *widget, gpointer data) static void xsane_show_doc_via_nsr(GtkWidget *widget, gpointer data) /* show via netscape remote */ { char *name = (char *) data; - char buf[256]; + char buf[TEXTBUFSIZE]; pid_t pid; char *arg[5]; struct stat st; @@ -3722,7 +3687,7 @@ static char **xsane_parse_command(char *command_line, char *url) static void xsane_show_doc(GtkWidget *widget, gpointer data) { char *name = (char *) data; - char path[256]; + char path[PATH_MAX]; pid_t pid; char *arg[3]; struct stat st; @@ -4213,7 +4178,7 @@ void xsane_panel_build() const SANE_Option_Descriptor *opt; SANE_Handle dev = xsane.dev; double dval, dmin, dmax, dquant; - char *buf, str[16], title[256]; + char *buf, str[16], title[TEXTBUFSIZE]; DialogElement *elem; SANE_Word quant, val; SANE_Status status; @@ -4682,7 +4647,7 @@ void xsane_panel_build() get_value_failed: { - char msg[256]; + char msg[TEXTBUFSIZE]; sprintf(msg, "%s %s: %s.", ERR_GET_OPTION, opt->name, XSANE_STRSTATUS(status)); xsane_back_gtk_error(msg, TRUE); @@ -4730,9 +4695,9 @@ static void xsane_device_dialog(void) GtkWidget *menubar, *menubar_item; GtkStyle *current_style; const gchar *devname; - char buf[256]; - char windowname[255]; - char devicetext[255]; + char buf[TEXTBUFSIZE]; + char windowname[TEXTBUFSIZE]; + char devicetext[TEXTBUFSIZE]; char *textptr; GtkWidget *xsane_window; GtkWidget *xsane_vbox_main; @@ -5261,7 +5226,7 @@ static void xsane_choose_device(void) GtkAccelGroup *device_selection_accelerator_group; gint i; const SANE_Device *adev; - char buf[256]; + char buf[TEXTBUFSIZE]; char vendor[12]; char model[17]; char type[20]; @@ -5471,7 +5436,7 @@ static int xsane_init(int argc, char **argv) GtkWidget *frame; struct stat st; char filename[PATH_MAX]; - char buf[256]; + char buf[TEXTBUFSIZE]; DBG(DBG_proc, "xsane_init\n"); @@ -5828,7 +5793,7 @@ void xsane_interface(int argc, char **argv) } else /* xsane.num_of_devs == 0, no devices available */ { - char buf[256]; + char buf[TEXTBUFSIZE]; snprintf(buf, sizeof(buf), "%s\n", ERR_NO_DEVICES); @@ -5886,8 +5851,6 @@ int main(int argc, char **argv) xsane.histogram_lines = 1; xsane.zoom = 1.0; - xsane.zoom_x = 1.0; - xsane.zoom_y = 1.0; xsane.resolution = 72.0; xsane.resolution_x = 72.0; xsane.resolution_y = 72.0; diff --git a/src/xsane.h b/src/xsane.h index abf8447..154bb52 100644 --- a/src/xsane.h +++ b/src/xsane.h @@ -85,10 +85,10 @@ /* ---------------------------------------------------------------------------------------------------------------------- */ -#define XSANE_VERSION "0.99" +#define XSANE_VERSION "0.991" #define XSANE_AUTHOR "Oliver Rauch" #define XSANE_COPYRIGHT "Oliver Rauch" -#define XSANE_DATE "1998-2005" +#define XSANE_DATE "1998-2006" #define XSANE_EMAIL_ADR "Oliver.Rauch@xsane.org" #define XSANE_HOMEPAGE "http://www.xsane.org" #define XSANE_COPYRIGHT_TXT XSANE_DATE " " XSANE_COPYRIGHT @@ -102,9 +102,10 @@ #define XSANE_CONTINUOUS_HOLD_TIME 10 #define XSANE_DEFAULT_DEVICE "SANE_DEFAULT_DEVICE" #define XSANE_3PASS_BUFFER_RGB_SIZE 1024 +#define TEXTBUFSIZE 255 #ifndef M_PI_2 -# define M_PI_2 1.57079632679489661923 /* pi/2 */ +# define M_PI_2 1.57079632679489661923 /* pi/2 */ #endif #ifdef HAVE_WINDOWS_H @@ -501,6 +502,7 @@ extern void xsane_batch_scan_add(void); #define EMAILPROJECT "emailproject" #define EMAILCOMMAND "sendmail" #define MULTIPAGEPROJECT "multipageproject" +#define MULTIPAGEFILETYPE XSANE_FILETYPE_PDF #define OCRCOMMAND "gocr" #define OCRINPUTFILEOPT "-i" #define OCROUTPUTFILEOPT "-o" @@ -796,8 +798,6 @@ typedef struct Xsane int copy_number; double zoom; - double zoom_x; - double zoom_y; double resolution; double resolution_x; double resolution_y; diff --git a/xsane.CHANGES b/xsane.CHANGES index 9c0bb17..e93c4ec 100644 --- a/xsane.CHANGES +++ b/xsane.CHANGES @@ -2702,7 +2702,7 @@ xsane-0.97 -> 0.98: - selected medium definition is stored in preferences now - BUGFIX for scanners that do not allow to set all resolutions. - In fax mode an possibly also in copy mode the created pages + In fax mode and possibly also in copy mode the created pages had a wrong scaling when the scanner did not support the desired resolution: - xsane_set_resolution returns bestdpi = selected resolution @@ -2833,3 +2833,39 @@ xsane-0.98b -> 0.99: 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 N N U* U* N N N U N U N N U* N N last upd 96 95 96 95 96 96 96 98 76 92 96 96 + + +xsane-0.99 -> 0.991: +-------------------- + - replaced all char buf[255], char buf[256] etc by char buf[TEXTBUFSIZE] + with #define TEXTBUFSIZE 255 + + - replaced all char filename[255] etc by char filename[PATH_MAX] + + - translations: U=updated (* for 0.99-pre1), 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 + N N N N N N U N N N N N N N N N N N N N N + 99 99 99 96 95 99 95 99 99 96 96 96 99 98 99 76 92 99 96 96 + + - added default multipage_filetype (PDF). + No default multipage_filetype produced the following problem: + - error message when creating multipage file: could not create secure file + + - lineart images are expanded to grayscale in multipage mode. + solves segmentation fault when "show page" in multipage project was selected + + - corrected calculation of width and height in copy mode for backends + that do not support arbitary resolutions + + - multipage mode: lineart images (that are stored as grayscale images) + are reduced to lineart before the page is put into the multipage file + + - viewer shows image info with bit depth = 1 when reduce_to_lineart is set + + - change handling of zoom (photocopy mode): + - now there is only one zoom value even if there is a resolution_x and + a resolution_y option, zoom_x and zoom_y are removed + - the zoom factor is directly used to define the image output size + (before the scanresolution was used to define the image output size) + - the resolution is not changed any more when an other printer with a + different printer resolution is selected @@ -6,10 +6,16 @@ Sign explaination: + planned to do this soon/higher priority (but not promised for XSane-1.0) - comes later/lower priority + device-selection: + - preselect last used device + save-function: - list of last used filenames - enable filters in save mode? + multipage-project: + - reduce to lineart + projects: # add selection for project directory to setup # store mail, fax and multipage projects in project directory @@ -1,5 +1,5 @@ %define name xsane -%define version 0.99 +%define version 0.991 %define release 1 %define prefix /usr |