I am not sure why this produces zero width for -trim, rather than keeping width=1. Perhaps IM processes each side in progression. If so, that would explain why it reduces to 0 width. But then I would have expected height=0 also.
convert -size 1x20 xc:black xc:white xc:black -append tmp.gif
dim=`convert tmp.gif -format "%@" info:`
convert: geometry does not contain image `' @ warning/attribute.c/GetImageBoundingBox/247.
echo "$dim"
0x39+0+20
possible bug -trim and %@ IM 6.9.0.1 Q16 Mac OSX Snow Leopard
Re: possible bug -trim and %@ IM 6.9.0.1 Q16 Mac OSX Snow Leopard
We can reproduce the problem you posted and have a patch in ImageMagick 6.9.0-2 Beta, available by sometime tomorrow. Thanks.