-
-
Notifications
You must be signed in to change notification settings - Fork 56.3k
imgcodecs: jpeg: add IMWRITE_JPEG_SAMPLING_FACTOR parameter #22064
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
Conversation
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.
Thank you for contribution!
Public API changes are good.
modules/imgcodecs/src/grfmt_jpeg.cpp
Outdated
// Unknown parameter is set. | ||
sampling_factor = 0; |
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.
It makes sense to emit warning here through CV_LOG_WARNING(NULL, "Unknown value for IMWRITE_JPEG_SAMPLING_FACTOR: " << sampling_factor);
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.
Thank you for your comment, i fixed it.
samples/cpp/imgcodecs_jpeg.cpp
Outdated
Mat framebuffer = Mat( 160 * 2, 160 * 5, CV_8UC3, cv::Scalar::all(255) ); | ||
|
||
Mat img = Mat( 160, 160, CV_8UC3, cv::Scalar::all(255) ); |
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.
Mat framebuffer = Mat(...);
No need to copy Mat. Just initialize in ctor: Mat framebuffer(...);
Thank you for build and test ! I checked compile log. I think W10/BuildAndTest will become OK if it run again. [OK] W10 / BuildContrib
[NG] W10 / BuildAndTest
|
Thank you for retrying to test. The result of W10/BuildAndTest was success ! |
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.
LGTM 👍
samples/cpp/imgcodecs_jpeg.cpp
Outdated
// This file is part of OpenCV project. | ||
// It is subject to the license terms in the LICENSE file found in the top-level directory | ||
// of this distribution and at http://opencv.org/license.html | ||
|
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.
We don't have license headers in "samples". Please remove this.
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.
Thank you for review!! I'm very sorry for the delay in responding. I created a commit to remove those lines.
fix #22052
This merge request contains sample and test program.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.