Skip to content

Commit d7ae7f5

Browse files
kevinzakkacopybara-github
authored andcommitted
Improve error message when loading textures that are not PNGs.
PiperOrigin-RevId: 452052514 Change-Id: Ic2f0e8717e43d1a17b2d07ac0e07efe96c5ae1bd
1 parent 8902c20 commit d7ae7f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/user/user_objects.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -2236,7 +2236,8 @@ void mjCTexture::LoadCustom(string filename, const mjVFS* vfs,
22362236
mju_free(buffer);
22372237
}
22382238

2239-
throw mjCError(this, "non-positive texture dimensions in file '%s'", filename.c_str());
2239+
throw mjCError(this, "Non-PNG texture, assuming custom binary file format,\n"
2240+
"non-positive texture dimensions in file '%s'", filename.c_str());
22402241
}
22412242

22422243
// check buffer size
@@ -2245,7 +2246,8 @@ void mjCTexture::LoadCustom(string filename, const mjVFS* vfs,
22452246
mju_free(buffer);
22462247
}
22472248

2248-
throw mjCError(this, "unexpected file size in file '%s'", filename.c_str());
2249+
throw mjCError(this, "Non-PNG texture, assuming custom binary file format,\n"
2250+
"unexpected file size in file '%s'", filename.c_str());
22492251
}
22502252

22512253
// allocate and copy

0 commit comments

Comments
 (0)