-(defconst image-animated-types '(gif)
- "List of supported animated image types.")
-
-(defun image-animated-p (image)
- "Return non-nil if IMAGE can be animated.
-To be capable of being animated, an image must be of a type
-listed in `image-animated-types', and contain more than one
-sub-image, with a specified animation delay. The actual return
-value is a cons (NIMAGES . DELAY), where NIMAGES is the number
-of sub-images in the animated image and DELAY is the delay in
-seconds until the next sub-image should be displayed."
- (cond
- ((memq (plist-get (cdr image) :type) image-animated-types)
- (let* ((metadata (image-metadata image))
- (images (plist-get metadata 'count))
- (delay (plist-get metadata 'delay)))
- (when (and images (> images 1) (numberp delay))
- (if (< delay 0) (setq delay 0.1))
- (cons images delay))))))
+(defvar image-default-frame-delay 0.1
+ "Default interval in seconds between frames of a multi-frame image.
+Only used if the image does not specify a value.")
+
+(defun image-multi-frame-p (image)
+ "Return non-nil if IMAGE contains more than one frame.
+The actual return value is a cons (NIMAGES . DELAY), where NIMAGES is
+the number of frames (or sub-images) in the image and DELAY is the delay
+in seconds that the image specifies between each frame. DELAY may be nil,
+in which case you might want to use `image-default-frame-delay'."
+ (let* ((metadata (image-metadata image))
+ (images (plist-get metadata 'count))
+ (delay (plist-get metadata 'delay)))
+ (when (and images (> images 1))
+ (if (or (not (numberp delay)) (< delay 0))
+ (setq delay image-default-frame-delay))
+ (cons images delay))))
+
+(define-obsolete-function-alias 'image-animated-p 'image-multi-frame-p "24.4")