chiark / gitweb /
Use compressed _master-pixmap.txt.gz
[ypp-sc-tools.web-live.git] / pctb / rgbimage.c
index dfcd1808f25421ceb9223343c1d24618bbae2eef..81eddf9898e83427a83f7376bef93868e8a4dc56 100644 (file)
@@ -50,9 +50,9 @@
 
 static int identify1(const RgbImage *base, Rect portion,
                    char result[MAXIMGIDENT], const char *what,
-                   const char *which) {
+                   const char *which, int (*opener)(const char *fn)) {
   char *dbfile_name= masprintf("_%s-pixmap.txt",which);
-  if (!dbfile_open(dbfile_name))
+  if (!opener(dbfile_name))
     goto not_found;
 
 #define FGETSLINE (dbfile_getsline(result,MAXIMGIDENT,__FILE__,__LINE__))
@@ -111,8 +111,8 @@ static int identify1(const RgbImage *base, Rect portion,
 
 static int identify(const RgbImage *base, Rect portion,
                    char result[MAXIMGIDENT], const char *what) {
-  return identify1(base,portion,result,what, "master") ||
-         identify1(base,portion,result,what, "local");
+  return identify1(base,portion,result,what, "master", dbfile_gzopen) ||
+         identify1(base,portion,result,what, "local",  dbfile_open);
 }
 
 void fwrite_ppmraw(FILE *f, const RgbImage *ri) {
@@ -147,7 +147,7 @@ void identify_rgbimage(const RgbImage *base, Rect portion,
 
   if (!synced) {
     if (o_flags & ff_dict_fetch)
-      fetch_with_rsync("pixmap");
+      fetch_with_rsync_gz("pixmap");
     synced++;
   }