]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 13 Aug 2010 01:25:47 +0000 (01:25 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 13 Aug 2010 01:25:47 +0000 (01:25 +0000)
ChangeLog
magick/fx.c

index 80cbfefca5e59a3126493ac9ea63fb11c6c3da38..53dfb9fa0f5ebe2579de2c374539f82219722d8b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-12  6.6.3-5 Cristy  <quetzlzacatenango@image...>
+  * The -fx 2e+6/1e+5 argument no longer returns the wrong results (reference
+    http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=16833).
+
 2010-08-10  6.6.3-5 Glenn Randers-Pehrson <glennrp@image...>
   * Emit a warning if the PNG encoder can't satisfy the color type and
     bit depth requested with a "-define" directive.
index a4b417df30583760f454187bd8f5f2c61d702a10..fcf4a1f8e0a20eb397e0825b997b8f885aab4ca5 100644 (file)
@@ -98,6 +98,7 @@
 #define NotEqualOperator 0xfa
 #define LogicalAndOperator 0xfb
 #define LogicalOrOperator 0xfc
+#define ExponentialNotation 0xfd
 
 struct _FxInfo
 {
@@ -190,29 +191,28 @@ MagickExport FxInfo *AcquireFxInfo(const Image *image,const char *expression)
       (strstr(fx_info->expression,"e-") != (char *) NULL))
     {
       /*
-        Convert scientific notation.  '*' and '/' have the same precedence so
-        2e+6/1e+5 fails, instead use '@' to ensure proper results.
+        Convert scientific notation.
       */
-      (void) SubstituteString(&fx_info->expression,"0e+","0@10^");
-      (void) SubstituteString(&fx_info->expression,"1e+","1@10^");
-      (void) SubstituteString(&fx_info->expression,"2e+","2@10^");
-      (void) SubstituteString(&fx_info->expression,"3e+","3@10^");
-      (void) SubstituteString(&fx_info->expression,"4e+","4@10^");
-      (void) SubstituteString(&fx_info->expression,"5e+","5@10^");
-      (void) SubstituteString(&fx_info->expression,"6e+","6@10^");
-      (void) SubstituteString(&fx_info->expression,"7e+","7@10^");
-      (void) SubstituteString(&fx_info->expression,"8e+","8@10^");
-      (void) SubstituteString(&fx_info->expression,"9e+","9@10^");
-      (void) SubstituteString(&fx_info->expression,"0e-","0@10^-");
-      (void) SubstituteString(&fx_info->expression,"1e-","1@10^-");
-      (void) SubstituteString(&fx_info->expression,"2e-","2@10^-");
-      (void) SubstituteString(&fx_info->expression,"3e-","3@10^-");
-      (void) SubstituteString(&fx_info->expression,"4e-","4@10^-");
-      (void) SubstituteString(&fx_info->expression,"5e-","5@10^-");
-      (void) SubstituteString(&fx_info->expression,"6e-","6@10^-");
-      (void) SubstituteString(&fx_info->expression,"7e-","7@10^-");
-      (void) SubstituteString(&fx_info->expression,"8e-","8@10^-");
-      (void) SubstituteString(&fx_info->expression,"9e-","9@10^-");
+      (void) SubstituteString(&fx_info->expression,"0e+","0**10^");
+      (void) SubstituteString(&fx_info->expression,"1e+","1**10^");
+      (void) SubstituteString(&fx_info->expression,"2e+","2**10^");
+      (void) SubstituteString(&fx_info->expression,"3e+","3**10^");
+      (void) SubstituteString(&fx_info->expression,"4e+","4**10^");
+      (void) SubstituteString(&fx_info->expression,"5e+","5**10^");
+      (void) SubstituteString(&fx_info->expression,"6e+","6**10^");
+      (void) SubstituteString(&fx_info->expression,"7e+","7**10^");
+      (void) SubstituteString(&fx_info->expression,"8e+","8**10^");
+      (void) SubstituteString(&fx_info->expression,"9e+","9**10^");
+      (void) SubstituteString(&fx_info->expression,"0e-","0**10^-");
+      (void) SubstituteString(&fx_info->expression,"1e-","1**10^-");
+      (void) SubstituteString(&fx_info->expression,"2e-","2**10^-");
+      (void) SubstituteString(&fx_info->expression,"3e-","3**10^-");
+      (void) SubstituteString(&fx_info->expression,"4e-","4**10^-");
+      (void) SubstituteString(&fx_info->expression,"5e-","5**10^-");
+      (void) SubstituteString(&fx_info->expression,"6e-","6**10^-");
+      (void) SubstituteString(&fx_info->expression,"7e-","7**10^-");
+      (void) SubstituteString(&fx_info->expression,"8e-","8**10^-");
+      (void) SubstituteString(&fx_info->expression,"9e-","9**10^-");
     }
   /*
     Convert complex to simple operators.
@@ -234,6 +234,8 @@ MagickExport FxInfo *AcquireFxInfo(const Image *image,const char *expression)
   (void) SubstituteString(&fx_info->expression,"&&",fx_op);
   *fx_op=(char) LogicalOrOperator;
   (void) SubstituteString(&fx_info->expression,"||",fx_op);
+  *fx_op=(char) ExponentialNotation;
+  (void) SubstituteString(&fx_info->expression,"**",fx_op);
   return(fx_info);
 }
 \f
@@ -1852,6 +1854,7 @@ static const char *FxOperatorPrecedence(const char *expression,
     NullPrecedence,
     BitwiseComplementPrecedence,
     ExponentPrecedence,
+    ExponentialNotationPrecedence,
     MultiplyPrecedence,
     AdditionPrecedence,
     ShiftPrecedence,
@@ -2011,6 +2014,11 @@ static const char *FxOperatorPrecedence(const char *expression,
           precedence=LogicalOrPrecedence;
           break;
         }
+        case ExponentialNotation:
+        {
+          precedence=ExponentialNotationPrecedence;
+          break;
+        }
         case ':':
         case '?':
         {
@@ -2116,7 +2124,7 @@ static MagickRealType FxEvaluateSubexpression(FxInfo *fx_info,
           return(*beta);
         }
         case '*':
-        case '@':
+        case ExponentialNotation:
         {
           *beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,beta,exception);
           return(alpha*(*beta));