[pkg-lxqt-devel] Bug#974616: nomacs: "charset=Ascii" appears before the comment of the image

Vincent Lefevre vincent at vinc17.net
Sat Dec 12 20:59:38 GMT 2020


Control: retitle -1 nomacs: "charset=Ascii" or "charset=Unicode" appears before the "User Comment" metadata of the image
Control: tags -1 patch

On 2020-11-13 01:17:36 +0100, Vincent Lefevre wrote:
> After the upgrade to libexiv2-27 0.27.3-3, nomacs displays
> "charset=Ascii" before the comment of the image, visible via
> Panels → Metadata Info, then Exif → Photo.

I'm attaching the patch I've written. There was already a function
that removes substrings of the form 'charset="ASCII"' case
insensitively. So I do the same thing with 'charset=ASCII'
(i.e. without the double-quotes) and 'charset=Unicode', which
appears when the string has non-ASCII characters.

Note that this function is a hack: it will remove real occurrences
of such strings, not just those added by libexiv2. However, there
is very little probability that such strings really appear in the
comment. And one cannot do much better to fix the issue.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
-------------- next part --------------
Description: Remove "charset=" prologue from libexiv2 0.27.3.
Author: Vincent Lefevre <vincent at vinc17.net>
Bug-Debian: https://bugs.debian.org/974616
Last-Update: 2020-12-12

Index: nomacs-3.12.0+dfsg/src/DkCore/DkMetaData.cpp
===================================================================
--- nomacs-3.12.0+dfsg.orig/src/DkCore/DkMetaData.cpp
+++ nomacs-3.12.0+dfsg/src/DkCore/DkMetaData.cpp
@@ -1216,8 +1216,13 @@ QString DkMetaDataT::exiv2ToQString(std:
 		info = QString::fromLocal8Bit((char*)(exifString.c_str()), (int)exifString.size());
 		info = info.replace("charset=\"ASCII\" ", "", Qt::CaseInsensitive);
 	}
+	else if (QString::fromStdString(exifString).contains("charset=ASCII", Qt::CaseInsensitive)) {
+		info = QString::fromLocal8Bit((char*)(exifString.c_str()), (int)exifString.size());
+		info = info.replace("charset=ASCII ", "", Qt::CaseInsensitive);
+	}
 	else {
 		info = QString::fromUtf8((char*)(exifString.c_str()), (int)exifString.size());
+		info = info.replace("charset=Unicode ", "", Qt::CaseInsensitive);
 	}
 
 	return info;


More information about the pkg-lxqt-devel mailing list