|
@@ -3,6 +3,7 @@ require 'vips'
|
|
|
module Fotos
|
|
module Fotos
|
|
|
class Asset
|
|
class Asset
|
|
|
THUMBNAIL_PREFIX = "TH_"
|
|
THUMBNAIL_PREFIX = "TH_"
|
|
|
|
|
+ WEB_TYPES = ['.JPEG', '.JPG', '.GIF']
|
|
|
SUPPORTED_TYPES = ['.JPEG', '.JPG', '.HEIC']
|
|
SUPPORTED_TYPES = ['.JPEG', '.JPG', '.HEIC']
|
|
|
|
|
|
|
|
def initialize(file_path)
|
|
def initialize(file_path)
|
|
@@ -43,6 +44,10 @@ module Fotos
|
|
|
file_name.match?(THUMBNAIL_PREFIX)
|
|
file_name.match?(THUMBNAIL_PREFIX)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
+ def web_supported?
|
|
|
|
|
+ WEB_TYPES.include?(ext_name.upcase)
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
def image
|
|
def image
|
|
|
@image ||= Vips::Image.new_from_file(@file_path)
|
|
@image ||= Vips::Image.new_from_file(@file_path)
|
|
|
end
|
|
end
|