X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=blobdiff_plain;f=pctb%2Frgbimage.c;h=dfcd1808f25421ceb9223343c1d24618bbae2eef;hp=c4fd11d470c9a06ea39cbf81eb647a4fe26b0698;hb=5a8b5305bfbff13a3952e93d35e46c32b80c7606;hpb=6d7c97eb148bbc805f506a5d7453daafa6a18898 diff --git a/pctb/rgbimage.c b/pctb/rgbimage.c index c4fd11d..dfcd180 100644 --- a/pctb/rgbimage.c +++ b/pctb/rgbimage.c @@ -51,7 +51,7 @@ static int identify1(const RgbImage *base, Rect portion, char result[MAXIMGIDENT], const char *what, const char *which) { - char *dbfile_name= masprintf("#%s-pixmap#.txt",which); + char *dbfile_name= masprintf("_%s-pixmap.txt",which); if (!dbfile_open(dbfile_name)) goto not_found; @@ -115,6 +115,17 @@ static int identify(const RgbImage *base, Rect portion, identify1(base,portion,result,what, "local"); } +void fwrite_ppmraw(FILE *f, const RgbImage *ri) { + fprintf(f, + "P6\n" + "%d %d\n" + "255\n", ri->w, ri->h); + int count= ri->w * ri->h * 3; + sysassert( fwrite(ri->data, 1, count, f) == count ); + sysassert(!ferror(f)); + sysassert(!fflush(f)); +} + static void fwrite_ppm(FILE *f, const RgbImage *base, Rect portion) { int x,y,i; fprintf(f,"P3\n%d %d\n255\n", RECT_W(portion), RECT_H(portion)); @@ -135,7 +146,8 @@ void identify_rgbimage(const RgbImage *base, Rect portion, static int synced; if (!synced) { - fetch_with_rsync("pixmap"); + if (o_flags & ff_dict_fetch) + fetch_with_rsync("pixmap"); synced++; }