Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
6f758832
Unverified
Commit
6f758832
authored
Sep 29, 2020
by
Edgar Andrés Margffoy Tuay
Committed by
GitHub
Sep 29, 2020
Browse files
Check JPEG_FOUND macro in jpeg common definitions (#2725)
parent
6afb3496
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
torchvision/csrc/cpu/image/jpegcommon.cpp
torchvision/csrc/cpu/image/jpegcommon.cpp
+2
-0
torchvision/csrc/cpu/image/jpegcommon.h
torchvision/csrc/cpu/image/jpegcommon.h
+4
-0
No files found.
torchvision/csrc/cpu/image/jpegcommon.cpp
View file @
6f758832
#include "jpegcommon.h"
#include <string>
#if JPEG_FOUND
void
torch_jpeg_error_exit
(
j_common_ptr
cinfo
)
{
/* cinfo->err really points to a torch_jpeg_error_mgr struct, so coerce
* pointer */
...
...
@@ -15,3 +16,4 @@ void torch_jpeg_error_exit(j_common_ptr cinfo) {
/* Return control to the setjmp point */
longjmp
(
myerr
->
setjmp_buffer
,
1
);
}
#endif
torchvision/csrc/cpu/image/jpegcommon.h
View file @
6f758832
...
...
@@ -4,6 +4,8 @@
#include <cstdio>
#include <cstddef>
// clang-format on
#if JPEG_FOUND
#include <jpeglib.h>
#include <setjmp.h>
#include <string>
...
...
@@ -17,3 +19,5 @@ struct torch_jpeg_error_mgr {
typedef
struct
torch_jpeg_error_mgr
*
torch_jpeg_error_ptr
;
void
torch_jpeg_error_exit
(
j_common_ptr
cinfo
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment