I have a problem where Column will occasionally cut off a single pixel from the top of images.
To reproduce the problem, evaluate this:
image = Import["http://i.stack.imgur.com/2dEty.png"]
Column[{"text", Image[image, Magnification -> 1], "text"}]
The output I get looks like this in the front end:

Note that in Out[2] a single pixel wide row is cut off from the top of the image. It does not occur with all images, but it does with this particular one.
How can I work around this problem? This is on Win7. Can you reproduce on other platforms?
I need this for the image uploader palette (SOUploader`uploadWithPreview[] function to be specific).
It is interesting to note that if I wrap the image in a Pane, and set a pane-size explicitly (as in the original code of the palette), whether the row is cut off depends on whether the size is even or odd (I suspect a rounding issue):
Try this and notice that the cropping happens for even k only:
Table[
Column[{"text",
Pane[Image[image, Magnification -> 1],
ImageDimensions[image] + {0, k}], "text"}],
{k, 0, 5}
]
Comments
Post a Comment