Index: /ImageMagick/trunk/coders/jpeg.c
===================================================================
--- /ImageMagick/trunk/coders/jpeg.c	(revision 7023)
+++ /ImageMagick/trunk/coders/jpeg.c	(revision 7024)
@@ -160,6 +160,8 @@
     height;
 
+  double
+    divisor;
+
   unsigned int
-    divisor,
     *levels;
 } QuantizationTable;
@@ -1716,6 +1718,6 @@
       return(table);
     }
-  table->divisor=(unsigned int) StringToLong(attribute);
-  if (table->divisor < 1)
+  table->divisor=InterpretLocaleValue(attribute,(char **) NULL);
+  if (table->divisor == 0.0)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
@@ -1746,7 +1748,6 @@
   for (i=0; i < (ssize_t) (table->width*table->height); i++)
   {
-    table->levels[i]=(unsigned int) (InterpretLocaleValue(content,&p)+0.5);
-    if (table->divisor != 1)
-      table->levels[i]/=table->divisor;
+    table->levels[i]=(unsigned int) (InterpretLocaleValue(content,&p)/
+      table->divisor+0.5);
     while (isspace((int) ((unsigned char) *p)) != 0)
       p++;
@@ -1755,7 +1756,5 @@
     content=p;
   }
-  for (j=i; i < 64; i++)
-    table->levels[j]=table->levels[j-1];
-  value=(double) strtol(content,&p,10);
+  value=InterpretLocaleValue(content,&p);
   (void) value;
   if (p != content)
@@ -1768,4 +1767,6 @@
      return(table);
    }
+  for (j=i; j < 64; j++)
+    table->levels[j]=table->levels[j-1];
   quantization_tables=DestroyXMLTree(quantization_tables);
   xml=DestroyString(xml);
