Skip to content

Commit

Permalink
- Added a check for non-standard TIFF files (e.g. Philips) to not be …
Browse files Browse the repository at this point in the history
…read by our TIFF reader.
  • Loading branch information
GeertLitjens committed Feb 21, 2017
1 parent 0538414 commit 336af63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PROJECT(DIAGPathology)

SET(CURRENT_MAJOR_VERSION 1)
SET(CURRENT_MINOR_VERSION 7)
SET(CURRENT_PATCH_VERSION 0)
SET(CURRENT_PATCH_VERSION 1)
set(ASAP_VERSION ${CURRENT_MAJOR_VERSION}.${CURRENT_MINOR_VERSION}.${CURRENT_PATCH_VERSION})

include (GenerateExportHeader)
Expand Down
8 changes: 8 additions & 0 deletions io/multiresolutionimageinterface/TIFFImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ bool TIFFImage::initializeType(const std::string& imagePath) {
TIFFSetErrorHandler(NULL);

if (_tiff) {
const char * img_desc;
TIFFGetField(_tiff, TIFFTAG_IMAGEDESCRIPTION, &img_desc);
std::string img_desc_string(img_desc);
if (img_desc_string.find("xml") != std::string::npos || img_desc_string.find("XML") != std::string::npos) {
// Not one of our TIFFs
cleanup();
return false;
}
unsigned int cType = 0, dType = 0, planarconfig=0, bitsPerSample = 0;
TIFFGetField(_tiff, TIFFTAG_PHOTOMETRIC, &cType);

Expand Down

0 comments on commit 336af63

Please sign in to comment.