Logging: replace print with logging if an animation fails to load

Also remove noisy print when a thumbnail can't be generated from an
animation. Similar prints have been commented and mainly seem useful
for debugging.
This commit is contained in:
Campbell Barton
2024-09-14 15:26:12 +10:00
parent 7e2785927c
commit 8a29277ca8
2 changed files with 7 additions and 4 deletions

View File

@@ -2689,12 +2689,15 @@ ImBufAnim *openanim(const char *filepath,
ibuf = IMB_anim_absolute(anim, 0, IMB_TC_NONE, IMB_PROXY_NONE);
if (ibuf == nullptr) {
if (BLI_exists(filepath)) {
printf("not an anim: %s\n", filepath);
const char *reason;
if (!BLI_exists(filepath)) {
reason = "file doesn't exist";
}
else {
printf("anim file doesn't exist: %s\n", filepath);
reason = "not an anim";
}
CLOG_INFO(&LOG, 1, "unable to load anim, %s: %s", reason, filepath);
IMB_free_anim(anim);
return nullptr;
}

View File

@@ -396,7 +396,7 @@ static ImBuf *thumb_create_ex(const char *file_path,
if (anim != nullptr) {
img = IMB_anim_absolute(anim, 0, IMB_TC_NONE, IMB_PROXY_NONE);
if (img == nullptr) {
printf("not an anim; %s\n", file_path);
// printf("not an anim; %s\n", file_path);
}
else {
IMB_freeImBuf(img);