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
image/jpeg: unsupported downsampling error messages swapped for luma and chroma #5569
Labels
Comments
I created a number of sample images with no luma subsampling (only chroma subsampling) and made a test program to exhibit the problem. Here is the output: $ go run jpeg.go *.jpg 2013/05/27 14:51:42 1x1.jpg: sucess 2013/05/27 14:51:42 1x2.jpg: unsupported JPEG feature: luma downsample ratio 2013/05/27 14:51:42 1x3.jpg: unsupported JPEG feature: luma downsample ratio 2013/05/27 14:51:42 1x4.jpg: unsupported JPEG feature: luma downsample ratio 2013/05/27 14:51:42 2x1.jpg: sucess 2013/05/27 14:51:42 2x2.jpg: sucess 2013/05/27 14:51:42 2x3.jpg: unsupported JPEG feature: luma downsample ratio 2013/05/27 14:51:42 2x4.jpg: unsupported JPEG feature: luma downsample ratio 2013/05/27 14:51:42 3x1.jpg: unsupported JPEG feature: luma downsample ratio 2013/05/27 14:51:42 3x2.jpg: unsupported JPEG feature: luma downsample ratio 2013/05/27 14:51:42 4x1.jpg: unsupported JPEG feature: luma downsample ratio 2013/05/27 14:51:42 4x2.jpg: unsupported JPEG feature: luma downsample ratio The error message should be the that the chroma sub sampling is wrong, not the luma. Attachments:
|
$ for i in *.jpg; do echo $i; identify -verbose "$i" | grep "jpeg:sampling-factor"; done 1x1.jpg jpeg:sampling-factor: 1x1,1x1,1x1 1x2.jpg jpeg:sampling-factor: 1x2,1x1,1x1 1x3.jpg jpeg:sampling-factor: 1x3,1x1,1x1 1x4.jpg jpeg:sampling-factor: 1x4,1x1,1x1 2x1.jpg jpeg:sampling-factor: 2x1,1x1,1x1 2x2.jpg jpeg:sampling-factor: 2x2,1x1,1x1 2x3.jpg jpeg:sampling-factor: 2x3,1x1,1x1 2x4.jpg jpeg:sampling-factor: 2x4,1x1,1x1 3x1.jpg jpeg:sampling-factor: 3x1,1x1,1x1 3x2.jpg jpeg:sampling-factor: 3x2,1x1,1x1 4x1.jpg jpeg:sampling-factor: 4x1,1x1,1x1 4x2.jpg jpeg:sampling-factor: 4x2,1x1,1x1 |
The images were generated with the "convert" program with the "-sampling-factor" flags, which (maybe incorrectly) only affect chroma sampling: http://www.imagemagick.org/script/command-line-options.php#sampling-factor Secondly, using an alternate tool ( http://regex.info/exif.cgi ) on some of the images lists them as only doing chroma subsampling as well. For example, 2x2.jpg is listed as 4:2:0 which is only chroma subsampling. I still believe this is a bug. |
we can change the first error message to simply say "unsupported JPEG feature: luma/chroma downsample ratio". and leave the 2nd one as is. the three sub-sampling ratio in SOF frames must be considered together to give more meaningful error message. another viewpoint is that normally we only sub-sample the chroma signal, so in fact we can change both error message to say chroma downsampling. what do you think? |
I guess it all depends on your perspective. For example, 4:2:0 chroma subsampling means that in a 16x16 Minimum Coded Unit, there are 2x2 luma blocks (each block is 8x8), and 1x1 chroma block for each of U and V (the 8x8 block is stretched over the 16x16 MCU). The overall scheme is called "chroma subsampling" but the interesting number is the 2x2, which is associated with luma. Anyway, the easy fix is to change all the messages to say "luma/chroma downsample ratio". I'll do that. |
Owner changed to @nigeltao. |
This issue was closed by revision 427bec6. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by Shifter1:
The text was updated successfully, but these errors were encountered: