1.0.28
This commit is contained in:
parent
64376b6c28
commit
fdc65ac75a
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@ sane-backends-1.0.21.tar.gz
|
||||
/sane-backends-1.0.24.tar.gz
|
||||
/sane-backends-1.0.25.tar.gz
|
||||
/sane-backends-1.0.27.tar.gz
|
||||
/sane-backends-1.0.28.tar.gz
|
||||
|
@ -1,88 +0,0 @@
|
||||
From 93340afddfbc4085a5297fe635b65dd7f7f3ef05 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= <bernhardu@mailbox.org>
|
||||
Date: Mon, 17 Dec 2018 00:05:43 +0100
|
||||
Subject: [PATCH] mustek_usb2: Avoid stack smashing. Fixes #35
|
||||
|
||||
Use a properly sized variable in call to sanei_usb_{read,write}_bulk.
|
||||
|
||||
Debian-Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886777
|
||||
Debian-Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=907972
|
||||
---
|
||||
backend/mustek_usb2_asic.c | 18 ++++++++++++++----
|
||||
1 file changed, 14 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/backend/mustek_usb2_asic.c b/backend/mustek_usb2_asic.c
|
||||
index b5f3b0a4..b31c7494 100644
|
||||
--- a/backend/mustek_usb2_asic.c
|
||||
+++ b/backend/mustek_usb2_asic.c
|
||||
@@ -255,6 +255,7 @@ Mustek_DMARead (PAsic chip, unsigned int size, SANE_Byte * lpdata)
|
||||
STATUS status = STATUS_GOOD;
|
||||
unsigned int i, buf[1];
|
||||
unsigned int read_size;
|
||||
+ size_t read_size_usb;
|
||||
|
||||
DBG (DBG_ASIC, "Mustek_DMARead: Enter\n");
|
||||
|
||||
@@ -268,9 +269,11 @@ Mustek_DMARead (PAsic chip, unsigned int size, SANE_Byte * lpdata)
|
||||
SetRWSize (chip, 1, buf[0]);
|
||||
status = WriteIOControl (chip, 0x03, 0, 4, (SANE_Byte *) (buf));
|
||||
|
||||
+ read_size_usb = buf[0];
|
||||
status =
|
||||
sanei_usb_read_bulk (chip->fd, lpdata + i * read_size,
|
||||
- (size_t *) buf);
|
||||
+ &read_size_usb);
|
||||
+ buf[0] = read_size_usb;
|
||||
if (status != STATUS_GOOD)
|
||||
{
|
||||
DBG (DBG_ERR, "Mustek_DMARead: read error\n");
|
||||
@@ -284,9 +287,11 @@ Mustek_DMARead (PAsic chip, unsigned int size, SANE_Byte * lpdata)
|
||||
SetRWSize (chip, 1, buf[0]);
|
||||
status = WriteIOControl (chip, 0x03, 0, 4, (SANE_Byte *) (buf));
|
||||
|
||||
+ read_size_usb = buf[0];
|
||||
status =
|
||||
sanei_usb_read_bulk (chip->fd, lpdata + i * read_size,
|
||||
- (size_t *) buf);
|
||||
+ &read_size_usb);
|
||||
+ buf[0] = read_size_usb;
|
||||
if (status != STATUS_GOOD)
|
||||
{
|
||||
DBG (DBG_ERR, "Mustek_DMARead: read error\n");
|
||||
@@ -307,6 +312,7 @@ Mustek_DMAWrite (PAsic chip, unsigned int size, SANE_Byte * lpdata)
|
||||
unsigned int buf[1];
|
||||
unsigned int i;
|
||||
unsigned int write_size;
|
||||
+ size_t write_size_usb;
|
||||
|
||||
DBG (DBG_ASIC, "Mustek_DMAWrite: Enter:size=%d\n", size);
|
||||
|
||||
@@ -320,9 +326,11 @@ Mustek_DMAWrite (PAsic chip, unsigned int size, SANE_Byte * lpdata)
|
||||
SetRWSize (chip, 0, buf[0]);
|
||||
WriteIOControl (chip, 0x02, 0, 4, (SANE_Byte *) buf);
|
||||
|
||||
+ write_size_usb = buf[0];
|
||||
status =
|
||||
sanei_usb_write_bulk (chip->fd, lpdata + i * write_size,
|
||||
- (size_t *) buf);
|
||||
+ &write_size_usb);
|
||||
+ buf[0] = write_size_usb;
|
||||
if (status != STATUS_GOOD)
|
||||
{
|
||||
DBG (DBG_ERR, "Mustek_DMAWrite: write error\n");
|
||||
@@ -337,9 +345,11 @@ Mustek_DMAWrite (PAsic chip, unsigned int size, SANE_Byte * lpdata)
|
||||
SetRWSize (chip, 0, buf[0]);
|
||||
WriteIOControl (chip, 0x02, 0, 4, (SANE_Byte *) buf);
|
||||
|
||||
+ write_size_usb = buf[0];
|
||||
status =
|
||||
sanei_usb_write_bulk (chip->fd, lpdata + i * write_size,
|
||||
- (size_t *) buf);
|
||||
+ &write_size_usb);
|
||||
+ buf[0] = write_size_usb;
|
||||
if (status != STATUS_GOOD)
|
||||
{
|
||||
DBG (DBG_ERR, "Mustek_DMAWrite: write error\n");
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,72 +0,0 @@
|
||||
diff --git a/backend/pixma_mp150.c b/backend/pixma_mp150.c
|
||||
index dca0965..4eaea9c 100644
|
||||
--- a/backend/pixma_mp150.c
|
||||
+++ b/backend/pixma_mp150.c
|
||||
@@ -241,6 +241,7 @@
|
||||
#define MG3000_PID 0x180b
|
||||
#define E470_PID 0x180c
|
||||
#define G3000_PID 0x181d
|
||||
+#define LIDE300_PID 0x1913 /* tested */
|
||||
|
||||
/* Generation 4 XML messages that encapsulates the Pixma protocol messages */
|
||||
#define XML_START_1 \
|
||||
@@ -977,6 +978,14 @@ handle_interrupt (pixma_t * s, int timeout)
|
||||
if (buf[7] & 2)
|
||||
s->events = PIXMA_EV_BUTTON2 | buf[11] | buf[10]<<8 | buf[12]<<16; /* b/w scan */
|
||||
}
|
||||
+ else if (s->cfg->pid == LIDE300_PID)
|
||||
+ /* unknown value in buf[4]
|
||||
+ * target in buf[0x13]
|
||||
+ * always set button-1 */
|
||||
+ {
|
||||
+ if (buf[0x13])
|
||||
+ s->events = PIXMA_EV_BUTTON1 | buf[0x13];
|
||||
+ }
|
||||
else
|
||||
/* button no. in buf[0]
|
||||
* original in buf[0]
|
||||
@@ -1331,7 +1340,8 @@ mp150_check_param (pixma_t * s, pixma_scan_param_t * sp)
|
||||
if ((s->cfg->cap & PIXMA_CAP_ADF) && sp->source == PIXMA_SOURCE_FLATBED)
|
||||
sp->h = MIN (sp->h, 877 * sp->xdpi / 75);
|
||||
|
||||
- if (sp->source == PIXMA_SOURCE_TPU)
|
||||
+ if (sp->source == PIXMA_SOURCE_TPU
|
||||
+ || s->cfg->pid == LIDE300_PID)
|
||||
{
|
||||
uint8_t k;
|
||||
|
||||
@@ -1864,6 +1874,7 @@ const pixma_config_t pixma_mp150_devices[] = {
|
||||
DEVICE ("Canon PIXMA MG3000 Series", "MG3000", MG3000_PID, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
|
||||
DEVICE ("Canon PIXMA E470 Series", "E470", E470_PID, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
|
||||
DEVICE ("Canon PIXMA G4000 Series", "G3000", G3000_PID, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
|
||||
+ DEVICE ("CanoScan LiDE 300", "LIDE300", LIDE300_PID, 4800, 0, 0, 638, 877, PIXMA_CAP_CIS),
|
||||
|
||||
END_OF_DEVICE_LIST
|
||||
};
|
||||
diff --git a/doc/descriptions/pixma.desc b/doc/descriptions/pixma.desc
|
||||
index ad33faa..b610a71 100644
|
||||
--- a/doc/descriptions/pixma.desc
|
||||
+++ b/doc/descriptions/pixma.desc
|
||||
@@ -1162,3 +1162,9 @@
|
||||
:usbid "0x04a9" "0x190d"
|
||||
:status :complete
|
||||
:comment "Full flatbed support up to 4800DPI (Note: flatbed does not have 9600DPI capability). Full TPU support (negatives, slides and infrared) up to 9600DPI."
|
||||
+
|
||||
+:model "CanoScan LiDE 300"
|
||||
+:interface "USB"
|
||||
+:usbid "0x04a9" "0x1913"
|
||||
+:status :complete
|
||||
+:comment "Support up to 4800DPI (Note: does not have less than 300DPI support)"
|
||||
diff --git a/doc/sane-pixma.man b/doc/sane-pixma.man
|
||||
index 1058e92..9c23b9d 100644
|
||||
--- a/doc/sane-pixma.man
|
||||
+++ b/doc/sane-pixma.man
|
||||
@@ -67,6 +67,8 @@ imageRUNNER 1020/1024/1025
|
||||
.br
|
||||
CanoScan 8800F, 9000F, 9000F Mark II
|
||||
.br
|
||||
+CanoScan LiDE 300
|
||||
+.br
|
||||
MAXIFY MB5000 (ADF is not working)
|
||||
.RE
|
||||
.PP
|
@ -1,36 +1,18 @@
|
||||
From 031cd8dd376ed6537afd06ca5aec5e67f5da0489 Mon Sep 17 00:00:00 2001
|
||||
From: Nils Philippsen <nils@redhat.com>
|
||||
Date: Fri, 31 Aug 2012 16:14:49 +0200
|
||||
Subject: [PATCH] patch: soname
|
||||
|
||||
Squashed commit of the following:
|
||||
|
||||
commit 2035ced803168210a70c4946814440764e5d0186
|
||||
Author: Nils Philippsen <nils@redhat.com>
|
||||
Date: Fri Aug 31 16:13:51 2012 +0200
|
||||
|
||||
don't use the same SONAME for backend libs and main lib
|
||||
---
|
||||
ltmain.sh | 19 -------------------
|
||||
1 file changed, 19 deletions(-)
|
||||
|
||||
diff --git a/ltmain.sh b/ltmain.sh
|
||||
index f3eb4c8..17d1508 100755
|
||||
--- a/ltmain.sh
|
||||
+++ b/ltmain.sh
|
||||
@@ -8101,25 +8101,6 @@ EOF
|
||||
diff -up sane-backends-1.0.28/ltmain.sh.soname sane-backends-1.0.28/ltmain.sh
|
||||
--- sane-backends-1.0.28/ltmain.sh.soname 2019-09-12 09:57:10.979802716 +0200
|
||||
+++ sane-backends-1.0.28/ltmain.sh 2019-09-12 10:27:21.719895206 +0200
|
||||
@@ -9615,23 +9615,6 @@ EOF
|
||||
dlname=$soname
|
||||
fi
|
||||
|
||||
- # Local change for sane-backends: internal name for every lib
|
||||
- # is "libsane" not "libsane-backendname". So linking to each
|
||||
- # backend is possible. Also the following test was moved to this
|
||||
- # location.
|
||||
- # If -module or -export-dynamic was specified, set the dlname
|
||||
- if test "$module" = yes || test "$export_dynamic" = yes; then
|
||||
- # On all known operating systems, these are identical.
|
||||
- dlname="$soname"
|
||||
- fi
|
||||
-
|
||||
- # On sane-backends the internal name for every lib is "libsane"
|
||||
- # not "libsane-backendname" so that linking to each backend is possible.
|
||||
- case $host in
|
||||
- *mingw*)
|
||||
- ;;
|
||||
@ -39,11 +21,7 @@ index f3eb4c8..17d1508 100755
|
||||
- *)
|
||||
- soname=`echo $soname | sed -e "s/libsane-[A-Za-z_0-9]*/libsane/g"`
|
||||
- esac
|
||||
- # End of local change
|
||||
-
|
||||
lib="$output_objdir/$realname"
|
||||
lib=$output_objdir/$realname
|
||||
linknames=
|
||||
for link
|
||||
--
|
||||
1.7.11.4
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
diff -up sane-backends-1.0.27/backend/genesys.c.canon-lide-100 sane-backends-1.0.27/backend/genesys.c
|
||||
--- sane-backends-1.0.27/backend/genesys.c.canon-lide-100 2018-02-01 10:37:26.160044539 +0100
|
||||
+++ sane-backends-1.0.27/backend/genesys.c 2018-02-01 10:45:44.616653277 +0100
|
||||
@@ -2070,11 +2070,9 @@ genesys_white_shading_calibration (Genes
|
||||
dev->model->cmd_set->set_lamp_power (dev, dev->calib_reg, SANE_TRUE);
|
||||
dev->model->cmd_set->set_motor_power (dev->calib_reg, motor);
|
||||
|
||||
- /* if needed, go back before doin next scan, by using rewind, registers and
|
||||
- * slopes table are kept intact from previous scan */
|
||||
- if (dev->model->flags & GENESYS_FLAG_SHADING_REPARK && dev->model->cmd_set->rewind)
|
||||
+ if (dev->model->flags & GENESYS_FLAG_SHADING_REPARK)
|
||||
{
|
||||
- status = dev->model->cmd_set->rewind (dev);
|
||||
+ status = dev->model->cmd_set->slow_back_home (dev, SANE_TRUE);
|
||||
}
|
||||
|
||||
status =
|
@ -1,406 +0,0 @@
|
||||
From 9b13d4c18b2424eaed02b72a928e9607921ec265 Mon Sep 17 00:00:00 2001
|
||||
From: Bernard Cafarelli <bernard.cafarelli@gmail.com>
|
||||
Date: Tue, 17 Apr 2018 22:43:15 +0200
|
||||
Subject: [PATCH] Revert "Color scanning for Samsung models, which support JPEG
|
||||
Lossy compression."
|
||||
|
||||
This reverts commit 926bfade544de4a4fd5f1a8082b85a97e2443770, leaving
|
||||
the new IDs in.
|
||||
As tracked in #315876, this breaks scanning with multiple Samsung scanners
|
||||
|
||||
Conflicts:
|
||||
backend/xerox_mfp.c
|
||||
backend/xerox_mfp.h
|
||||
doc/descriptions/xerox_mfp.desc
|
||||
---
|
||||
backend/Makefile.am | 2 +-
|
||||
backend/Makefile.in | 7 +-
|
||||
backend/xerox_mfp.c | 193 +-------------------------------
|
||||
backend/xerox_mfp.h | 5 -
|
||||
doc/descriptions/xerox_mfp.desc | 10 +-
|
||||
5 files changed, 14 insertions(+), 203 deletions(-)
|
||||
|
||||
diff --git a/backend/Makefile.am b/backend/Makefile.am
|
||||
index 18695a4a..3225b133 100644
|
||||
--- a/backend/Makefile.am
|
||||
+++ b/backend/Makefile.am
|
||||
@@ -1086,7 +1086,7 @@ libxerox_mfp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=xerox_mfp
|
||||
nodist_libsane_xerox_mfp_la_SOURCES = xerox_mfp-s.c
|
||||
libsane_xerox_mfp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=xerox_mfp
|
||||
libsane_xerox_mfp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS)
|
||||
-libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo @SANEI_SANEI_JPEG_LO@ $(JPEG_LIBS) ../sanei/sanei_usb.lo ../sanei/sanei_tcp.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) $(RESMGR_LIBS)
|
||||
+libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_tcp.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) $(RESMGR_LIBS)
|
||||
EXTRA_DIST += xerox_mfp.conf.in
|
||||
|
||||
libdll_preload_la_SOURCES = dll.c
|
||||
diff --git a/backend/Makefile.in b/backend/Makefile.in
|
||||
index d1dca4a2..2643bb77 100644
|
||||
--- a/backend/Makefile.in
|
||||
+++ b/backend/Makefile.in
|
||||
@@ -1430,10 +1430,9 @@ libsane_v4l_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
||||
libsane_xerox_mfp_la_DEPENDENCIES = $(COMMON_LIBS) libxerox_mfp.la \
|
||||
../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \
|
||||
../sanei/sanei_config.lo sane_strstatus.lo \
|
||||
- $(am__DEPENDENCIES_1) ../sanei/sanei_usb.lo \
|
||||
- ../sanei/sanei_tcp.lo $(am__DEPENDENCIES_1) \
|
||||
+ ../sanei/sanei_usb.lo ../sanei/sanei_tcp.lo \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
|
||||
- $(am__DEPENDENCIES_1)
|
||||
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
nodist_libsane_xerox_mfp_la_OBJECTS = \
|
||||
libsane_xerox_mfp_la-xerox_mfp-s.lo
|
||||
libsane_xerox_mfp_la_OBJECTS = $(nodist_libsane_xerox_mfp_la_OBJECTS)
|
||||
@@ -2754,7 +2753,7 @@ libxerox_mfp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=xerox_mfp
|
||||
nodist_libsane_xerox_mfp_la_SOURCES = xerox_mfp-s.c
|
||||
libsane_xerox_mfp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=xerox_mfp
|
||||
libsane_xerox_mfp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS)
|
||||
-libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo @SANEI_SANEI_JPEG_LO@ $(JPEG_LIBS) ../sanei/sanei_usb.lo ../sanei/sanei_tcp.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) $(RESMGR_LIBS)
|
||||
+libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_tcp.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) $(RESMGR_LIBS)
|
||||
libdll_preload_la_SOURCES = dll.c
|
||||
libdll_preload_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll -DENABLE_PRELOAD
|
||||
libdll_la_SOURCES = dll.c
|
||||
diff --git a/backend/xerox_mfp.c b/backend/xerox_mfp.c
|
||||
index 8b8c8956..d37a6237 100644
|
||||
--- a/backend/xerox_mfp.c
|
||||
+++ b/backend/xerox_mfp.c
|
||||
@@ -33,9 +33,6 @@
|
||||
#include "../include/sane/sanei_usb.h"
|
||||
#include "../include/sane/sanei_config.h"
|
||||
#include "../include/sane/sanei_backend.h"
|
||||
-#ifdef HAVE_LIBJPEG
|
||||
-#include <jpeglib.h>
|
||||
-#endif
|
||||
#include "xerox_mfp.h"
|
||||
|
||||
#define BACKEND_BUILD 13
|
||||
@@ -93,128 +90,6 @@ static char *str_cmd(int cmd)
|
||||
}
|
||||
|
||||
#define MAX_DUMP 70
|
||||
-const char *encTmpFileName = "/tmp/stmp_enc.tmp";
|
||||
-
|
||||
-static int decompress(struct device __sane_unused__ *dev,
|
||||
- const char __sane_unused__ *infilename)
|
||||
-{
|
||||
-#ifdef HAVE_LIBJPEG
|
||||
- int rc;
|
||||
- int row_stride, width, height, pixel_size;
|
||||
- struct jpeg_decompress_struct cinfo;
|
||||
- struct jpeg_error_mgr jerr;
|
||||
- unsigned long bmp_size = 0;
|
||||
- FILE *pInfile = NULL;
|
||||
- JSAMPARRAY buffer;
|
||||
-
|
||||
- if ((pInfile = fopen(infilename, "rb")) == NULL) {
|
||||
- fprintf(stderr, "can't open %s\n", infilename);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- cinfo.err = jpeg_std_error(&jerr);
|
||||
-
|
||||
- jpeg_create_decompress(&cinfo);
|
||||
-
|
||||
- jpeg_stdio_src(&cinfo, pInfile);
|
||||
-
|
||||
- rc = jpeg_read_header(&cinfo, TRUE);
|
||||
- if (rc != 1) {
|
||||
- jpeg_destroy_decompress(&cinfo);
|
||||
- fclose(pInfile);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- jpeg_start_decompress(&cinfo);
|
||||
-
|
||||
- width = cinfo.output_width;
|
||||
- height = cinfo.output_height;
|
||||
- pixel_size = cinfo.output_components;
|
||||
- bmp_size = width * height * pixel_size;
|
||||
- dev->decDataSize = bmp_size;
|
||||
-
|
||||
- row_stride = width * pixel_size;
|
||||
-
|
||||
- buffer = (*cinfo.mem->alloc_sarray)
|
||||
- ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);
|
||||
-
|
||||
- while (cinfo.output_scanline < cinfo.output_height) {
|
||||
- buffer[0] = dev->decData + \
|
||||
- (cinfo.output_scanline) * row_stride;
|
||||
- jpeg_read_scanlines(&cinfo, buffer, 1);
|
||||
- }
|
||||
- jpeg_finish_decompress(&cinfo);
|
||||
- jpeg_destroy_decompress(&cinfo);
|
||||
- fclose(pInfile);
|
||||
- return 0;
|
||||
-#else
|
||||
- return -1;
|
||||
-#endif
|
||||
-}
|
||||
-
|
||||
-static int copy_decompress_data(struct device *dev, unsigned char *pDest, int maxlen, int *destLen)
|
||||
-{
|
||||
- int data_size = 0;
|
||||
- size_t result = 0, retVal = 0;
|
||||
-
|
||||
-
|
||||
- if (0 == dev->decDataSize) {
|
||||
- *destLen = 0;
|
||||
- return retVal;
|
||||
- }
|
||||
- data_size = dev->decDataSize - dev->currentDecDataIndex;
|
||||
- if (data_size > maxlen) {
|
||||
- data_size = maxlen;
|
||||
- }
|
||||
- memcpy(pDest, dev->decData+dev->currentDecDataIndex, data_size);
|
||||
- result = data_size;
|
||||
- *destLen = result;
|
||||
- dev->currentDecDataIndex += result;
|
||||
- retVal = result;
|
||||
-
|
||||
- if (dev->decDataSize == dev->currentDecDataIndex) {
|
||||
- dev->currentDecDataIndex = 0;
|
||||
- dev->decDataSize = 0;
|
||||
- }
|
||||
-
|
||||
- return retVal;
|
||||
-}
|
||||
-
|
||||
-static int decompress_tempfile(struct device *dev)
|
||||
-{
|
||||
- decompress(dev, encTmpFileName);
|
||||
- remove(encTmpFileName);
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int dump_to_tmp_file(struct device *dev)
|
||||
-{
|
||||
- unsigned char *pSrc = dev->data;
|
||||
- int srcLen = dev->datalen;
|
||||
- FILE *pInfile;
|
||||
- if ((pInfile = fopen(encTmpFileName, "a")) == NULL) {
|
||||
- fprintf(stderr, "can't open %s\n", encTmpFileName);
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- fwrite(pSrc, 1, srcLen, pInfile);
|
||||
- fclose(pInfile);
|
||||
- return srcLen;
|
||||
-}
|
||||
-
|
||||
-static int isSupportedDevice(struct device __sane_unused__ *dev)
|
||||
-{
|
||||
-#ifdef HAVE_LIBJPEG
|
||||
- /* Checking device which supports JPEG Lossy compression for color scanning*/
|
||||
- if (dev->compressionTypes & (1 << 6))
|
||||
- return 1;
|
||||
- else
|
||||
- return 0;
|
||||
-#else
|
||||
- return 0;
|
||||
-#endif
|
||||
-}
|
||||
-
|
||||
static void dbg_dump(struct device *dev)
|
||||
{
|
||||
int i;
|
||||
@@ -639,11 +514,9 @@ static void set_parameters(struct device *dev)
|
||||
dev->para.pixels_per_line = dev->win_width / px_to_len;
|
||||
dev->para.bytes_per_line = dev->para.pixels_per_line;
|
||||
|
||||
- if (!isSupportedDevice(dev)) {
|
||||
#if BETTER_BASEDPI
|
||||
- px_to_len = 1213.9 / dev->val[OPT_RESOLUTION].w;
|
||||
+ px_to_len = 1213.9 / dev->val[OPT_RESOLUTION].w;
|
||||
#endif
|
||||
- }
|
||||
dev->para.lines = dev->win_len / px_to_len;
|
||||
if (dev->composition == MODE_LINEART ||
|
||||
dev->composition == MODE_HALFTONE) {
|
||||
@@ -765,13 +638,6 @@ static int dev_set_window(struct device *dev)
|
||||
cmd[0x11] = (SANE_Byte)floor(dev->win_off_y);
|
||||
cmd[0x12] = (SANE_Byte)((dev->win_off_y - floor(dev->win_off_y)) * 100);
|
||||
cmd[0x13] = dev->composition;
|
||||
- /* Set to JPEG Lossy Compression, if mode is color (only for supported model)...
|
||||
- * else go with Uncompressed (For backard compatibility with old models )*/
|
||||
- if (dev->composition == MODE_RGB24) {
|
||||
- if (isSupportedDevice(dev)) {
|
||||
- cmd[0x14] = 0x6;
|
||||
- }
|
||||
- }
|
||||
cmd[0x16] = dev->threshold;
|
||||
cmd[0x17] = dev->doc_source;
|
||||
|
||||
@@ -843,7 +709,6 @@ dev_inquiry(struct device *dev)
|
||||
dev->res[0x3e] << 8 |
|
||||
dev->res[0x3f];
|
||||
dev->line_order = dev->res[0x31];
|
||||
- dev->compressionTypes = dev->res[0x32];
|
||||
dev->doc_loaded = (dev->res[0x35] == 0x02) &&
|
||||
(dev->res[0x26] & 0x03);
|
||||
|
||||
@@ -942,10 +807,6 @@ dev_free(struct device *dev)
|
||||
free(UNCONST(dev->sane.type));
|
||||
if (dev->data)
|
||||
free(dev->data);
|
||||
- if (dev->decData) {
|
||||
- free(dev->decData);
|
||||
- dev->decData = NULL;
|
||||
- }
|
||||
memset(dev, 0, sizeof(*dev));
|
||||
free(dev);
|
||||
}
|
||||
@@ -1283,19 +1144,6 @@ sane_read(SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp)
|
||||
/* if there is no data to read or output from buffer */
|
||||
if (!dev->blocklen && dev->datalen <= PADDING_SIZE) {
|
||||
|
||||
- /* copying uncompressed data */
|
||||
- if (dev->composition == MODE_RGB24 &&
|
||||
- isSupportedDevice(dev) &&
|
||||
- dev->decDataSize > 0) {
|
||||
- int diff = dev->total_img_size - dev->total_out_size;
|
||||
- int bufLen = (diff < maxlen) ? diff : maxlen;
|
||||
- if (0 < diff &&
|
||||
- 0 < copy_decompress_data(dev, buf, bufLen, lenp)) {
|
||||
- dev->total_out_size += *lenp;
|
||||
- return SANE_STATUS_GOOD;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
/* and we don't need to acquire next block */
|
||||
if (dev->final_block) {
|
||||
int slack = dev->total_img_size - dev->total_out_size;
|
||||
@@ -1311,10 +1159,7 @@ sane_read(SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp)
|
||||
/* this will never happen */
|
||||
DBG(1, "image overflow %d bytes\n", dev->total_img_size - dev->total_out_size);
|
||||
}
|
||||
- if (isSupportedDevice(dev) &&
|
||||
- dev->composition == MODE_RGB24) {
|
||||
- remove(encTmpFileName);
|
||||
- }
|
||||
+
|
||||
/* that's all */
|
||||
dev_stop(dev);
|
||||
return SANE_STATUS_EOF;
|
||||
@@ -1365,18 +1210,9 @@ sane_read(SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp)
|
||||
|
||||
if (buf && lenp) { /* read mode */
|
||||
/* copy will do minimal of valid data */
|
||||
- if (dev->para.format == SANE_FRAME_RGB && dev->line_order) {
|
||||
- if (isSupportedDevice(dev)) {
|
||||
- clrlen = dump_to_tmp_file(dev);
|
||||
- /* decompress after reading entire block data*/
|
||||
- if (0 == dev->blocklen) {
|
||||
- decompress_tempfile(dev);
|
||||
- }
|
||||
- copy_decompress_data(dev, buf, maxlen, &olen);
|
||||
- } else {
|
||||
- clrlen = copy_mix_bands_trim(dev, buf, maxlen, &olen);
|
||||
- }
|
||||
- } else
|
||||
+ if (dev->para.format == SANE_FRAME_RGB && dev->line_order)
|
||||
+ clrlen = copy_mix_bands_trim(dev, buf, maxlen, &olen);
|
||||
+ else
|
||||
clrlen = copy_plain_trim(dev, buf, maxlen, &olen);
|
||||
|
||||
dev->datalen -= clrlen;
|
||||
@@ -1455,9 +1291,6 @@ sane_start(SANE_Handle h)
|
||||
if (!dev->data && !(dev->data = malloc(DATASIZE)))
|
||||
return ret_cancel(dev, SANE_STATUS_NO_MEM);
|
||||
|
||||
- if (!dev->decData && !(dev->decData = malloc(POST_DATASIZE)))
|
||||
- return ret_cancel(dev, SANE_STATUS_NO_MEM);
|
||||
-
|
||||
if (!dev_acquire(dev))
|
||||
return dev->state;
|
||||
|
||||
@@ -1479,22 +1312,6 @@ sane_start(SANE_Handle h)
|
||||
|
||||
dev->total_img_size = dev->para.bytes_per_line * dev->para.lines;
|
||||
|
||||
- if (isSupportedDevice(dev) &&
|
||||
- dev->composition == MODE_RGB24) {
|
||||
- int fd;
|
||||
- remove(encTmpFileName);
|
||||
-
|
||||
- /* Precreate temporary file in exclusive mode. */
|
||||
- fd = open(encTmpFileName, O_CREAT|O_EXCL, 0600);
|
||||
- if (fd == -1) {
|
||||
- DBG(3, "%s: %p, can't create temporary file %s: %s\n", __func__,
|
||||
- (void *)dev, encTmpFileName, strerror(errno));
|
||||
- return ret_cancel(dev, SANE_STATUS_ACCESS_DENIED);
|
||||
- }
|
||||
- close(fd);
|
||||
- }
|
||||
- dev->currentDecDataIndex = 0;
|
||||
-
|
||||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
||||
diff --git a/backend/xerox_mfp.h b/backend/xerox_mfp.h
|
||||
index 3d93f06d..ea89dda2 100644
|
||||
--- a/backend/xerox_mfp.h
|
||||
+++ b/backend/xerox_mfp.h
|
||||
@@ -74,10 +74,6 @@ struct device {
|
||||
#define DATATAIL(dev) ((dev->dataoff + dev->datalen) & DATAMASK)
|
||||
#define DATAROOM(dev) dataroom(dev)
|
||||
|
||||
-#define POST_DATASIZE 0xFFFFFF
|
||||
- SANE_Byte *decData;
|
||||
- int decDataSize;
|
||||
- int currentDecDataIndex;
|
||||
/* data from CMD_INQUIRY: */
|
||||
int resolutions; /* supported resolution bitmask */
|
||||
int compositions; /* supported image compositions bitmask */
|
||||
@@ -102,7 +98,6 @@ struct device {
|
||||
int composition; /* MODE_ */
|
||||
int doc_source; /* document source */
|
||||
int threshold; /* brightness */
|
||||
- int compressionTypes;
|
||||
|
||||
/* CMD_READ data. It is per block only, image could be in many blocks */
|
||||
int blocklen; /* image data block len (padding incl.) */
|
||||
diff --git a/doc/descriptions/xerox_mfp.desc b/doc/descriptions/xerox_mfp.desc
|
||||
index d21a6be6..67253b38 100644
|
||||
--- a/doc/descriptions/xerox_mfp.desc
|
||||
+++ b/doc/descriptions/xerox_mfp.desc
|
||||
@@ -320,7 +320,7 @@
|
||||
|
||||
:model "SCX-3405W"
|
||||
:interface "Ethernet"
|
||||
-:status :good
|
||||
+:status :basic
|
||||
|
||||
:model "SCX-3400"
|
||||
:interface "USB"
|
||||
@@ -335,17 +335,17 @@
|
||||
:model "SCX-4729FD"
|
||||
:interface "USB"
|
||||
:usbid "0x04e8" "0x3453"
|
||||
-:status :good
|
||||
+:status :basic
|
||||
|
||||
:model "CLX-6260"
|
||||
:interface "USB"
|
||||
:usbid "0x04e8" "0x3455"
|
||||
-:status :good
|
||||
+:status :minimal
|
||||
|
||||
:model "CLX-3300 Series"
|
||||
:interface "USB"
|
||||
:usbid "0x04e8" "0x3456"
|
||||
-:status :good
|
||||
+:status :basic
|
||||
|
||||
:model "SCX-470x"
|
||||
:interface "USB"
|
||||
@@ -355,7 +355,7 @@
|
||||
:model "CLX-4190"
|
||||
:interface "USB"
|
||||
:usbid "0x04e8" "0x345a"
|
||||
-:status :good
|
||||
+:status :minimal
|
||||
|
||||
:model "SCX-4650 4x21S Series"
|
||||
:interface "USB"
|
||||
--
|
||||
2.17.0
|
||||
|
@ -1,9 +1,9 @@
|
||||
diff -up sane-backends-1.0.27/doc/saned.man.saned-manpage sane-backends-1.0.27/doc/saned.man
|
||||
--- sane-backends-1.0.27/doc/saned.man.saned-manpage 2017-11-27 12:42:05.077326419 +0100
|
||||
+++ sane-backends-1.0.27/doc/saned.man 2017-11-27 12:43:21.169769553 +0100
|
||||
@@ -223,8 +223,22 @@ installed on the system. this is the pre
|
||||
Saned can be used wih systemd without the systemd integration
|
||||
compiled in, but then logging of debug information is not supported.
|
||||
diff -up sane-backends-1.0.28/doc/saned.man.saned-manpage sane-backends-1.0.28/doc/saned.man
|
||||
--- sane-backends-1.0.28/doc/saned.man.saned-manpage 2019-09-12 10:28:11.572506087 +0200
|
||||
+++ sane-backends-1.0.28/doc/saned.man 2019-09-12 10:35:49.445861686 +0200
|
||||
@@ -257,8 +257,22 @@ installed on the system. this is the pre
|
||||
Saned can be used wih systemd without the systemd integration
|
||||
compiled in, but then logging of debug information is not supported.
|
||||
|
||||
-The systemd configuration is different for the 2 options, so
|
||||
-both are described below.
|
||||
|
@ -32,14 +32,14 @@
|
||||
|
||||
Summary: Scanner access software
|
||||
Name: sane-backends
|
||||
Version: 1.0.27
|
||||
Release: 25%{?dist}
|
||||
Version: 1.0.28
|
||||
Release: 1%{?dist}
|
||||
# lib/ is LGPLv2+, backends are GPLv2+ with exceptions
|
||||
# Tools are GPLv2+, docs are public domain
|
||||
# see LICENSE for details
|
||||
License: GPLv2+ and GPLv2+ with exceptions and Public Domain and IJG and LGPLv2+ and MIT
|
||||
# Alioth Download URLs are amazing.
|
||||
Source0: https://gitlab.com/sane-project/backends/uploads/a3ba9fff29253a94e84074917bff581a/%{name}-%{version}.tar.gz
|
||||
Source0: https://gitlab.com/sane-project/backends/uploads/9e718daff347826f4cfe21126c8d5091/%{name}-%{version}.tar.gz
|
||||
Source1: sane.png
|
||||
Source2: saned.socket
|
||||
Source3: saned@.service.in
|
||||
@ -55,15 +55,9 @@ Patch1: sane-backends-1.0.23-soname.patch
|
||||
Patch2: sane-backends-1.0.23-sane-config-multilib.patch
|
||||
# saned manpage incomplete and exists when saned is not installed (#1515762)
|
||||
Patch3: sane-backends-saned-manpage.patch
|
||||
# Black vertical band in color and gray images with Canon LIDE 100 scanner (bug #1540370)
|
||||
Patch4: sane-backends-canon-lide-100.patch
|
||||
# Revert samsung patch from upstream (upstream tracker https://alioth.debian.org/tracker/index.php?func=detail&aid=315876&group_id=30186&atid=410366)
|
||||
Patch5: sane-backends-revert-samsung-patch.patch
|
||||
# Mustek scanner did not work since Fedora 27 due more strict gcc flags
|
||||
# Backported from upstream https://gitlab.com/sane-project/backends/commit/93340afddfbc4085a5297fe635b65dd7f7f3ef05
|
||||
Patch6: 0001-mustek_usb2-Avoid-stack-smashing.-Fixes-35.patch
|
||||
# added support for Canon CanoScan LiDE 300
|
||||
Patch7: 0001-pixma-new-scanner-CanoScan-LIDE-300.patch
|
||||
|
||||
|
||||
#Patch5: sane-backends-revert-samsung-patch.patch
|
||||
|
||||
URL: http://www.sane-project.org
|
||||
|
||||
@ -197,10 +191,6 @@ access image acquisition devices available on the local host.
|
||||
%patch1 -p1 -b .soname
|
||||
%patch2 -p1 -b .sane-config-multilib
|
||||
%patch3 -p1 -b .saned-manpage
|
||||
%patch4 -p1 -b .canon-lide-100
|
||||
%patch5 -p1 -b .revert-samsung-patch
|
||||
%patch6 -p1 -b .mustek-stack-smash
|
||||
%patch7 -p1 -b .add-canoscan-lide-300
|
||||
|
||||
%build
|
||||
CFLAGS="%optflags -fno-strict-aliasing"
|
||||
@ -333,7 +323,7 @@ exit 0
|
||||
|
||||
%files libs
|
||||
%{_libdir}/libsane.so.1
|
||||
%{_libdir}/libsane.so.1.0.27
|
||||
%{_libdir}/libsane.so.1.0.28
|
||||
|
||||
%files devel
|
||||
%{_bindir}/sane-config
|
||||
@ -345,14 +335,14 @@ exit 0
|
||||
%files drivers-scanners
|
||||
%{_libdir}/sane/*.so
|
||||
%{_libdir}/sane/*.so.1
|
||||
%{_libdir}/sane/*.so.1.0.27
|
||||
%{_libdir}/sane/*.so.1.0.28
|
||||
|
||||
%exclude %{_libdir}/sane/*gphoto2.so*
|
||||
|
||||
%files drivers-cameras
|
||||
%{_libdir}/sane/libsane-gphoto2.so
|
||||
%{_libdir}/sane/libsane-gphoto2.so.1
|
||||
%{_libdir}/sane/libsane-gphoto2.so.1.0.27
|
||||
%{_libdir}/sane/libsane-gphoto2.so.1.0.28
|
||||
|
||||
%files daemon
|
||||
%{_sbindir}/saned
|
||||
@ -362,6 +352,9 @@ exit 0
|
||||
%{_unitdir}/saned@.service
|
||||
|
||||
%changelog
|
||||
* Mon Sep 30 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.0.28-1
|
||||
- 1.0.28
|
||||
|
||||
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.27-25
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (sane-backends-1.0.27.tar.gz) = c6552768bfc10216730fc11011c82f74ca0952182019ded3916072147ec09be5c975ce1d37dc3ccea050c488dbdf983c2ca17dcd702644060ba796ae2591f9c5
|
||||
SHA512 (sane-backends-1.0.28.tar.gz) = 84607739cea28c31f9a2f21df583c3d9f3ad1e7e87ad54fb8af8103450b22d2de6cf1670563eaa8310750491f840b377a2ca42c5eaee45aaec500a0a6792b3af
|
||||
|
Loading…
Reference in New Issue
Block a user