* Use libvips instead of ruby-imagespec for reading dimensions of jpeg, png, and gif files. * Copy the code for reading the dimensions of flash files from ruby-imagespec. Fixes an incompatibility between ruby-imagespec and the rubocop gem that prevented us from including rubocop in the Gemfile.
10 lines
148 B
Ruby
10 lines
148 B
Ruby
class MediaFile::Image < MediaFile
|
|
def dimensions
|
|
image.size
|
|
end
|
|
|
|
def image
|
|
@image ||= Vips::Image.new_from_file(file.path)
|
|
end
|
|
end
|