From: cristy Date: Wed, 18 Apr 2012 14:44:15 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5774 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a45d655fb5edad8381adf17645dcb4b540dcff2d;p=imagemagick --- diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index 5012905a0..11c95fd17 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -2802,46 +2802,11 @@ size_t Magick::Image::colorMapSize ( void ) // Image colorspace void Magick::Image::colorSpace( const ColorspaceType colorSpace_ ) { - // Nothing to do? - if ( image()->colorspace == colorSpace_ ) - return; - modifyImage(); ExceptionInfo exceptionInfo; GetExceptionInfo( &exceptionInfo ); - if ( colorSpace_ != RGBColorspace && - colorSpace_ != sRGBColorspace && - colorSpace_ != TransparentColorspace && - colorSpace_ != GRAYColorspace ) - { - if (image()->colorspace != RGBColorspace && - image()->colorspace != sRGBColorspace && - image()->colorspace != TransparentColorspace && - image()->colorspace != GRAYColorspace) - { - /* Transform to RGB colorspace as intermediate step */ - TransformRGBImage( image(), image()->colorspace, &exceptionInfo ); - throwImageException(); - } - /* Transform to final non-RGB colorspace */ - RGBTransformImage( image(), colorSpace_, &exceptionInfo ); - throwException( exceptionInfo ); - (void) DestroyExceptionInfo( &exceptionInfo ); - return; - } - - if ( colorSpace_ == RGBColorspace || - colorSpace_ == sRGBColorspace || - colorSpace_ == TransparentColorspace || - colorSpace_ == GRAYColorspace ) - { - /* Transform to a RGB-type colorspace */ - TransformRGBImage( image(), image()->colorspace, &exceptionInfo ); - throwException( exceptionInfo ); - (void) DestroyExceptionInfo( &exceptionInfo ); - return; - } + TransformImageColorspace(image(), colorSpace_, &exceptionInfo); throwException( exceptionInfo ); (void) DestroyExceptionInfo( &exceptionInfo ); } diff --git a/Magick++/lib/Magick++/Include.h b/Magick++/lib/Magick++/Include.h index 932154af2..a6b9a75cf 100644 --- a/Magick++/lib/Magick++/Include.h +++ b/Magick++/lib/Magick++/Include.h @@ -864,7 +864,6 @@ namespace Magick using MagickCore::ResourceLimitError; using MagickCore::ResourceLimitFatalError; using MagickCore::ResourceLimitWarning; - using MagickCore::RGBTransformImage; using MagickCore::RollImage; using MagickCore::RotateImage; using MagickCore::SampleImage; @@ -919,7 +918,7 @@ namespace Magick using MagickCore::TextureImage; using MagickCore::ThrowException; using MagickCore::TransformImage; - using MagickCore::TransformRGBImage; + using MagickCore::TransformImageColorspace; using MagickCore::TransparentPaintImage; using MagickCore::TransparentPaintImageChroma; using MagickCore::TrimImage;