Mercurial > hg > orthanc
changeset 2683:964fb9a5786d
fix build on OS X
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 21 Jun 2018 09:32:16 +0200 |
parents | bc5e87cf10a3 |
children | b53cefe3901c 2c684841da15 |
files | Core/Images/JpegReader.cpp Core/Images/JpegWriter.cpp |
diffstat | 2 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/Core/Images/JpegReader.cpp Thu Jun 21 08:07:25 2018 +0200 +++ b/Core/Images/JpegReader.cpp Thu Jun 21 09:32:16 2018 +0200 @@ -49,7 +49,10 @@ std::string& content, ImageAccessor& accessor) { - jpeg_read_header(&cinfo, TRUE); + // The "static_cast" is necessary on OS X: + // https://github.com/simonfuhrmann/mve/issues/371 + jpeg_read_header(&cinfo, static_cast<boolean>(true)); + jpeg_start_decompress(&cinfo); PixelFormat format;
--- a/Core/Images/JpegWriter.cpp Thu Jun 21 08:07:25 2018 +0200 +++ b/Core/Images/JpegWriter.cpp Thu Jun 21 09:32:16 2018 +0200 @@ -96,8 +96,12 @@ } jpeg_set_defaults(&cinfo); - jpeg_set_quality(&cinfo, quality, TRUE); - jpeg_start_compress(&cinfo, TRUE); + + // The "static_cast" is necessary on OS X: + // https://github.com/simonfuhrmann/mve/issues/371 + jpeg_set_quality(&cinfo, quality, static_cast<boolean>(true)); + jpeg_start_compress(&cinfo, static_cast<boolean>(true)); + jpeg_write_scanlines(&cinfo, &lines[0], height); jpeg_finish_compress(&cinfo); jpeg_destroy_compress(&cinfo);