Skip to content

Commit

Permalink
Print more informative error message for unsupported image file formats.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Pharr committed Jun 2, 2014
1 parent 28bcc17 commit 8e2f8af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/imageio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ RGBSpectrum *ReadImage(const string &name, int *width, int *height) {
!strcmp(name.c_str() + suffixOffset, ".PFM"))
return ReadImagePFM(name, width, height);
}
Error("Can't determine image file type from suffix of filename \"%s\"",
Error("Unable to load image stored in format \"%s\" for filename \"%s\". "
"Returning a constant grey image instead.",
rindex(name.c_str(), '.') ? (rindex(name.c_str(), '.') + 1) : "(unknown)",
name.c_str());
RGBSpectrum *ret = new RGBSpectrum[1];
ret[0] = 0.5f;
Expand Down

0 comments on commit 8e2f8af

Please sign in to comment.