Hi,
Sorry to bother you again, but I improved the scanimage color hack for Epson
Perfection 610 somewhat to work for all resolutions (75-150-300-600).
It may be useful for other people with a Perfection 610, so that is why I
bother you all once more.
static void
write_pnm_header (SANE_Frame format, int width, int height, int depth)
{
/* The netpbm-package does not define raw image data with maxval > 255. */
/* But writing maxval 65535 for 16bit data gives at least a chance */
/* to read the image. */
+ #ifdef EPSON610_COLOR_HACK
+ static int get_resolution (void);
+ #endif
switch (format)
{
case SANE_FRAME_RED:
case SANE_FRAME_GREEN:
case SANE_FRAME_BLUE:
case SANE_FRAME_RGB:
printf ("P6\n# SANE data follows\n%d %d\n%d\n",
+ #ifdef EPSON610_COLOR_HACK
+ width,height -get_resolution() / 15,
+ #else
width,height,
+ #endif
(depth <= 8) ? 255 : 65535);
break;
Now recompiling with with -DEPSON610_COLOR_HACK produces ppm files with the
height parameter adjusted to fit (more or less) the actual image size (only for
color !)
best regards,
-- Kees Lemmens, Email: C.W.J.Lemmens@its.tudelft.nl, WWW : http://ta.twi.tudelft.nl/DV/Staff/Lemmens/index.html Home : 010-4742919/4740254, Office: 015-2787224, Fax/XOIP: 020-8666099-- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
This archive was generated by hypermail 2b29 : Sun Feb 18 2001 - 04:51:59 PST