Class: Itools::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/itools/find_unuse_img.rb

Overview


Class Method Summary collapse

Class Method Details

.get_image_name(file) ⇒ Object



121
122
123
# File 'lib/itools/find_unuse_img.rb', line 121

def self.get_image_name(file)
   return file.gsub(/@2x|@3x/,"")
end

.is_image_format(temp_ext_name) ⇒ Object

是否是图片格式,这里只判断了jpg、png和gif



114
115
116
117
118
119
120
# File 'lib/itools/find_unuse_img.rb', line 114

def self.is_image_format(temp_ext_name)
   if ['.jpg','.png','.gif'].include?(temp_ext_name)
      return true
   else
      return false
   end
end