If animated images had no loop count property we were incorrectly
looping forver. Note, that in the course of fixing this bug
I found that ImageIO is incorrectly NOT reporting the loop count
for a whole class of animated GIFs.
Reviewed by Ken Kocienda.
* WebCoreSupport.subproj/WebImageData.m:
(-[WebImageData _repetitionCount]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8587
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-02-11 Richard Williamson <rjw@apple.com>
+
+ Fixed <rdar://problem/4002505> 8A378: Endlessly animating gif's on http://www.entropy.ch
+
+ If animated images had no loop count property we were incorrectly
+ looping forver. Note, that in the course of fixing this bug
+ I found that ImageIO is incorrectly NOT reporting the loop count
+ for a whole class of animated GIFs.
+
+ Reviewed by Ken Kocienda.
+
+ * WebCoreSupport.subproj/WebImageData.m:
+ (-[WebImageData _repetitionCount]):
+
=== Safari-186 ===
2005-02-11 Vicki Murley <vicki@apple.com>
return value;
}
-- (float)_floatFileProperty:(CFStringRef)property type:(CFStringRef)type
+- (float)_floatFileProperty:(CFStringRef)property type:(CFStringRef)type hasProperty:(BOOL *)hasProperty;
{
[decodeLock lock];
+ *hasProperty = NO;
+
CFDictionaryRef properties = [self fileProperties];
if (!properties) {
[decodeLock unlock];
CFNumberGetValue (num, kCFNumberFloat32Type, &value);
[decodeLock unlock];
+
+ *hasProperty = YES;
return value;
}
- (int)_repetitionCount
{
- return [self _floatFileProperty:kCGImagePropertyGIFLoopCount type:kCGImagePropertyGIFDictionary];
+ int count;
+ BOOL hasProperty;
+
+ // No property means loop once.
+ // A property with value 0 means loops forever.
+ count = [self _floatFileProperty:kCGImagePropertyGIFLoopCount type:kCGImagePropertyGIFDictionary hasProperty:&hasProperty];
+ if (!hasProperty)
+ count = -1;
+
+ return count;
}
- (BOOL)isAnimationFinished