Method: Vips.get_suffixes

Defined in:
lib/vips.rb

.get_suffixes[String]

Get a list of all supported file suffixes.

Returns:

  • ([String])

    array of supported suffixes



855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
# File 'lib/vips.rb', line 855

def self.get_suffixes
  # vips_foreign_get_suffixes() was added in libvips 8.8
  return [] unless Vips.respond_to? :vips_foreign_get_suffixes

  array = Vips.vips_foreign_get_suffixes

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

  names
end