Add call to new API. ImageIO deprecated some older (although
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Dec 2004 01:15:38 +0000 (01:15 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Dec 2004 01:15:38 +0000 (01:15 +0000)
quite new!) API.   This caused us to fail to build on 337 or later.

Developers wanting to build on older versions of Tiger must define
USE_DEPRECATED_IMAGESOURCE_API in WebImageData.m.

        Reviewed by Vicki.

        * WebCoreSupport.subproj/WebImageData.m:
        (-[WebImageData propertiesAtIndex:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8263 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebImageData.m

index 0b8ccfd320d4b19d0d74129a5a02465e5a86ebad..b80d48ab59834335e190feb5fa8a36f4dd603341 100644 (file)
@@ -1,3 +1,16 @@
+2004-12-20  Richard Williamson   <rjw@apple.com>
+
+       Add call to new API.  ImageIO deprecated some older (although
+       quite new!) API.   This caused us to fail to build on 337 or later.
+
+       Developers wanting to build on older versions of Tiger must define
+       USE_DEPRECATED_IMAGESOURCE_API in WebImageData.m.
+
+        Reviewed by Vicki.
+
+        * WebCoreSupport.subproj/WebImageData.m:
+        (-[WebImageData propertiesAtIndex:]):
+
 2004-12-20  Richard Williamson   <rjw@apple.com>
 
        Don't call Tiger SPI on Panther.
index b506fb82a5d937d5eec5aed5cac855f8f529b129..9b36fb9446ec8fa8df8488e7a428e6b8aca0849c 100644 (file)
 
 #ifdef USE_CGIMAGEREF
 
-// The following prototype is declared here temporarily.  It has been deprecated (even though it's new!).
-// Once the new API makes it into a stable build, and the group have upgraded, I will remove and
-// convert to the new API.  The new API is:
-// CG_EXTERN CFDictionaryRef CGImageSourceCopyPropertiesAtIndex(CGImageSourceRef isrc, size_t index, CFDictionaryRef options);
-CG_EXTERN CFDictionaryRef CGImageSourceGetPropertiesAtIndex(CGImageSourceRef isrc, size_t index, CFDictionaryRef options);
-
 static CFDictionaryRef imageSourceOptions;
 
 // Forward declarations of internal methods.
@@ -217,9 +211,13 @@ static CFDictionaryRef imageSourceOptions;
         imageProperties = (CFDictionaryRef *)malloc (num * sizeof(CFDictionaryRef));
         size_t i;
         for (i = 0; i < num; i++) {
+#if USE_DEPRECATED_IMAGESOURCE_API     
             imageProperties[i] = CGImageSourceGetPropertiesAtIndex (imageSource, i, 0);
             if (imageProperties[i])
                 CFRetain (imageProperties[i]);
+#else
+            imageProperties[i] = CGImageSourceCopyPropertiesAtIndex (imageSource, i, 0);
+#endif
         }
         imagePropertiesSize = num;
     }
@@ -228,9 +226,13 @@ static CFDictionaryRef imageSourceOptions;
         // If image properties are nil, try to get them again.  May have attempted to
         // get them before enough data was available in the header.
         if (imageProperties[index] == 0) {
+#if USE_DEPRECATED_IMAGESOURCE_API     
             imageProperties[index] = CGImageSourceGetPropertiesAtIndex (imageSource, index, 0);
             if (imageProperties[index])
                 CFRetain (imageProperties[index]);
+#else
+            imageProperties[index] = CGImageSourceCopyPropertiesAtIndex (imageSource, index, 0);
+#endif
         }
         
         return imageProperties[index];