sane-project-website/old-archive/2000-11/att-0184/01-stiff.patch

41 wiersze
1.3 KiB
Diff

*** stiff.c Tue Nov 14 15:47:33 2000
--- ../../../sane-1.0.3/frontend/stiff.c Tue Nov 14 15:08:33 2000
***************
*** 385,392 ****
/* image length */
add_ifd_entry (ifd, 257, (height > 0xffff) ? IFDE_TYP_LONG : IFDE_TYP_SHORT,
1, height);
! /* bits per sample */
! add_ifd_entry (ifd, 258, IFDE_TYP_SHORT, 1, depth);
/* compression (uncompressed) */
add_ifd_entry (ifd, 259, IFDE_TYP_SHORT, 1, 1);
/* photometric interpretation */
--- 385,397 ----
/* image length */
add_ifd_entry (ifd, 257, (height > 0xffff) ? IFDE_TYP_LONG : IFDE_TYP_SHORT,
1, height);
!
! /* bits per sample: for RGB (photometric = 2) we have to specify 1 value
! * for each sample (see TIFF6.0 Spec)
! */
! add_ifd_entry (ifd, 258, IFDE_TYP_SHORT, 3, data_offset);
! data_offset += 3*2;
!
/* compression (uncompressed) */
add_ifd_entry (ifd, 259, IFDE_TYP_SHORT, 1, 1);
/* photometric interpretation */
***************
*** 434,439 ****
--- 439,449 ----
}
write_ifd (fptr, ifd, motorola);
+
+ /* Write bits per sample */
+ write_i2 (fptr, depth, motorola);
+ write_i2 (fptr, depth, motorola);
+ write_i2 (fptr, depth, motorola);
/* Write min sample value values */
write_i2 (fptr, 0, motorola);