e = avformat_open_input (&format_context, "foo.tga", f, &options);
}
if (e < 0) {
- throw OpenFileError (_path->string(), e, true);
+ if (_path) {
+ throw OpenFileError (_path->string(), e, OpenFileError::READ);
+ } else {
+ boost::throw_exception(DecodeError(String::compose(_("Could not decode image (%1)"), e)));
+ }
}
if (avformat_find_stream_info(format_context, 0) < 0) {