Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add get-list-of-field-names #85

Closed
jcupitt opened this issue Sep 7, 2016 · 3 comments
Closed

add get-list-of-field-names #85

jcupitt opened this issue Sep 7, 2016 · 3 comments

Comments

@jcupitt
Copy link
Member

jcupitt commented Sep 7, 2016

You use #get_value to get a metadata field, but there's no way to get a list of all field names.

irb(main):008:0> x = Vips::Image.new_from_file "img_0254.jpg"
=> #<Vips::Image:0x2843760 ptr=0x26f31b0>
irb(main):002:0> x.get_value "exif-data"
=> "Exif\x00\x00II*\x00\b\x00\x00\x00\t\x00\x0F\ .....

You can get gobject properties like this:

irb(main):017:0> x.class.properties
=> ["nickname", "description", "width", "height", "bands", "format", "coding", "interpretation", "xres", "yres", "xoffset", "yoffset", "filename", "mode", "kill", "demand", "sizeof-header", "foreign-buffer"]

But that won't list vips metadata fields.

See eltiare/carrierwave-vips#25

@jcupitt
Copy link
Member Author

jcupitt commented Jan 30, 2017

We now have vips_image_get_fields() ... just call this.

jcupitt/libvips@85be55f

In 8.5.

@jcupitt
Copy link
Member Author

jcupitt commented Jan 30, 2017

Works in Python:

>>> x = Vips.Image.new_from_file("wtc.jpg")
>>> x.get_fields()

But not in Ruby? Strange, I guess gchar** is not a supported return type.

@jcupitt
Copy link
Member Author

jcupitt commented Sep 3, 2017

Added in 2.0.5

@jcupitt jcupitt closed this as completed Sep 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant