12 fprint(2, "usage: %s [-c 'comment'] [-gs] [file]\n", argv0);
17 main(int argc, char *argv[])
22 char *err, *file, *com;
47 if((fd = open(file, OREAD)) < 0)
48 sysfatal("open %s: %r", file);
51 if(Binit(&bout, 1, OWRITE) < 0)
52 sysfatal("Binit: %r");
55 if((i = readmemimage(fd)) == nil)
56 sysfatal("readimage %s: %r", file);
58 if((ni = memmultichan(i)) == nil)
59 sysfatal("converting image to RGB24: %r");
64 err = memwritejpg(&bout, i, com, gflag, sflag);
68 fprint(2, "%s: %s\n", argv0, err);