diff --git a/thumbnail/appimagecreator.cpp b/thumbnail/appimagecreator.cpp --- a/thumbnail/appimagecreator.cpp +++ b/thumbnail/appimagecreator.cpp @@ -21,7 +21,7 @@ #include "appimagecreator.h" #include -#include +#include #include @@ -42,20 +42,22 @@ Q_UNUSED(width); Q_UNUSED(height); - QTemporaryFile file; - if (!file.open()) { - return false; - } + unsigned long size = 0L; + char *buf = nullptr; + + bool ok = appimage_read_file_into_buffer_following_symlinks(qUtf8Printable(path), + ".DirIcon", + &buf, + &size); - appimage_extract_file_following_symlinks(qUtf8Printable(path), - ".DirIcon", - qUtf8Printable(file.fileName())); + QScopedPointer cleanup(buf); + Q_UNUSED(cleanup); - if (!image.load(file.fileName())) { + if (!ok) { return false; } - return true; + return image.loadFromData(reinterpret_cast(buf), size); } ThumbCreator::Flags AppImageCreator::flags() const