From: Laurent Monin Date: Mon, 14 Apr 2008 22:45:53 +0000 (+0000) Subject: Increase collection_load() buffer size and do not activate X-Git-Tag: v1.0.0~1443 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=7b5e4b9910d9630dd8337bf7595a72adc5353fbf Increase collection_load() buffer size and do not activate error limiting for GQview collections. --- diff --git a/src/collect-io.c b/src/collect-io.c index d885eb28..ed3b1c2e 100644 --- a/src/collect-io.c +++ b/src/collect-io.c @@ -26,6 +26,7 @@ #define GQ_COLLECTION_FAIL_MIN 300 #define GQ_COLLECTION_FAIL_PERCENT 98 +#define GQ_COLLECTION_READ_BUFSIZE 4096 typedef struct _CollectManagerEntry CollectManagerEntry; @@ -53,7 +54,7 @@ static gint scan_geometry(gchar *buffer, gint *x, gint *y, gint *w, gint *h) static gint collection_load_private(CollectionData *cd, const gchar *path, CollectionLoadFlags flags) { - gchar s_buf[2048]; + gchar s_buf[GQ_COLLECTION_READ_BUFSIZE]; FILE *f; gchar *pathl; gint official = FALSE; @@ -85,6 +86,9 @@ static gint collection_load_private(CollectionData *cd, const gchar *path, Colle if (!path && !cd->path) return FALSE; if (!path) path = cd->path; + + if (debug) printf("collection load: append=%d flush=%d only_geometry=%d path=%s\n", + append, flush, only_geometry, path); /* load it */ pathl = path_from_utf8(path); @@ -120,6 +124,12 @@ static gint collection_load_private(CollectionData *cd, const gchar *path, Colle return TRUE; } } + else if (strncasecmp(s_buf, "GQview collection", strlen("GQview collection")) == 0) + { + /* As 2008/04/15 there is no difference between our collection file format + * and GQview 2.1.5 collection file format so ignore failures as well. */ + official = TRUE; + } continue; } if (s_buf[0]=='\n') continue;