Files
danbooru/app/logical/media_file/image.rb
evazion a6fac80e66 gems: drop ruby-imagespec gem.
* 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.
2020-05-06 01:21:35 -05:00

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