Method: MiniExiftool#initialize
- Defined in:
- lib/mini_exiftool.rb
#initialize(filename_or_io = nil, opts = {}) ⇒ MiniExiftool
filename_or_io The kind of the parameter is determined via duck typing: if the argument responds to to_str it is interpreted as filename, if it responds to read it is interpreted es IO instance.
ATTENTION: If using an IO instance writing of meta data is not supported!
opts support at the moment
-
:numericalfor numerical values, default isfalse -
:compositefor including composite tags while loading, default istrue -
:ignore_minor_errorsignore minor errors (See -m-option of the exiftool command-line application, default isfalse) -
:coord_formatset format for GPS coordinates (See -c-option of the exiftool command-line application, default isnilthat means exiftool standard) -
:fastuseful when reading JPEGs over a slow network connection (See -fast-option of the exiftool command-line application, default isfalse) -
:fast2useful when reading JPEGs over a slow network connection (See -fast2-option of the exiftool command-line application, default isfalse) -
:replace_invalid_charsreplace string for invalid UTF-8 characters orfalseif no replacing should be done, default isfalse -
:timestampsgenerating DateTime objects instead of Time objects if set toDateTime, default isTimeATTENTION: Time objects are created using
Time.localtherefore they use your local timezone, DateTime objects instead are created without timezone! -
:exif_encoding,:iptc_encoding,:xmp_encoding,:png_encoding,:id3_encoding,:pdf_encoding,:photoshop_encoding,:quicktime_encoding,:aiff_encoding,:mie_encoding,:vorbis_encodingto set this specific encoding (see -charset option of the exiftool command-line application, default isnil: no encoding specified)
107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/mini_exiftool.rb', line 107 def initialize filename_or_io=nil, opts={} @opts = @@opts.merge opts if @opts[:convert_encoding] warn 'Option :convert_encoding is not longer supported!' warn 'Please use the String#encod* methods.' end @filename = nil @io = nil @values = TagHash.new @changed_values = TagHash.new @errors = TagHash.new load filename_or_io unless filename_or_io.nil? end |