move extractor to func/

This commit is contained in:
tth
2021-04-25 12:51:01 +02:00
parent 004f24689b
commit b3de3b96f7
4 changed files with 65 additions and 23 deletions

View File

@@ -70,6 +70,26 @@ if (!strcasecmp(name, "exr")) return FILE_TYPE_EXR;
return -1;
}
/* --------------------------------------------------------------------- */
/*
* /!\ return 4 on success
*/
int parse_rectangle(char *str, Rectangle *r, int notused)
{
int x, y, w, h, foo;
if (verbosity)
fprintf(stderr, "parsing %s\n", str);
foo = sscanf(str, "%d,%d,%d,%d", &w, &h, &x, &y);
if (4 == foo) {
r->x = x, r->y = y, r->w = w, r->h = h;
return 4;
}
return -1;
}
/* --------------------------------------------------------------------- */
int format_from_extension(char *fname)
{