Class: EmbedXMP::WebP
Overview
WebP images
Constant Summary collapse
- WEBP_HEAD =
'WEBP'
- VP8X_HEAD =
'VP8X'
- VP8F_HEAD =
'VP8 '
- VP8L_HEAD =
'VP8L'
- XMPS_HEAD =
'XMP '
- VP8X_XMP_FLAG =
0b00000100
Constants inherited from RIFF
Instance Method Summary collapse
- #file_header ⇒ Object
-
#join_sidecar(sidecar_file, xpacked: false) ⇒ Object
Join an XMP sidecar into the image file.
Methods inherited from RIFF
#chunk, #new_chunk, #remove_chunk, #replace_chunk, #update_file_length_header
Methods inherited from ImageFile
#initialize, #insert_into_file, #read_io_or_string, #write
Constructor Details
This class inherits a constructor from EmbedXMP::ImageFile
Instance Method Details
#file_header ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/embed_xmp/webp.rb', line 27 def file_header riff_id, file_length, form_type = super raise 'NoWEBPHeader' if WEBP_HEAD != form_type [riff_id, file_length, form_type] end |
#join_sidecar(sidecar_file, xpacked: false) ⇒ Object
Join an XMP sidecar into the image file.
20 21 22 23 24 25 |
# File 'lib/embed_xmp/webp.rb', line 20 def join_sidecar(sidecar_file, xpacked: false) remove_xmp xmp_data = read_io_or_string(sidecar_file) upsert_xmp_chunk(create_xmp_chunk(xmp_data, xpacked)) end |