+ image_reader : consistent error handling - throw image_reader_exception rather than returning 0 pointer.

This commit is contained in:
artemp 2013-04-16 17:30:17 +01:00
parent b9e66c82de
commit c5170290f8

View file

@ -68,7 +68,8 @@ image_reader* get_image_reader(char const* data, size_t size)
boost::optional<std::string> type = type_from_bytes(data,size);
if (type)
return factory<image_reader,std::string,char const*,size_t>::instance().create_object(*type, data,size);
return 0;
else
throw image_reader_exception("image_reader: can't determine type from input data");
}
image_reader* get_image_reader(std::string const& filename,std::string const& type)