From 138820564b5f1f4346a7ec04004e61ef663e9e82 Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 20 Oct 2020 10:42:09 +0000 Subject: [PATCH] RichText: EncodeHTML now using image style width / height instead of rescaling internally git-svn-id: svn://ultimatepp.org/upp/trunk@15277 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/RichText/EncodeHTML.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/uppsrc/RichText/EncodeHTML.cpp b/uppsrc/RichText/EncodeHTML.cpp index 9a86aff25..eecc6be20 100644 --- a/uppsrc/RichText/EncodeHTML.cpp +++ b/uppsrc/RichText/EncodeHTML.cpp @@ -341,28 +341,23 @@ String DefaultHtmlObjectSaver::GetHtml(const RichObject& object, const String& l String name; name << namebase << "_" << im++ << ".png"; Size psz = object.GetPixelSize(); - String lname; - lname << "L$" << name; Size sz = z * object.GetSize(); if(abs(100 * (psz.cx - sz.cx) / sz.cx) < imtolerance) sz = psz; PNGEncoder png; - png.SaveFile(AppendFileName(outdir, name), object.ToImage(sz)); + png.SaveFile(AppendFileName(outdir, name), object.ToImage(psz)); String el = ""; if(IsNull(link)) { if(psz.cx * psz.cy != 0) - html << ""; + html << ""; else el.Clear(); } else html << ""; - html << "\"\""; + html << Format("\"\"", + name, sz.cx, sz.cy); html << el; - if(IsNull(link) && psz.cx * psz.cy != 0) { - PNGEncoder png; - png.SaveFile(AppendFileName(outdir, lname), object.ToImage(psz)); - } return String(html); }