Skip to content

Commit

Permalink
Fixed issue 229: lack of bits per sample
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@316 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
theraysmith committed Aug 20, 2009
1 parent 53ee04b commit 57d669f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ccmain/tessedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ void read_tiff_image(TIFF* tif, IMAGE* image) {
inT16 samples_per_pixel = 0;
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &image_width);
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &image_height);
TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bpp);
if (!TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bpp))
bpp = 1; // Binary is default if no value provided.
TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samples_per_pixel);
TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric);
if (samples_per_pixel > 1)
Expand Down

0 comments on commit 57d669f

Please sign in to comment.