[LyX/master] Do not correct clipping bounding box for vector formats

2020-09-25 Thread Enrico Forestieri
commit 9b1763cd42e0fa65df716e0f4ca9dc7dd5d49c9c
Author: Enrico Forestieri 
Date:   Fri Sep 25 12:01:57 2020 +0200

Do not correct clipping bounding box for vector formats

This amends 380f34a1 that only took into account the postscript format.
---
 src/insets/InsetGraphics.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp
index 99fcf3d..15651c9 100644
--- a/src/insets/InsetGraphics.cpp
+++ b/src/insets/InsetGraphics.cpp
@@ -326,7 +326,7 @@ void InsetGraphics::outBoundingBox(graphics::BoundingBox & 
bbox) const
string const format = theFormats().getFormatFromFile(unzipped_file);
if (zipped)
unzipped_file.removeFile();
-   if (Formats::isPostScriptFileFormat(format))
+   if (theFormats().getFormat(format)->vectorFormat())
return;
 
// Get the actual image dimensions in pixels
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] Correct comment

2020-09-25 Thread Enrico Forestieri
commit a8572c1358d5d2e66612e9f44329a6ffd33516a6
Author: Enrico Forestieri 
Date:   Fri Sep 25 12:11:10 2020 +0200

Correct comment
---
 src/insets/InsetGraphics.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp
index 15651c9..957e002 100644
--- a/src/insets/InsetGraphics.cpp
+++ b/src/insets/InsetGraphics.cpp
@@ -320,7 +320,7 @@ void InsetGraphics::outBoundingBox(graphics::BoundingBox & 
bbox) const
 
FileName const file(params().filename.absFileName());
 
-   // No correction is necessary for a postscript image
+   // No correction is necessary for a vector image
bool const zipped = theFormats().isZippedFile(file);
FileName const unzipped_file = zipped ? unzipFile(file) : file;
string const format = theFormats().getFormatFromFile(unzipped_file);
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] Use correct bounding box when exporting from command line

2020-09-25 Thread Enrico Forestieri
commit f0807a604cf177da385867a684143782eb9921d8
Author: Enrico Forestieri 
Date:   Fri Sep 25 20:58:40 2020 +0200

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.
---
 src/insets/InsetGraphics.cpp |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp
index 957e002..b20e9a7 100644
--- a/src/insets/InsetGraphics.cpp
+++ b/src/insets/InsetGraphics.cpp
@@ -93,6 +93,7 @@ TODO
 #include "support/Systemcall.h"
 
 #include 
+#include 
 
 #include 
 #include 
@@ -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;
 
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/2.3.x] Fix clipping for vector formats and when exporting from command line

2020-09-25 Thread Enrico Forestieri
commit b561dfaf2ef73dff89f2c47c78ca68a533b49a4a
Author: Enrico Forestieri 
Date:   Fri Sep 25 21:25:40 2020 +0200

Fix clipping for vector formats and when exporting from command line

This amends ea81faa9 that only took into account the postscript format
and did not consider that without GUI an image is not available even if
if it is actually cached. In this case we load the image for obtaining
its dimensions in order to correct the clipping bounding box.
---
 src/insets/InsetGraphics.cpp |   11 +--
 status.23x   |3 +++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp
index 88ee9a0..cf5f9ac 100644
--- a/src/insets/InsetGraphics.cpp
+++ b/src/insets/InsetGraphics.cpp
@@ -93,6 +93,7 @@ TODO
 #include "support/Systemcall.h"
 
 #include 
+#include 
 
 #include 
 #include 
@@ -320,13 +321,13 @@ void InsetGraphics::outBoundingBox(graphics::BoundingBox 
& bbox) const
 
FileName const file(params().filename.absFileName());
 
-   // No correction is necessary for a postscript image
+   // No correction is necessary for a vector image
bool const zipped = theFormats().isZippedFile(file);
FileName const unzipped_file = zipped ? unzipFile(file) : file;
string const format = theFormats().getFormatFromFile(unzipped_file);
if (zipped)
unzipped_file.removeFile();
-   if (Formats::isPostScriptFileFormat(format))
+   if (theFormats().getFormat(format)->vectorFormat())
return;
 
// Get the actual image dimensions in pixels
@@ -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;
 
diff --git a/status.23x b/status.23x
index 17fcf4c..82b1f2a 100644
--- a/status.23x
+++ b/status.23x
@@ -70,6 +70,9 @@ What's new
 
 - Fix output of titles in branches and other insets (follow-up to bug 11787).
 
+- Fix clipping of vector images and when exporting from command line
+  (follow-up to bug 11180).
+
 
 * USER INTERFACE
 
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] Typo

2020-09-25 Thread Scott Kostyshak
commit 6be7e7ce725de98db73a54c7a2d7c262d8e2c9f7
Author: Scott Kostyshak 
Date:   Fri Sep 25 15:11:03 2020 -0400

Typo
---
 development/autotests/ignoredTests |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/development/autotests/ignoredTests 
b/development/autotests/ignoredTests
index d713cc5..3c4d349 100644
--- a/development/autotests/ignoredTests
+++ b/development/autotests/ignoredTests
@@ -82,7 +82,7 @@ 
export/examples/Modules/Chessboard_(lyx(16|20|21|22|23)|(pdf5|dvi3)_texF)
 export/export/latex/.*platex.*(pdf2|texF)
 export/export/latex/languages/ja[-_].*_(pdf2|texF)
 #
-# Most Japanese documents use language "japanese" wich is tied to "platex"
+# Most Japanese documents use language "japanese" which is tied to "platex"
 # (automatically invoked instead of "latex" to create a DVI file).
 # For a discussion of alternatives for Japanese with LaTeX , see also
 # 
https://tex.stackexchange.com/questions/320021/xelatex-using-japanese-ldf-for-babel-causes-invalid-characters-errors
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] ctests: ignore Japanese dvi3 systemF tests

2020-09-25 Thread Scott Kostyshak
commit bf0f662e93c213dc2136ff963f17795302aaea52
Author: Scott Kostyshak 
Date:   Fri Sep 25 15:11:17 2020 -0400

ctests: ignore Japanese dvi3 systemF tests

These started to fail due to a "luatex" package update in the TL20
cycle. From an ML thread [1]:

  The LuaTeX-ja package, which is loaded by bxjs* class, is not
  designed to be used with dvilua(la)tex.

[1] 
https://www.mail-archive.com/search?l=mid&q=20200917155146.ec1bd9f9b5d5f5936513e5dd%40yahoo.co.jp
---
 development/autotests/ignoredTests |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/development/autotests/ignoredTests 
b/development/autotests/ignoredTests
index 3c4d349..d6a99f7 100644
--- a/development/autotests/ignoredTests
+++ b/development/autotests/ignoredTests
@@ -102,6 +102,11 @@ export/examples/ja/Modules/Rnw.*knitr.*
 !export/examples/ja/Modules/Sweave.*_(lyx.*|xhtml|pdf4_systemF)
 export/examples/ja/Modules/Sweave.*
 
+# The LuaTeX-ja package, which is loaded by bxjs* class, is not designed
+# to be used with dvilua(la)tex:
+#   
https://www.mail-archive.com/search?l=mid&q=20200917155146.ec1bd9f9b5d5f5936513e5dd%40yahoo.co.jp
+# These started to fail due to a "luatex" package update in the TL20 cycle.
+export/.*/ja/.*_dvi3_systemF
 
 # CJK fails (sometimes) with Xe/LuaTeX and 8-bit fonts:
 #
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs