# HG changeset patch # User Sebastien Jodogne # Date 1492164205 -7200 # Node ID 81e2651dca173a7d7ef324a3ad1919e736e339c0 # Parent ed07f4bbf1a8f276d6a8bc5a85e145de1e6d44df sync diff -r ed07f4bbf1a8 -r 81e2651dca17 Framework/Viewport/CairoSurface.cpp --- a/Framework/Viewport/CairoSurface.cpp Wed Mar 22 15:57:24 2017 +0100 +++ b/Framework/Viewport/CairoSurface.cpp Fri Apr 14 12:03:25 2017 +0200 @@ -77,8 +77,11 @@ CairoSurface::CairoSurface(Orthanc::ImageAccessor& accessor) { + printf("Enter\n"); + if (accessor.GetFormat() != Orthanc::PixelFormat_BGRA32) { + printf("Error 1\n"); throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat); } @@ -91,16 +94,20 @@ (reinterpret_cast(buffer_), CAIRO_FORMAT_RGB24, width_, height_, pitch_); if (!surface_) { + printf("Error 2\n"); // Should never occur throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } if (cairo_surface_status(surface_) != CAIRO_STATUS_SUCCESS) { + printf("Error 3\n"); LOG(ERROR) << "Bad pitch for a Cairo surface"; cairo_surface_destroy(surface_); throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } + + printf("Success\n"); } diff -r ed07f4bbf1a8 -r 81e2651dca17 Resources/Orthanc/Core/HttpClient.cpp --- a/Resources/Orthanc/Core/HttpClient.cpp Wed Mar 22 15:57:24 2017 +0100 +++ b/Resources/Orthanc/Core/HttpClient.cpp Fri Apr 14 12:03:25 2017 +0200 @@ -823,10 +823,12 @@ void HttpClient::FinalizeOpenSsl() { - #if ORTHANC_ENABLE_SSL == 1 +#if ORTHANC_ENABLE_SSL == 1 // Finalize OpenSSL // https://wiki.openssl.org/index.php/Library_Initialization#Cleanup +#ifdef FIPS_mode_set FIPS_mode_set(0); +#endif ENGINE_cleanup(); CONF_modules_unload(1); EVP_cleanup(); diff -r ed07f4bbf1a8 -r 81e2651dca17 Resources/Orthanc/Core/Images/ImageProcessing.cpp --- a/Resources/Orthanc/Core/Images/ImageProcessing.cpp Wed Mar 22 15:57:24 2017 +0100 +++ b/Resources/Orthanc/Core/Images/ImageProcessing.cpp Fri Apr 14 12:03:25 2017 +0200 @@ -458,6 +458,26 @@ return; } + if (target.GetFormat() == PixelFormat_RGB24 && + source.GetFormat() == PixelFormat_BGRA32) + { + for (unsigned int y = 0; y < source.GetHeight(); y++) + { + const uint8_t* p = reinterpret_cast(source.GetConstRow(y)); + uint8_t* q = reinterpret_cast(target.GetRow(y)); + for (unsigned int x = 0; x < source.GetWidth(); x++) + { + q[0] = p[2]; + q[1] = p[1]; + q[2] = p[0]; + p += 4; + q += 3; + } + } + + return; + } + if (target.GetFormat() == PixelFormat_RGBA32 && source.GetFormat() == PixelFormat_RGB24) { diff -r ed07f4bbf1a8 -r 81e2651dca17 Resources/Orthanc/Core/Logging.cpp --- a/Resources/Orthanc/Core/Logging.cpp Wed Mar 22 15:57:24 2017 +0100 +++ b/Resources/Orthanc/Core/Logging.cpp Fri Apr 14 12:03:25 2017 +0200 @@ -91,7 +91,7 @@ void Initialize(OrthancPluginContext* context) { - context_ = context_; + context_ = context; } InternalLogger::InternalLogger(const char* level, @@ -117,6 +117,11 @@ { OrthancPluginLogInfo(context_, message_.c_str()); } + else + { + std::string s = "Unknown log level (" + level_ + ") for message: " + message_; + OrthancPluginLogError(context_, s.c_str()); + } } }