[gthumb] [flicker importer] fixed crash the the image url is not found
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] [flicker importer] fixed crash the the image url is not found
- Date: Wed, 4 Aug 2010 22:04:05 +0000 (UTC)
commit 69f6b8c3dde129fe8b2157bab02f8bd0719e1f0e
Author: Paolo Bacchilega <paobac src gnome org>
Date: Wed Aug 4 22:34:25 2010 +0200
[flicker importer] fixed crash the the image url is not found
when loading the image preview give priority to the smallest
thumbnail, then try the other sizes from the smallest to the
biggest, if still no preview is found try the squared thumbnail.
extensions/flicker/dlg-import-from-flickr.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/extensions/flicker/dlg-import-from-flickr.c b/extensions/flicker/dlg-import-from-flickr.c
index 4066800..0cfba5b 100644
--- a/extensions/flicker/dlg-import-from-flickr.c
+++ b/extensions/flicker/dlg-import-from-flickr.c
@@ -366,9 +366,24 @@ list_photos_ready_cb (GObject *source_object,
list = NULL;
for (scan = data->photos; scan; scan = scan->next) {
FlickrPhoto *photo = scan->data;
+ const char *url;
GthFileData *file_data;
- file_data = gth_file_data_new_for_uri (photo->url_o, (photo->mime_type != NULL) ? photo->mime_type : "image/jpeg");
+ url = NULL;
+ if (photo->url_s != NULL)
+ url = photo->url_s;
+ else if (photo->url_m != NULL)
+ url = photo->url_m;
+ else if (photo->url_o != NULL)
+ url = photo->url_o;
+
+ if (url == NULL)
+ url = photo->url_sq;
+
+ if (url == NULL)
+ continue;
+
+ file_data = gth_file_data_new_for_uri (url, (photo->mime_type != NULL) ? photo->mime_type : "image/jpeg");
g_file_info_set_file_type (file_data->info, G_FILE_TYPE_REGULAR);
g_file_info_set_size (file_data->info, FAKE_SIZE); /* set a fake size to make the progress dialog work correctly */
g_file_info_set_attribute_object (file_data->info, "flickr::object", G_OBJECT (photo));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]