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:
evazion
2020-05-24 12:06:34 -05:00
parent cf88411dce
commit 3e2949d157

View File

@@ -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?