hi, if there are no objections i would like to comit this. cf http://bugzilla.lyx.org/show_bug.cgi?id=5627 Juergen, ok for branch too?
i think this kind of bug is also present for regular images. it happens to me regularly that after external change of file, the image is reloaded, but the metrics of new image is wrong and i see only clipped small top-left part of the picture, one need to caper with cursor around to get image right. i will try to address this later. pavel
diff --git a/src/insets/RenderPreview.cpp b/src/insets/RenderPreview.cpp index 0b12539..c9086d5 100644 --- a/src/insets/RenderPreview.cpp +++ b/src/insets/RenderPreview.cpp @@ -124,6 +124,8 @@ void RenderPreview::metrics(MetricsInfo & mi, Dimension & dim) const getPreviewImage(mi.base.bv->buffer()); if (pimage) { + // If prepared, load the picture before dim calculation. See bug #5627. + pimage->image(); dim = pimage->dim(); } else { dim.asc = 50;