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.
This commit is contained in:
evazion
2020-05-06 00:58:11 -05:00
parent e477232e02
commit a6fac80e66
4 changed files with 58 additions and 15 deletions

View File

@@ -1,6 +1,9 @@
class MediaFile::Image < MediaFile
def dimensions
image_size = ImageSpec.new(file.path)
[image_size.width, image_size.height]
image.size
end
def image
@image ||= Vips::Image.new_from_file(file.path)
end
end