uploads: fix exception when uploading gifs.
Older versions of libvips don't support get("n-pages"). This is known to
fail in libvips-8.4 and known to work in libvips-8.8.
This commit is contained in:
@@ -53,6 +53,9 @@ class MediaFile::Image < MediaFile
|
||||
|
||||
def is_animated_gif?
|
||||
file_ext == :gif && image.get("n-pages") > 1
|
||||
# older versions of libvips that don't support n-pages will raise an error
|
||||
rescue Vips::Error
|
||||
false
|
||||
end
|
||||
|
||||
def is_animated_png?
|
||||
|
||||
Reference in New Issue
Block a user