Method: Vips::Image#get_fields

Defined in:
lib/vips/image.rb

#get_fields[String]

Get the names of all fields on an image. Use this to loop over all image metadata.

Returns:

  • ([String])

    array of field names



786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
# File 'lib/vips/image.rb', line 786

def get_fields
  # vips_image_get_fields() was added in libvips 8.5
  return [] unless Vips.respond_to? :vips_image_get_fields

  array = Vips.vips_image_get_fields self

  names = []
  p = array
  until (q = p.read_pointer).null?
    names << q.read_string
    GLib.g_free q
    p += FFI::Type::POINTER.size
  end
  GLib.g_free array

  names
end