-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compilation error when there is no libjpeg #8342
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8342
Note: Links to docs will display an error until the docs builds have been completed. ❌ 8 New Failures, 6 Unrelated FailuresAs of commit f691d53 with merge base d868be9 (): NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
cc @NicolasHug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @cdzhan, lgtm
The png_structp and j_decompress_ptr are defined in png.h and jpeglib.h and there seems no need to define fetch_jpeg_exif_orientation when libraries are not found?
Yes, we can allow not to define these functions when jpeg/png are not found such that for example decode_jpeg
function will be defined by
vision/torchvision/csrc/io/image/cpu/decode_jpeg.cpp
Lines 8 to 16 in ef2920c
#if !JPEG_FOUND | |
torch::Tensor decode_jpeg( | |
const torch::Tensor& data, | |
ImageReadMode mode, | |
bool apply_exif_orientation) { | |
TORCH_CHECK( | |
false, "decode_jpeg: torchvision not compiled with libjpeg support"); | |
} | |
#else |
Hey @vfdev-5! You merged this PR, but no labels were added. |
Co-authored-by: vfdev <vfdev.5@gmail.com>
Summary: Co-authored-by: vfdev <vfdev.5@gmail.com> Reviewed By: vmoens Differential Revision: D57099457 fbshipit-source-id: c6b60c9f830231941bea954df925aa6ed1f0c4c8
Fix #8339. The
png_structp
andj_decompress_ptr
are defined in png.h and jpeglib.h and there seems no need to definefetch_jpeg_exif_orientation
when libraries are not found?