Skip to content

Commit 4619ae4

Browse files
committed
Jerry picking fix from pytorch#4439
1 parent 3049380 commit 4619ae4

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

torchvision/csrc/io/image/cpu/encode_jpeg.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ torch::Tensor encode_jpeg(const torch::Tensor& data, int64_t quality) {
1515
#else
1616
// For libjpeg version <= 9b, the out_size parameter in jpeg_mem_dest() is
1717
// defined as unsigned long, where as in later version, it is defined as size_t.
18-
// For windows backward compatibility, we define JpegSizeType as different types
19-
// according to the libjpeg version used, in order to prevent compilcation
20-
// errors.
21-
#if defined(_WIN32) || !defined(JPEG_LIB_VERSION_MAJOR) || \
22-
(JPEG_LIB_VERSION_MAJOR < 9) || \
18+
#if !defined(JPEG_LIB_VERSION_MAJOR) || JPEG_LIB_VERSION_MAJOR < 9 || \
2319
(JPEG_LIB_VERSION_MAJOR == 9 && JPEG_LIB_VERSION_MINOR <= 2)
2420
using JpegSizeType = unsigned long;
2521
#else

0 commit comments

Comments
 (0)