Sha256: db9cefcdf1d461ad9fcc7af73061f0753406667f65f4baa81a23822c043d2a11
Contents?: true
Size: 865 Bytes
Versions: 11
Compression:
Stored size: 865 Bytes
Contents
require 'parsers/iso_base_media_file_format/decoder' class FormatParser::CR3Parser::Decoder < FormatParser::ISOBaseMediaFileFormat::Decoder include FormatParser::EXIFParser protected BOX_PARSERS = BOX_PARSERS.merge({ 'CMT1' => :cmt1 }) CANON_METADATA_CONTAINER_UUID = '85c0b687820f11e08111f4ce462b6a48' def cmt1(size) exif = exif_from_tiff_io(StringIO.new(read_bytes(size))) if exif fields = exif.to_hash fields[:rotated] = exif.rotated? fields[:orientation_sym] = exif.orientation_sym [fields, nil] else [nil, nil] end end def uuid(size) usertype = read_bytes(16).unpack('H*').first fields = { usertype: usertype } children = if usertype == CANON_METADATA_CONTAINER_UUID build_box_tree(size - 16) else skip_bytes(size - 16) end [fields, children] end end
Version data entries
11 entries across 11 versions & 1 rubygems