# Gimp.file_has_extension

    function file_has_extension(file: Gio.File, extension: String): Boolean {
        // Gjs wrapper for gimp_file_has_extension()
    }

This function checks if file's URI ends with extension. It behaves like g_str_has_suffix() on g_file_get_uri(), except that the string comparison is done case-insensitively using g_ascii_strcasecmp().

Since 2.10

file

  a Gio.File

extension

  an ASCII extension

Returns

  true if file's URI ends with extension, false otherwise.