Code: Select all
Version: ImageMagick 6.8.7-0 2013-09-18 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib freetype jbig jng jp2 jpeg lcms png ps png tiff webp x xml zlib
Code: Select all
convert -size 1365x1024 -depth 8 test.yuv test.bmp
convert.exe: Unexpected end-of-file `test.yuv': No such file or directory @ error/yuv.c/ReadYUVImage/429.
Code: Select all
convert -size 1365x1024 -depth 8 -identify test.yuv test.bmp
test.yuv[0] YUV 1365x1024 1365x1024+0+0 8-bit YCbCr 2.097MB 0.320u 0:00.368
test.yuv[1] YUV 1365x1024 1365x1024+0+0 8-bit YCbCr 2.097MB 0.180u 0:00.214
convert.exe: Unexpected end-of-file `test.yuv': No such file or directory @ error/yuv.c/ReadYUVImage/429.
Indeed, looking at coders/yuv.c, I found that when chroma_image is created, it calculates the width and height by normal (round-down) integer division by horizontal_factor and vertical_factor. When I modified the division to round up and rebuilt IM, my original convert command line worked as expected.
Is this a bug, or is it expected behavior that odd chroma info will just drop off and do something like use the previous 2x2 block's value, or are odd-width YUV images just not supported? If the existing behavior is expected, is there an option I can use to round up and look at the chroma information at the edge of my image?