Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

epjitsu: add trailer padding

  • Loading branch information...
commit fadfbcb0d5b27c44462ce97b2c6cdec7a01d95d7 1 parent d6adbb3
Hiroshi Miura authored

Showing 1 changed file with 19 additions and 17 deletions. Show diff stats Hide diff stats

  1. +19 17 backend/epjitsu.c
36 backend/epjitsu.c
@@ -1906,8 +1906,8 @@ change_params(struct scanner *s)
1906 1906 }
1907 1907 else
1908 1908 {
1909   - /* adf with specified paper size requires padding (~1/2in) */
1910   - s->fullscan.height = (s->page_height+ADF_HEIGHT_PADDING) * s->resolution_y / 1200;
  1909 + /* adf with specified paper size requires padding in both top and bottom (~1/2in) */
  1910 + s->fullscan.height = (s->page_height + ADF_HEIGHT_PADDING * 2) * s->resolution_y / 1200;
1911 1911 }
1912 1912
1913 1913 /* fill in front settings */
@@ -1928,7 +1928,6 @@ change_params(struct scanner *s)
1928 1928 /*output image might be taller than scan due to interpolation*/
1929 1929 s->front.height = (s->page_height * s->resolution_x) / 1200;
1930 1930 /* that is (s->page_height * s->resolution_y / 1200) * (s->resolution_x / s->resolution_y) */
1931   - DBG (5, "change_params: page_height:%d, front_height:%d\n", s->page_height, s->front.height);
1932 1931 s->front.pages = 1;
1933 1932 s->front.buffer = NULL;
1934 1933
@@ -1952,6 +1951,7 @@ change_params(struct scanner *s)
1952 1951 s->pages[SIDE_FRONT].done = 0;
1953 1952 s->pages[SIDE_BACK].done = 0;
1954 1953
  1954 + DBG (5, "change_params: fullscan_height:%d, page_height:%d, front_height:%d\n", s->fullscan.height, s->page_height, s->front.height);
1955 1955 DBG (10, "change_params: finish\n");
1956 1956
1957 1957 return ret;
@@ -3803,7 +3803,7 @@ copy_block_to_page(struct scanner *s,int side)
3803 3803 int line_reverse = (side == SIDE_BACK) || (s->model == MODEL_FI60F);
3804 3804 int image_start = (image_width - page_width)/2;
3805 3805 int image_skip_bytes;
3806   - int i,j,k;
  3806 + int i,j,k=0;
3807 3807
3808 3808 DBG (10, "copy_block_to_page: start\n");
3809 3809
@@ -3821,20 +3821,22 @@ copy_block_to_page(struct scanner *s,int side)
3821 3821 image_skip_bytes = block->image->width_bytes - (image_start + page_width)/8;
3822 3822 }
3823 3823
3824   - k = 0;
3825   - int padding_skip_bytes = block->line_stride * (ADF_HEIGHT_PADDING * s->resolution_y /1200);
3826   -
3827   - if (s->fullscan.rx_bytes + s->block_xfr.rx_bytes < padding_skip_bytes)
3828   - {
3829   - return ret;
3830   - }
3831   - else if (s->fullscan.rx_bytes < padding_skip_bytes)
  3824 + if(s->source != SOURCE_FLATBED && s->page_height)
3832 3825 {
3833   - k = (padding_skip_bytes - s->fullscan.rx_bytes) / block->image->width_bytes;
3834   - }
3835   - else
3836   - {
3837   - k = 0;
  3826 + int padding_skip_bytes = block->line_stride * (ADF_HEIGHT_PADDING * s->resolution_y /1200);
  3827 + if (s->fullscan.rx_bytes + s->block_xfr.rx_bytes < padding_skip_bytes)
  3828 + {
  3829 + /* skip padding */
  3830 + return ret;
  3831 + }
  3832 + else if (s->fullscan.rx_bytes < padding_skip_bytes)
  3833 + {
  3834 + k = (padding_skip_bytes - s->fullscan.rx_bytes) / block->image->width_bytes;
  3835 + }
  3836 + else
  3837 + {
  3838 + k = 0;
  3839 + }
3838 3840 }
3839 3841
3840 3842 /* loop over all the lines in the block */

0 comments on commit fadfbcb

Please sign in to comment.
Something went wrong with that request. Please try again.