|
From: | Darcy Shen |
Subject: | [Texmacs-dev] Improving SVG support |
Date: | Sat, 09 Nov 2019 01:53:57 +0800 |
User-agent: | ZohoCN Mail |
Follow-up Comment #1, bug #57193 (project texmacs):
For SVG images under TeXmacs with Qt, we use qt_image_size to determine the
size of the image.
bool
qt_image_size (url image, int& w, int& h) {// w, h in points
if (DEBUG_CONVERT) debug_convert << "qt_image_size :" <<LF;
QImage im= QImage (utf8_to_qstring (concretize (image)));
if (im.isNull ()) {
convert_error << "Cannot read image file '" << image << "'"
<< " in qt_image_size" << LF;
w= 35; h= 35;
return false;
}
else {
w= (int) rint ((((double) im.width ())*2834)/im.dotsPerMeterX());
h= (int) rint ((((double) im.height())*2834)/im.dotsPerMeterY());
if (DEBUG_CONVERT) debug_convert <<"QT dotsPerMeter: "
<<w<<" x "<<h<<LF;
return true;
}
}
But QImage will fail to work without Qt SVG support.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?57193>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |