mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Use correct bounding box when exporting from command line
Without GUI an image is not available even if it is actually cached.
In this case we load the image for obtaining its dimensions in order
to correct the clipping bounding box.
This amends 380f34a1
.
This commit is contained in:
parent
a8572c1358
commit
f0807a604c
@ -93,6 +93,7 @@ TODO
|
||||
#include "support/Systemcall.h"
|
||||
|
||||
#include <QProcess>
|
||||
#include <QtGui/QImage>
|
||||
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
@ -340,6 +341,12 @@ void InsetGraphics::outBoundingBox(graphics::BoundingBox & bbox) const
|
||||
height = image->height();
|
||||
}
|
||||
}
|
||||
// Even if cached, the image is not loaded without GUI
|
||||
if (width == 0 && height == 0) {
|
||||
QImage image(toqstr(file.absFileName()));
|
||||
width = image.width();
|
||||
height = image.height();
|
||||
}
|
||||
if (width == 0 || height == 0)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user