Remote --get-file-info method
authorColin Clark <colin.clark@cclark.uk>
Sun, 2 Jul 2023 08:49:10 +0000 (09:49 +0100)
committerColin Clark <colin.clark@cclark.uk>
Sun, 2 Jul 2023 08:49:10 +0000 (09:49 +0100)
If no pixbuf has been created, return file class Unknown

src/remote.cc

index be5bd15..df0bbbf 100644 (file)
@@ -1263,11 +1263,16 @@ static void gr_file_info(const gchar *UNUSED(text), GIOChannel *channel, gpointe
                fd = file_data_new_group(filename);
                out_string = g_string_new(nullptr);
 
-               format_class = filter_file_get_class(image_get_path(lw_id->image));
-               if (format_class)
+               if (fd->pixbuf)
                        {
-                       g_string_append_printf(out_string, _("Class: %s\n"), format_class_list[format_class]);
+                       format_class = filter_file_get_class(image_get_path(lw_id->image));
                        }
+               else
+                       {
+                       format_class = FORMAT_CLASS_UNKNOWN;
+                       }
+
+               g_string_append_printf(out_string, _("Class: %s\n"), format_class_list[format_class]);
 
                if (fd->page_total > 1)
                        {