Class: FilterRename::ImageFilename

Inherits:
Filename
  • Object
show all
Defined in:
lib/filter_rename/filetype/image_filename.rb

Instance Attribute Summary

Attributes inherited from Filename

#original

Instance Method Summary collapse

Methods inherited from Filename

#!=, #==, #calculate_hash, #custom?, #diff, #exists?, #filename, #full_filename, #full_path, #get_string, #has_target?, has_writable_tags, #pretty_size, #rename!, #set_string, #targets, #values, #writable?

Constructor Details

#initialize(fname, cfg) ⇒ ImageFilename

Returns a new instance of ImageFilename.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/filter_rename/filetype/image_filename.rb', line 8

def initialize(fname, cfg)
  super fname, cfg

  image = FastImage.new(fname)
  @width = image.size[0].to_s
  @height = image.size[1].to_s

  [@width, @height].map(&:readonly!)

  if cfg.
    image = Exiv2::ImageFactory.open(fname)
    image.

    image.exif_data.each do |key, value|
      (key, value, true)
    end unless image.exif_data.nil?
  end
end