Skip to content

Commit

Permalink
Merge pull request #16 from CGDogan/patch-1
Browse files Browse the repository at this point in the history
OpenSlide should autodetect file type
  • Loading branch information
birm authored Jul 18, 2023
2 parents 95ac24b + 3e27021 commit 986f3d8
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions iipsrv/src/IIPImage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <ctime>
#include <limits>

#include "openslide.h"

using namespace std;

Expand Down Expand Up @@ -121,16 +122,10 @@ void IIPImage::testImageType() throw(file_error)
unsigned char lbigtiff[4] = {0x4D,0x4D,0x00,0x2B}; // Little Endian BigTIFF
unsigned char bbigtiff[4] = {0x49,0x49,0x2B,0x00}; // Big Endian BigTIFF


// Compare our header sequence to our magic byte signatures
if (suffix=="vtif" ||
suffix=="svs" ||
suffix=="ndpi" ||
suffix=="mrxs" ||
suffix=="vms" ||
suffix=="scn" ||
suffix=="bif")
const char * vendor = openslide_detect_vendor( path.c_str() );
if ( vendor != NULL && strcmp(vendor, "generic-tiff") )
format = OPENSLIDE;
// Compare our header sequence to our magic byte signatures
else if( memcmp( header, j2k, 10 ) == 0 ) format = JPEG2000;
else if( memcmp( header, stdtiff, 3 ) == 0
|| memcmp( header, lsbtiff, 4 ) == 0 || memcmp( header, msbtiff, 4 ) == 0
Expand Down

0 comments on commit 986f3d8

Please sign in to comment.