
Hi there,
1. setjmp() in each function (scope?) that calls into libjpeg. That's nasty because setjmp(), IIRC, is detected by the compiler and prevents some optimisations. It's relatively non-intrusive in your code though.
I can't believe performance is a serious concern here. I think this is the best option. There's still the thread-safety issue. Can you use the cinfo to pass the jmp_buf through to error_exit? If not then I guess the jmp_buf could be stored in static thread-local storage...
I have updated and uploaded the code. If someone could have a look I would really appreciate it. http://gil-contributions.googlecode.com/svn/trunk/gil_2/boost/gil/extension/... http://gil-contributions.googlecode.com/svn/trunk/gil_2/boost/gil/extension/... Am I correct to mark up the write operations with setjmp's, as well? Does someone has an idea how to deal with multi-threaded scenarios? Regards, Christian