common_jpeg.cpp 698 B

1234567891011121314151617181920212223242526
  1. #include "common_jpeg.h"
  2. namespace vision {
  3. namespace image {
  4. namespace detail {
  5. #if JPEG_FOUND
  6. void torch_jpeg_error_exit(j_common_ptr cinfo) {
  7. /* cinfo->err really points to a torch_jpeg_error_mgr struct, so coerce
  8. * pointer */
  9. torch_jpeg_error_ptr myerr = (torch_jpeg_error_ptr)cinfo->err;
  10. /* Always display the message. */
  11. /* We could postpone this until after returning, if we chose. */
  12. // (*cinfo->err->output_message)(cinfo);
  13. /* Create the message */
  14. (*(cinfo->err->format_message))(cinfo, myerr->jpegLastErrorMsg);
  15. /* Return control to the setjmp point */
  16. longjmp(myerr->setjmp_buffer, 1);
  17. }
  18. #endif
  19. } // namespace detail
  20. } // namespace image
  21. } // namespace vision