예제 #1
0
파일: vimage.py 프로젝트: yobajnin/pyvips
    def get_fields(self):
        """Get a list of all the metadata fields on an image.

        Returns:
            [string]

        """

        array = vips_lib.vips_image_get_fields(self.pointer)
        names = []
        i = 0
        while array[i] != ffi.NULL:
            name = _to_string(ffi.string(array[i]))
            names.append(name)
            glib_lib.g_free(array[i])
            i += 1
        glib_lib.g_free(array)

        return names
예제 #2
0
def get_suffixes():
    """Get a list of all the filename suffixes supported by libvips.

    Returns:
        [string]

    """

    names = []

    if at_least_libvips(8, 8):
        array = vips_lib.vips_foreign_get_suffixes()
        i = 0
        while array[i] != ffi.NULL:
            name = _to_string(array[i])
            if name not in names:
                names.append(name)
            glib_lib.g_free(array[i])
            i += 1
        glib_lib.g_free(array)

    return names