chasse au bug

This commit is contained in:
tTh
2023-06-29 14:29:14 +02:00
parent ed227d6563
commit 2ff17fc54b
2 changed files with 20 additions and 1 deletions

View File

@@ -178,11 +178,17 @@ if (FIMG_TYPE_RGB != fimg->type) {
return -8;
}
// fprintf(stderr, "'%s' try to open '%s'\n", __func__, fname);
fp = fopen(fname, "w");
if (NULL==fp) {
// fprintf(stderr, " fp at %p\n", fp);
if (NULL == fp) {
perror(fname);
return -1;
}
else {
// fprintf(stderr, "file '%s' opened\n", fname);
}
memset(&filehead, 0, sizeof(filehead));
memcpy(filehead.magic, "FIMG", 4);
@@ -195,6 +201,9 @@ if (1 != foo) {
fclose(fp);
return -2;
}
// fprintf(stderr, "'%s' write header --> %d\n", __func__, foo);
nbre = fimg->width * fimg->height; /* pixels per frame */
foo = fwrite(fimg->R, sizeof(float), nbre, fp);