X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Frgbimage.c;h=81eddf9898e83427a83f7376bef93868e8a4dc56;hb=60cd4954d1d3c11c46251f68e2d56f24661a6d67;hp=dfcd1808f25421ceb9223343c1d24618bbae2eef;hpb=e2487a42fd29e7a15b92ce1a5855706dba1198dc;p=ypp-sc-tools.db-test.git diff --git a/pctb/rgbimage.c b/pctb/rgbimage.c index dfcd180..81eddf9 100644 --- a/pctb/rgbimage.c +++ b/pctb/rgbimage.c @@ -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++; }