errors

Exceptions and error handling

jpegxx and pngxx use exeptions to report errors.

For detailed information about each exception type, you should look at the <jpegxx/exceptions.hpp> and <pngxx/exceptions.hpp> headers, where each exception class is documented in doxygen markup. In addition, all of the public functions of the libraries are similarly documented and each specifies the particular exceptions that may be thrown.

Some exceptions contain extra data members to the classes from which they inherit, in order to provide more accurate diagnostics at the catch site.

Except for imagexx::exception, pngxx::exception and jpegxx::exception, all exception classes inherit from a C++ standard library exception. Therefore, a catch clause that catches std::exception objects will also catch exceptions thrown by pngxx and jpegxx.

The imagexx, jpegxx and pngxx exceptions hierarchy is pictured below. Ignore the auto_exception_impl<> stuff -- that's merely an implementation detail that I am too lazy to delete from the dot file created by doxygen!.

The imagexx, jpegxx and pngxx exceptions hierarchy

Exception safety

I have designed pngxx and jpegxx to provide the strongest exception safety guarantees possible, without sacrificing efficiency.

Obviously, reading and writing images is a side effect of using the library and I can't unwind uni-directional iterators or undo state changes to objects passed to the library. But the jpegxx and pngxx objects and functions will never leak resources.

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.