uploads: factor out remaining image methods to MediaFile.

This commit is contained in:
evazion
2020-05-19 02:18:30 -05:00
parent 45064853de
commit 364343453c
7 changed files with 56 additions and 88 deletions

View File

@@ -89,6 +89,22 @@ class MediaFile
file_ext == :swf
end
def is_corrupt?
false
end
def is_animated?
is_video?
end
def has_audio?
false
end
def duration
0.0
end
def preview(width, height, **options)
nil
end
@@ -97,5 +113,5 @@ class MediaFile
nil
end
memoize :dimensions, :file_ext, :file_size, :md5
memoize :dimensions, :file_ext, :file_size, :md5, :is_corrupt?, :is_animated?
end