Skip to content

Move structured way to extract a field from image #413

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy