comparison Core/Images/JpegReader.cpp @ 2683:964fb9a5786d

fix build on OS X
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 21 Jun 2018 09:32:16 +0200
parents 878b59270859
children d924f9bb61cc
comparison
equal deleted inserted replaced
2682:bc5e87cf10a3 2683:964fb9a5786d
47 { 47 {
48 static void Uncompress(struct jpeg_decompress_struct& cinfo, 48 static void Uncompress(struct jpeg_decompress_struct& cinfo,
49 std::string& content, 49 std::string& content,
50 ImageAccessor& accessor) 50 ImageAccessor& accessor)
51 { 51 {
52 jpeg_read_header(&cinfo, TRUE); 52 // The "static_cast" is necessary on OS X:
53 // https://github.com/simonfuhrmann/mve/issues/371
54 jpeg_read_header(&cinfo, static_cast<boolean>(true));
55
53 jpeg_start_decompress(&cinfo); 56 jpeg_start_decompress(&cinfo);
54 57
55 PixelFormat format; 58 PixelFormat format;
56 if (cinfo.output_components == 1 && 59 if (cinfo.output_components == 1 &&
57 cinfo.out_color_space == JCS_GRAYSCALE) 60 cinfo.out_color_space == JCS_GRAYSCALE)