]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 27 May 2013 14:13:40 +0000 (14:13 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 27 May 2013 14:13:40 +0000 (14:13 +0000)
MagickCore/channel.c
coders/matte.c
config/english.xml
config/francais.xml

index 57b5b36f1099146ae484bd7d4efaaa4c3aa9610d..61c1f0e92e4238ca8f5f889c75f7fb263beb7ba9 100644 (file)
@@ -354,6 +354,33 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
         break;
       }
       case ExchangeChannelOp:
+      {
+        PixelChannelMap
+          channel_map;
+
+        i=ParsePixelChannelOption(token);
+        if (i < 0)
+          {
+            (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
+              "UnrecognizedChannelType","`%s'",token);
+            destination_image=DestroyImageList(destination_image);
+            return(destination_image);
+          }
+        destination_channel=(PixelChannel) i;
+        if ((source_channel >= GetPixelChannels(image)) ||
+            (destination_channel >= GetPixelChannels(image)))
+          {
+            (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
+              "NoSuchImageChannel","`%s'",token);
+            destination_image=DestroyImageList(destination_image);
+            return(destination_image);
+          }
+         channel_map=destination_image->channel_map[destination_channel];
+         destination_image->channel_map[destination_channel]=
+           destination_image->channel_map[source_channel];
+         destination_image->channel_map[source_channel]=channel_map;
+         break;
+      }
       case TransferChannelOp:
       {
         i=ParsePixelChannelOption(token);
index b0ee884c8d7aa4ec6850b65117a9b54eb58f12a9..de773351b39e3688bb396eecdaba320714c488eb 100644 (file)
@@ -176,7 +176,7 @@ static MagickBooleanType WriteMATTEImage(const ImageInfo *image_info,
     y;
 
   if (image->alpha_trait != BlendPixelTrait)
-    ThrowWriterException(CoderError,"ImageDoesNotHaveAAlphaChannel");
+    ThrowWriterException(CoderError,"ImageDoesNotHaveAnAlphaChannel");
   matte_image=CloneImage(image,image->columns,image->rows,MagickTrue,exception);
   if (matte_image == (Image *) NULL)
     return(MagickFalse);
index 302bd0ae014ac2a9a8c63659da18e01a26d2fe5e..2e60ea279bda089644f00ab3523a4bc6db54154b 100644 (file)
         <message name="ImageDoesNotHaveAClipMask">
           image does not have a clip mask
         </message>
-        <message name="ImageDoesNotHaveAAlphaChannel">
-          image does not have a alpha channel
+        <message name="ImageDoesNotHaveAnAlphaChannel">
+          image does not have an alpha channel
         </message>
         <message name="ImageDoesNotHaveAThumbnail">
           image does not have a EXIF thumbnail
         <message name="NoSuchImage">
           no such image
         </message>
+        <message name="NoSuchImageChannel">
+          no such image channel
+        </message>
         <message name="NoSuchOption">
           no such option
         </message>
index 6e2e9447ed53d2779328b7b3df5bc614d9ca0fcf..9b5c83172109e2f408f80278f8e13d179a73672d 100644 (file)
         <message name="ImageDoesNotHaveAThumbnail">
           image sans vignette EXIF
         </message>
-        <message name="ImageDoesNotHaveAAlphaChannel">
+        <message name="ImageDoesNotHaveAnAlphaChannel">
           l'image n'a pas de canal de transparence
         </message>
         <message name="ImageIsNotTiled">
         <message name="NoSuchImage">
           image inconnue
         </message>
+        <message name="NoSuchImageChannel">
+          image channel inconnue
+        </message>
         <message name="NoSuchOption">
           option inconnue
         </message>