]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 5 Feb 2013 18:44:04 +0000 (18:44 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 5 Feb 2013 18:44:04 +0000 (18:44 +0000)
MagickCore/version.c
coders/mpc.c
config/english.xml
config/francais.xml

index dc32a6c417219184122aa30d88c36551aa4db34e..712805838537b966a76bb3544ad3483e28e9fdce 100644 (file)
@@ -350,7 +350,35 @@ static unsigned int CRC32(const unsigned char *message,const size_t length)
 
 MagickExport unsigned int GetMagickSignature(const StringInfo *nonce)
 {
-  return(0);
+  register unsigned char
+    *p;
+
+  StringInfo
+    *version;
+
+  unsigned int
+    signature;
+
+  version=AcquireStringInfo(MaxTextExtent);
+  p=GetStringInfoDatum(version);
+  signature=MagickLibVersion;
+  (void) memcpy(p,&signature,sizeof(signature));
+  p+=sizeof(signature);
+  signature=MAGICKCORE_QUANTUM_DEPTH;
+  (void) memcpy(p,&signature,sizeof(signature));
+  p+=sizeof(signature);
+  signature=MAGICKCORE_HDRI_ENABLE;
+  (void) memcpy(p,&signature,sizeof(signature));
+  p+=sizeof(signature);
+  signature=1;  /* endianess */
+  (void) memcpy(p,&signature,sizeof(signature));
+  p+=sizeof(signature);
+  SetStringInfoLength(version,p-GetStringInfoDatum(version));
+  if (nonce != (const StringInfo *) NULL)
+    ConcatenateStringInfo(version,nonce);
+  signature=CRC32(GetStringInfoDatum(version),GetStringInfoLength(version));
+  version=DestroyStringInfo(version);
+  return(signature);
 }
 \f
 /*
index 88ffa2d8f603bc902964c6f7955e06680a9b2c4a..0f0c0d22d30ee1503eb15ea113941bde62eaf2f9 100644 (file)
@@ -177,8 +177,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
 
   size_t
     depth,
-    length,
-    quantum_depth;
+    length;
 
   ssize_t
     count;
@@ -186,6 +185,9 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
   StringInfo
     *profile;
 
+  unsigned int
+    signature;
+
   /*
     Open image file.
   */
@@ -222,7 +224,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
     profiles=(LinkedListInfo *) NULL;
     length=MaxTextExtent;
     options=AcquireString((char *) NULL);
-    quantum_depth=MAGICKCORE_QUANTUM_DEPTH;
+    signature=GetMagickSignature((const StringInfo *) NULL);
     image->depth=8;
     image->compression=NoCompression;
     while ((isgraph(c) != MagickFalse) && (c != (int) ':'))
@@ -605,11 +607,6 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
                     image->quality=StringToUnsignedLong(options);
                     break;
                   }
-                if (LocaleCompare(keyword,"quantum-depth") == 0)
-                  {
-                    quantum_depth=StringToUnsignedLong(options);
-                    break;
-                  }
                 (void) SetImageProperty(image,keyword,options,exception);
                 break;
               }
@@ -661,6 +658,11 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
                     image->scene=StringToUnsignedLong(options);
                     break;
                   }
+                if (LocaleCompare(keyword,"signature") == 0)
+                  {
+                    signature=(unsigned int) StringToUnsignedLong(options);
+                    break;
+                  }
                 (void) SetImageProperty(image,keyword,options,exception);
                 break;
               }
@@ -752,8 +754,8 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
         (image->compression == UndefinedCompression) || (image->columns == 0) ||
         (image->rows == 0))
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
-    if (quantum_depth != MAGICKCORE_QUANTUM_DEPTH)
-      ThrowReaderException(CacheError,"InconsistentPersistentCacheDepth");
+    if (signature != GetMagickSignature((const StringInfo *) NULL))
+      ThrowReaderException(CacheError,"IncompatibleAPI");
     if (image->montage != (char *) NULL)
       {
         register char
@@ -1091,8 +1093,8 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image,
         (image->colors > (one << depth)))
       image->storage_class=DirectClass;
     (void) WriteBlobString(image,"id=MagickCache\n");
-    (void) FormatLocaleString(buffer,MaxTextExtent,"quantum-depth=%d\n",
-      MAGICKCORE_QUANTUM_DEPTH);
+    (void) FormatLocaleString(buffer,MaxTextExtent,"signature=%u\n",
+      GetMagickSignature((const StringInfo *) NULL));
     (void) WriteBlobString(image,buffer);
     (void) FormatLocaleString(buffer,MaxTextExtent,
       "class=%s  colors=%.20g  alpha-trait=%s\n",CommandOptionToMnemonic(
index 52c1fd2ff5cb7b4cc355d4e73dd32bcd39104a6e..2a0532f810a97f9a09e762e66044de949d694244 100644 (file)
@@ -38,8 +38,8 @@
         <message name="CacheResourcesExhausted">
           cache resources exhausted
         </message>
-        <message name="InconsistentPersistentCacheDepth">
-          inconsistent persistent cache depth
+        <message name="IncompatibleAPI">
+          incompatible API
         </message>
         <message name="NoPixelsDefinedInCache">
           no pixels defined in cache
index 465f9a65cffe2a5a2fa3212381eb9404dbc5f447..ffdb388fc106f91f8c73802c3fb2ad5c46115e5c 100644 (file)
@@ -38,8 +38,8 @@
         <message name="CacheResourcesExhausted">
           Ressources du cache épuisées
         </message>
-        <message name="InconsistentPersistentCacheDepth">
-          profondeur du cache persistant inconsistante
+        <message name="IncompatibleAPI">
+          incompatible API
         </message>
         <message name="NoPixelsDefinedInCache">
           pas de pixels définis dans le cache