# HG changeset patch # User Sebastien Jodogne # Date 1476890529 -7200 # Node ID 88831c3edd8fc444b3d490e5f94142d1d2c94cbf # Parent 09cb73980740c6246d273cd289c6b3051735b8b2 fix diff -r 09cb73980740 -r 88831c3edd8f Core/HttpClient.cpp --- a/Core/HttpClient.cpp Mon Oct 17 15:36:50 2016 +0200 +++ b/Core/HttpClient.cpp Wed Oct 19 17:22:09 2016 +0200 @@ -328,7 +328,8 @@ pimpl_(new PImpl), verifyPeers_(true), pkcs11Enabled_(false), - headersToLowerCase_(true) + headersToLowerCase_(true), + redirectionFollowed_(true) { Setup(); } @@ -338,7 +339,8 @@ const std::string& uri) : pimpl_(new PImpl), verifyPeers_(true), - headersToLowerCase_(true) + headersToLowerCase_(true), + redirectionFollowed_(true) { Setup(); diff -r 09cb73980740 -r 88831c3edd8f Core/Images/Image.cpp --- a/Core/Images/Image.cpp Mon Oct 17 15:36:50 2016 +0200 +++ b/Core/Images/Image.cpp Wed Oct 19 17:22:09 2016 +0200 @@ -40,8 +40,9 @@ { Image::Image(PixelFormat format, unsigned int width, - unsigned int height) : - image_(format, width, height) + unsigned int height, + bool forceMinimalPitch) : + image_(format, width, height, forceMinimalPitch) { ImageAccessor accessor = image_.GetAccessor(); AssignWritable(format, width, height, accessor.GetPitch(), accessor.GetBuffer()); @@ -50,7 +51,7 @@ Image* Image::Clone(const ImageAccessor& source) { - std::auto_ptr target(new Image(source.GetFormat(), source.GetWidth(), source.GetHeight())); + std::auto_ptr target(new Image(source.GetFormat(), source.GetWidth(), source.GetHeight(), false)); ImageProcessing::Copy(*target, source); return target.release(); } diff -r 09cb73980740 -r 88831c3edd8f Core/Images/Image.h --- a/Core/Images/Image.h Mon Oct 17 15:36:50 2016 +0200 +++ b/Core/Images/Image.h Wed Oct 19 17:22:09 2016 +0200 @@ -45,7 +45,8 @@ public: Image(PixelFormat format, unsigned int width, - unsigned int height); + unsigned int height, + bool forceMinimalPitch); static Image* Clone(const ImageAccessor& source); }; diff -r 09cb73980740 -r 88831c3edd8f Core/Images/ImageBuffer.cpp --- a/Core/Images/ImageBuffer.cpp Mon Oct 17 15:36:50 2016 +0200 +++ b/Core/Images/ImageBuffer.cpp Wed Oct 19 17:22:09 2016 +0200 @@ -87,7 +87,9 @@ ImageBuffer::ImageBuffer(PixelFormat format, unsigned int width, - unsigned int height) + unsigned int height, + bool forceMinimalPitch) : + forceMinimalPitch_(forceMinimalPitch) { Initialize(); SetWidth(width); @@ -158,16 +160,6 @@ } - void ImageBuffer::SetMinimalPitchForced(bool force) - { - if (force != forceMinimalPitch_) - { - changed_ = true; - forceMinimalPitch_ = force; - } - } - - void ImageBuffer::AcquireOwnership(ImageBuffer& other) { // Remove the content of the current image diff -r 09cb73980740 -r 88831c3edd8f Core/Images/ImageBuffer.h --- a/Core/Images/ImageBuffer.h Mon Oct 17 15:36:50 2016 +0200 +++ b/Core/Images/ImageBuffer.h Wed Oct 19 17:22:09 2016 +0200 @@ -61,7 +61,8 @@ public: ImageBuffer(PixelFormat format, unsigned int width, - unsigned int height); + unsigned int height, + bool forceMinimalPitch); ImageBuffer() { @@ -108,8 +109,6 @@ return forceMinimalPitch_; } - void SetMinimalPitchForced(bool force); - void AcquireOwnership(ImageBuffer& other); }; } diff -r 09cb73980740 -r 88831c3edd8f OrthancServer/Internals/DicomImageDecoder.cpp --- a/OrthancServer/Internals/DicomImageDecoder.cpp Mon Oct 17 15:36:50 2016 +0200 +++ b/OrthancServer/Internals/DicomImageDecoder.cpp Wed Oct 19 17:22:09 2016 +0200 @@ -340,7 +340,7 @@ throw OrthancException(ErrorCode_NotImplemented); } - return new Image(format, info.GetWidth(), info.GetHeight()); + return new Image(format, info.GetWidth(), info.GetHeight(), false); } @@ -674,7 +674,7 @@ if (image->GetFormat() != format) { // A conversion is required - std::auto_ptr target(new Image(format, image->GetWidth(), image->GetHeight())); + std::auto_ptr target(new Image(format, image->GetWidth(), image->GetHeight(), false)); ImageProcessing::Convert(*target, *image); image = target; } @@ -713,7 +713,7 @@ // If the source image is not grayscale 8bpp, convert it if (image->GetFormat() != PixelFormat_Grayscale8) { - std::auto_ptr target(new Image(PixelFormat_Grayscale8, image->GetWidth(), image->GetHeight())); + std::auto_ptr target(new Image(PixelFormat_Grayscale8, image->GetWidth(), image->GetHeight(), false)); ImageProcessing::Convert(*target, *image); image = target; } diff -r 09cb73980740 -r 88831c3edd8f Plugins/Engine/OrthancPlugins.cpp --- a/Plugins/Engine/OrthancPlugins.cpp Mon Oct 17 15:36:50 2016 +0200 +++ b/Plugins/Engine/OrthancPlugins.cpp Wed Oct 19 17:22:09 2016 +0200 @@ -1646,7 +1646,7 @@ if (image->IsReadOnly()) { - std::auto_ptr copy(new Image(image->GetFormat(), image->GetWidth(), image->GetHeight())); + std::auto_ptr copy(new Image(image->GetFormat(), image->GetWidth(), image->GetHeight(), false)); ImageProcessing::Copy(*copy, *image); image.reset(NULL); return reinterpret_cast(copy.release()); @@ -1885,7 +1885,7 @@ const _OrthancPluginConvertPixelFormat& p = *reinterpret_cast(parameters); const ImageAccessor& source = *reinterpret_cast(p.source); - std::auto_ptr target(new Image(Plugins::Convert(p.targetFormat), source.GetWidth(), source.GetHeight())); + std::auto_ptr target(new Image(Plugins::Convert(p.targetFormat), source.GetWidth(), source.GetHeight(), false)); ImageProcessing::Convert(*target, source); *(p.target) = ReturnImage(target); @@ -2038,7 +2038,7 @@ switch (service) { case _OrthancPluginService_CreateImage: - result.reset(new Image(Plugins::Convert(p.format), p.width, p.height)); + result.reset(new Image(Plugins::Convert(p.format), p.width, p.height, false)); break; case _OrthancPluginService_CreateImageAccessor: diff -r 09cb73980740 -r 88831c3edd8f UnitTestsSources/FromDcmtkTests.cpp --- a/UnitTestsSources/FromDcmtkTests.cpp Mon Oct 17 15:36:50 2016 +0200 +++ b/UnitTestsSources/FromDcmtkTests.cpp Wed Oct 19 17:22:09 2016 +0200 @@ -818,7 +818,7 @@ { static const char* PATH = "UnitTestsResults/PatternGrayscale8.dcm"; - Orthanc::Image image(Orthanc::PixelFormat_Grayscale8, 256, 256); + Orthanc::Image image(Orthanc::PixelFormat_Grayscale8, 256, 256, false); for (int y = 0; y < 256; y++) { @@ -871,7 +871,7 @@ { static const char* PATH = "UnitTestsResults/PatternRGB24.dcm"; - Orthanc::Image image(Orthanc::PixelFormat_RGB24, 384, 256); + Orthanc::Image image(Orthanc::PixelFormat_RGB24, 384, 256, false); for (int y = 0; y < 256; y++) { @@ -933,7 +933,7 @@ { static const char* PATH = "UnitTestsResults/PatternGrayscale16.dcm"; - Orthanc::Image image(Orthanc::PixelFormat_Grayscale16, 256, 256); + Orthanc::Image image(Orthanc::PixelFormat_Grayscale16, 256, 256, false); uint16_t v = 0; for (int y = 0; y < 256; y++) @@ -987,7 +987,7 @@ { static const char* PATH = "UnitTestsResults/PatternSignedGrayscale16.dcm"; - Orthanc::Image image(Orthanc::PixelFormat_SignedGrayscale16, 256, 256); + Orthanc::Image image(Orthanc::PixelFormat_SignedGrayscale16, 256, 256, false); int16_t v = -32768; for (int y = 0; y < 256; y++) diff -r 09cb73980740 -r 88831c3edd8f UnitTestsSources/ImageTests.cpp --- a/UnitTestsSources/ImageTests.cpp Mon Oct 17 15:36:50 2016 +0200 +++ b/UnitTestsSources/ImageTests.cpp Wed Oct 19 17:22:09 2016 +0200 @@ -211,7 +211,7 @@ std::string s; { - Orthanc::Image img(Orthanc::PixelFormat_Grayscale8, 16, 16); + Orthanc::Image img(Orthanc::PixelFormat_Grayscale8, 16, 16, false); for (unsigned int y = 0, value = 0; y < img.GetHeight(); y++) { uint8_t* p = reinterpret_cast(img.GetRow(y)); @@ -258,7 +258,7 @@ TEST(Font, Basic) { - Orthanc::Image s(Orthanc::PixelFormat_RGB24, 640, 480); + Orthanc::Image s(Orthanc::PixelFormat_RGB24, 640, 480, false); memset(s.GetBuffer(), 0, s.GetPitch() * s.GetHeight()); ASSERT_GE(1u, Orthanc::Configuration::GetFontRegistry().GetSize());