Skip to content

Move structured way to extract a field from image #413

Open
@bogdan

Description

@bogdan

Reading image metadata is inconvenient because the return format looks like a result of inspect call:

image = Vips::Image.new_from_file('file.png')
image.get "exif-ifd3-GPSTimeStamp"
    # => "13/1 57/1 0/1 (13:57:00.00, Rational, 3 components, 24 bytes)"
image.get "width" # => 3024
image.get "exif-ifd3-UserComment" 
  # => "Hello (world) (Hello (world), ASCII, 14 components, 14 bytes)"

It can be especially difficult to parse as I can not simply ignore what is in parens all the time because they are not always there, or can be part of the output of text fields.

Is it possible to introduce a different method that would return result in a more structured way like?

image.field("exif-ifd3-UserComment") 
# => {type: :string, value: "Hello (world)", encoding: :ASCII, components: 14, bytes: 14}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions