Mercurial > hg > orthanc
changeset 1605:fd0464ce1962
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 01 Sep 2015 16:41:16 +0200 |
parents | 1f5d6a2f9638 |
children | 31f4adefb88f |
files | Core/ImageFormats/ImageAccessor.h Core/ImageFormats/JpegReader.cpp Core/ImageFormats/JpegReader.h Plugins/Engine/OrthancPlugins.cpp Plugins/Include/orthanc/OrthancCPlugin.h |
diffstat | 5 files changed, 14 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/Core/ImageFormats/ImageAccessor.h Tue Sep 01 14:57:13 2015 +0200 +++ b/Core/ImageFormats/ImageAccessor.h Tue Sep 01 16:41:16 2015 +0200 @@ -54,6 +54,10 @@ AssignEmpty(PixelFormat_Grayscale8); } + virtual ~ImageAccessor() + { + } + bool IsReadOnly() const { return readOnly_;
--- a/Core/ImageFormats/JpegReader.cpp Tue Sep 01 14:57:13 2015 +0200 +++ b/Core/ImageFormats/JpegReader.cpp Tue Sep 01 16:41:16 2015 +0200 @@ -39,11 +39,6 @@ namespace Orthanc { - JpegReader::JpegReader() - { - } - - static void Uncompress(struct jpeg_decompress_struct& cinfo, std::string& content, ImageAccessor& accessor)
--- a/Core/ImageFormats/JpegReader.h Tue Sep 01 14:57:13 2015 +0200 +++ b/Core/ImageFormats/JpegReader.h Tue Sep 01 16:41:16 2015 +0200 @@ -44,8 +44,6 @@ std::string content_; public: - JpegReader(); - void ReadFromFile(const char* filename); void ReadFromFile(const std::string& filename)
--- a/Plugins/Engine/OrthancPlugins.cpp Tue Sep 01 14:57:13 2015 +0200 +++ b/Plugins/Engine/OrthancPlugins.cpp Tue Sep 01 16:41:16 2015 +0200 @@ -1466,8 +1466,8 @@ case _OrthancPluginService_FreeImage: { - const _OrthancPluginGetImageInfo& p = *reinterpret_cast<const _OrthancPluginGetImageInfo*>(parameters); - delete reinterpret_cast<const ImageAccessor*>(p.image); + const _OrthancPluginFreeImage& p = *reinterpret_cast<const _OrthancPluginFreeImage*>(parameters); + delete reinterpret_cast<ImageAccessor*>(p.image); return true; }
--- a/Plugins/Include/orthanc/OrthancCPlugin.h Tue Sep 01 14:57:13 2015 +0200 +++ b/Plugins/Include/orthanc/OrthancCPlugin.h Tue Sep 01 16:41:16 2015 +0200 @@ -2923,6 +2923,13 @@ } + + + typedef struct + { + OrthancPluginImage* image; + } _OrthancPluginFreeImage; + /** * @brief Free an image. * @@ -2936,8 +2943,7 @@ OrthancPluginContext* context, OrthancPluginImage* image) { - _OrthancPluginGetImageInfo params; - memset(¶ms, 0, sizeof(params)); + _OrthancPluginFreeImage params; params.image = image; context->InvokeService(context, _OrthancPluginService_FreeImage, ¶ms);