class FormatParser::EXIFParser::EXIFResult
Public Instance Methods
orientation()
click to toggle source
# File lib/parsers/exif_parser.rb, line 54 def orientation # In some EXIF tags the value type is set oddly - it unpacks into multiple values, # and it will look like this: [#<EXIFR::TIFF::Orientation:TopLeft(1)>, nil] orientation_values = Array(__getobj__.orientation) last_usable_value = orientation_values.compact[-1] # Use the last non-nil one last_usable_value.to_i end
orientation_sym()
click to toggle source
# File lib/parsers/exif_parser.rb, line 62 def orientation_sym ORIENTATIONS.fetch(orientation) end
rotated?()
click to toggle source
# File lib/parsers/exif_parser.rb, line 44 def rotated? orientation.to_i > 4 end
to_json(*maybe_coder)
click to toggle source
# File lib/parsers/exif_parser.rb, line 48 def to_json(*maybe_coder) hash_representation = __getobj__.to_hash sanitized = FormatParser::AttributesJSON._sanitize_json_value(hash_representation) sanitized.to_json(*maybe_coder) end