From 21366155e4a7dc18f685f6ea357287392acd62c9 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Sat, 16 Oct 2021 22:41:20 +0200 Subject: [PATCH] DocBook: use a hash to determine the file names for generated images. This way, the file names no more change without a reason. --- .../export/docbook/Linguistics_forest.xml | 8 +++--- ...hREpvwrFIFUHprlnoS9qCdR7kk23QfWTsObCjg.png | Bin 0 -> 5548 bytes ...0h17wY4EoBIBFZjUQJMv0cyWz6KodzrzPiY1tQ.png | Bin 0 -> 5292 bytes ...6S96tfZZQHjpBg7ADIb30ZP0DTrDTR1DEIL6dM.png | Bin 0 -> 6332 bytes ...AzFwGUKDEN7MJCcs6gYNMbJuYBkgsRTDTpIvs.png} | Bin src/insets/InsetText.cpp | 26 ++++++++++++++++-- 6 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 autotests/export/docbook/lyx_EafAhhREpvwrFIFUHprlnoS9qCdR7kk23QfWTsObCjg.png create mode 100644 autotests/export/docbook/lyx_Evmv0h17wY4EoBIBFZjUQJMv0cyWz6KodzrzPiY1tQ.png create mode 100644 autotests/export/docbook/lyx_Neo86S96tfZZQHjpBg7ADIb30ZP0DTrDTR1DEIL6dM.png rename autotests/export/docbook/{lyxpreviewAJskuj1.png => lyx_waUJAzFwGUKDEN7MJCcs6gYNMbJuYBkgsRTDTpIvs.png} (100%) diff --git a/autotests/export/docbook/Linguistics_forest.xml b/autotests/export/docbook/Linguistics_forest.xml index 65c0f0bc98..65144e7f21 100644 --- a/autotests/export/docbook/Linguistics_forest.xml +++ b/autotests/export/docbook/Linguistics_forest.xml @@ -13,7 +13,7 @@ Here is a simple example: - + [VP [DP[John]] [V' [V[sent]] [DP[Mary]] [DP[D[a]][NP[letter]]] ] ] @@ -26,7 +26,7 @@ expands to a real structure tree. To view the result within the work area, you can simply embed the Structure Tree inset into a Preview inset. If instant preview is correctly installed and activated, you should see the tree immediately (just click on the image in order to edit): - + [VP [DP[Mary]] [V' [V[sent]] [DP[John]] [DP[D[a]][NP[response]]] ] ] @@ -35,7 +35,7 @@ Roofs can be easily generated by means of the roof option (note that the comma has special meaning, as it marks options): - + [VP [DP[John]] [V' [V[sent]] [DP[Mary]] [DP[another letter, roof]] ] ] @@ -44,7 +44,7 @@ In order to align nodes of the tree more elegantly, use the “tier” option. All nodes which have the same tier allocated get aligned. Here is an example: - + [VP [DP[John,tier=word]] [V' [V[sent,tier=word]] [DP[Mary,tier=word]] [DP[D[a,tier=word]][NP[letter,tier=word]]] ] ] diff --git a/autotests/export/docbook/lyx_EafAhhREpvwrFIFUHprlnoS9qCdR7kk23QfWTsObCjg.png b/autotests/export/docbook/lyx_EafAhhREpvwrFIFUHprlnoS9qCdR7kk23QfWTsObCjg.png new file mode 100644 index 0000000000000000000000000000000000000000..d2c57a4031c0b4bbfc5e049a233aebb19ffc35b7 GIT binary patch literal 5548 zcmZvgc{tSF-^a&J)=?t6AvCs%EE)Tt$X0IqZfLTGvWKY5WWR;7FO?!Rwh~4}wlJe) zohe&n7-Zj{{k{MVqH@2{EmxJb;{F z?$fM!na^k%;EA%Dk|b|_=%2=j!X{|6O*p)?$#H^S%v1(<~BB% zmoFusJbB{s1Ap&)P9I_n*&dVcd+{0D&d$y}g;FECwzbt+q!<4-XwDRgM2cR#$c@9{ zx_W!#T3xhn-8z?|482e|*H-D+czb_40P!KozJ#bPnQpQ@(cf?S;L)Q$=#y!V0l490 zCVF~N1VYfOj(>G^^>$z&e;vN4h=vsn1Z)@4m!9nmpWA%`mBP=W}>C>(}c>46I z1*PrNr?jU}yTq>{gL^CeYmAMJ=uoxO&nRd4e7ZnvJr>EU*UlP%U zLtX)^Q~DF{1L6#yViq&go6R!6jgPZ(a&oGwuc@mbXUz9=Rda-(X}*j~@p(w3@?#nk zFl|W~j8O@iMt3{liO_|dzU^H~)dd71(IiKCwUPrY`#|aa`!tr;*3;|1znZ_cw5jvr zq5fz|+1w0n`qLxR)zhQv<0FfNK~t2Vqe6`Wo*Zm!+Apr_6q$=kOEWLy_vDrRC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{Q01N^W z{u?j^=m7x<$5vyhNb+s%S|lHej62geB( z7M3;wAr){q2wzjTwr*7`--IbD-r%BlZM&ROG1t|ZE|i7aGeeqv*}_t%RKxyAL7f3clS67#CM~rWjQ%G9#vH-{GFao z1A(P6|Ni~^m<#XS(+CU-DkT+kkJUcvUO)`ZrI4aw*{zq*fG1lHmi!?x@th)UqoZeZ zbac?(-Zc(^d^>aRZDfVt5wV#j);DiTfy02+&2j(fl<56q(BR_Z!vM3J1Vk90k}}{v z{-(UV=Cd&lai zj8@>5JUl$1Ykev>pV5mB_{cMz$wHrk1~lUR@jIU{R%?b(Cti76xNrd+h~!!^v9hw# zKtLC>GbR(}JFqv91&aCo=p=o(@`WZf=CZL0W5TYp|I8^Zd02C9QkQEu7%C z=g%cTs%+XE^9Bb+=J1S__4Nn9&iwrqz|@S5Ss%s66TyL9%i%^gu}XzYM&i4FonWkluaA>rHIt(l(kRcdBOtjEs8T z&pG2G!`cp{ilr{DItV&CIs#Un)~#!76ac&&H1-Lo72qjt3GP;K>QmhW)QlTDgR4?` zcI|dZNI^PYbD=aL;rO8@7ZHai20z7fPA)7w2AQEe61^$m+uuHNT%#kMX5kK)dECCL z?V#Y^MpbkY2+y+4ctH@lWtoBY`aTq8=HuggT4SN{j}mwF(DeO7fv5hJ_8XJ5qG=wY euxd4pBRWJWnI7%w!VQjJAy@THk(IhGvHt^4ubgfG literal 0 HcmV?d00001 diff --git a/autotests/export/docbook/lyx_Evmv0h17wY4EoBIBFZjUQJMv0cyWz6KodzrzPiY1tQ.png b/autotests/export/docbook/lyx_Evmv0h17wY4EoBIBFZjUQJMv0cyWz6KodzrzPiY1tQ.png new file mode 100644 index 0000000000000000000000000000000000000000..0fa6b403b9fa80fc85e55f882149bbb0700d88a9 GIT binary patch literal 5292 zcmZXY2T)Vp)`r7}^p=1~ks3e{HBREJ-AQTwBxr{ufNAUZyNU8q*RKG)>9)DpYt($q)XM21(RllRm>eYwfyuPJIOHaTXERUVC; zlxxHqVv^t1j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WSfW32r&`(!M`{Xdjs8`~Qd*>e408&Mi$F8-8#npiT@N z9DfMicsc1Bw9mORUPoPS9u1Ft`0%0iuj#g#zJfEpWAi_5aRHgaEQtY!784i8Us#== z$ApKs9s4(^X0yk8gz?JyAfi=?$;l(nJOe}60*+mc9vS^IFXcQAHMxrxx$MN(HkhF$t$3TAtB)hDPTU|C5^tFCfesKtfQzn{?yPNZt65lZH@CFJr>4@Dn$pCphh=2&LFCTJ$~pnT8A<^pUgh7F=HT6A{=q=__zotvYNe<6BEp2 z!D$Lngz)+J`B4KIG*3=uFfcQpl9ZC7*2p#3*;^_mRbmK(R6&&$SygSw)kqW#mSV8U5?LgwU#-wC1uCYK+)3rtT}R$^vn z?-p9taX=;>u5uT+b?X)a0Vn~WhnAL#`v(NL&vvrk{$Fs!0GYy_){c&UtgN^o*vh)6 zDm2ktp_k8E1@4|EQBrhs6N6DPq`kF#){qxTNef34|AjsqXXj{Wc4ih9o1r%r!|%OC z5sC$ai{s!lL)j(nHvWx31STSa45XGA=FXquoR1!+wm2tZrOBN2ASZ?VAFF5O8}RqA zR?W-nGT4$ea4x13?FrUX_I1Suva1_om!2uMGfFv*3CpGCpnzR1bu2 zUvAFE8GFF11aAnzqj&QeuXBHED+z*t#lph#;PaXxHsH1^{({o)q$OULRE04Sq`L@R zsDwk`DQug<(Ub(o6wM?q4yZl?+>D4iH5C #include +#include + using namespace std; using namespace lyx::support; @@ -669,8 +671,28 @@ void InsetText::docbookRenderAsImage(XMLStream & xs, OutputParams const & rp, XH LASSERT(img != nullptr, return); support::FileName const & filename = img->filename(); + // Use a file name that is only determined by the LaTeX code: the name of + // the snippet is more or less random (i.e., if the user generates the file + // several times, they will have a clutter of preview files). + // Hence: use a cryptographic hash of the snippet. If the snippet changes, + // the file name will change a lot; two snippets are unlikely to have the + // same hash (by design of cryptographic hash functions). Computing a hash + // is typically slow, but extremely fast compared to compilation of the + // preview and image rendering. + QString snippetQ = QString(snippet.c_str()); +#if QT_VERSION >= 0x050000 + QByteArray hash = QCryptographicHash::hash(snippetQ.toLocal8Bit(), QCryptographicHash::Sha256); +#else + QByteArray hash = QCryptographicHash::hash(snippetQ.toLocal8Bit(), QCryptographicHash::Sha1); +#endif + auto newFileBase = QString(hash.toBase64()) + .replace("/", "") + .replace("+", "") + .replace("=", ""); + std::string newFileName = "lyx_" + newFileBase.toStdString() + "." + filename.extension(); + // Copy the image into the right folder. - rp.exportdata->addExternalFile("docbook5", filename, filename.onlyFileName()); + rp.exportdata->addExternalFile("docbook5", filename, newFileName); // TODO: deal with opts. What exactly is the WriterOuterTag here, for instance? // Start writing the DocBook code for the image. @@ -680,7 +702,7 @@ void InsetText::docbookRenderAsImage(XMLStream & xs, OutputParams const & rp, XH // Output the rendered inset. xs << xml::StartTag("imageobject") << xml::CR() - << xml::CompTag("imagedata", std::string("fileref='") + filename.onlyFileName() + "'") + << xml::CompTag("imagedata", std::string("fileref='") + newFileName + "'") << xml::CR() << xml::EndTag("imageobject") << xml::CR();