OSDN Git Service

kioslave: remove EXR thumbnailer
authorIvailo Monev <xakepa10@gmail.com>
Wed, 12 Oct 2022 01:07:12 +0000 (04:07 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 12 Oct 2022 01:14:59 +0000 (04:14 +0300)
no image handler for EXR now and the thumbnail may be too small to fit
well in the file properties dialog, if there is image handler (plugin)
for EXR the generic image thumbnailer can still create one

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
CMakeLists.txt
kioslave/thumbnail/CMakeLists.txt
kioslave/thumbnail/exrcreator.cpp [deleted file]
kioslave/thumbnail/exrcreator.h [deleted file]
kioslave/thumbnail/exrthumbnail.desktop [deleted file]

index 56554c2..49b724e 100644 (file)
@@ -186,14 +186,6 @@ set_package_properties(Gphoto2 PROPERTIES
     PURPOSE "Needed to build camera kioslave"
 )
 
-kde4_optional_find_package(OpenEXR)
-set_package_properties(OpenEXR PROPERTIES
-    DESCRIPTION "API for accessing OpenEXR formatted images"
-    URL "https://www.openexr.com/"
-    PURPOSE "Provides support for EXR formatted images in the thumbnail KIO slave"
-    TYPE OPTIONAL
-)
-
 kde4_optional_find_package(EPub)
 set_package_properties(EPub PROPERTIES
     DESCRIPTION "A library for reading EPub documents"
index 55f9ffd..9458d61 100644 (file)
@@ -47,27 +47,6 @@ install(TARGETS djvuthumbnail DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
 
 ########### next target ###############
 
-if(OPENEXR_FOUND)
-    include_directories(${OPENEXR_INCLUDE_DIR})
-
-    set(exrthumbnail_PART_SRCS exrcreator.cpp)
-
-    kde4_add_plugin(exrthumbnail ${exrthumbnail_PART_SRCS})
-
-    target_link_libraries(exrthumbnail ${KDE4_KIO_LIBS} ${OPENEXR_LIBRARIES})
-
-    # OpenEXR headers use exceptions; at least clang refuses to build the target
-    # when exceptions are not enabled.
-    set_target_properties(exrthumbnail PROPERTIES
-        COMPILE_FLAGS "${KDE4_ENABLE_EXCEPTIONS}"
-    )
-
-    install(TARGETS exrthumbnail DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
-    install(FILES exrthumbnail.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR})
-endif()
-
-########### next target ###############
-
 if(X11_Xcursor_FOUND)
     set(cursorthumbnail_PART_SRCS cursorcreator.cpp)
 
diff --git a/kioslave/thumbnail/exrcreator.cpp b/kioslave/thumbnail/exrcreator.cpp
deleted file mode 100644 (file)
index 6765b56..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*  This file is part of the KDE libraries
-    Copyright (C) 2004 Brad Hards <bradh@frogmouth.net>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "exrcreator.h"
-#include "thumbnail.h"
-
-#include <QImage>
-#include <QFile>
-
-#include <kdebug.h>
-#include <ksharedconfig.h>
-#include <kglobal.h>
-#include <kconfiggroup.h>
-#include <kdemacros.h>
-
-#include <ImfInputFile.h>
-#include <ImfPreviewImage.h>
-#include <ImfHeader.h>
-
-extern "C"
-{
-    KDE_EXPORT ThumbCreator *new_creator()
-    {
-        return new EXRCreator();
-    }
-}
-
-EXRCreator::EXRCreator()
-{
-}
-
-bool EXRCreator::create(const QString &path, int, int, QImage &img)
-{
-    Imf::InputFile in(path.toAscii());
-    const Imf::Header &h = in.header();
-
-    if (h.hasPreviewImage()) {
-        kDebug() << "EXRcreator - using preview";
-        const Imf::PreviewImage &preview = in.header().previewImage();
-        QImage qpreview(preview.width(), preview.height(), QImage::Format_RGB32);
-        for (unsigned int y = 0; y < preview.height(); y++ ) {
-            for (unsigned int x=0; x < preview.width(); x++) {
-                const Imf::PreviewRgba &q = preview.pixel(x, y);
-                qpreview.setPixel(x, y, qRgba(q.r, q.g, q.b, q.a));
-            }
-        }
-        img = qpreview;
-        return true;
-    }
-
-    // do it the hard way
-    // We ignore maximum size when just extracting the thumnail
-    // from the header, but it is very expensive to render large
-    // EXR images just to turn it into an icon, so we go back
-    // to honoring it in here.
-    kDebug() << "EXRcreator - using original image";
-    KSharedConfig::Ptr config = KGlobal::config();
-    KConfigGroup configGroup(config, "PreviewSettings");
-    unsigned long long maxSize = configGroup.readEntry("MaximumSize", MaxPreviewSizes::MaxLocalSize * 1024 * 1024);
-    unsigned long long fileSize = QFile(path).size();
-    if ((fileSize > 0) && (fileSize < maxSize)) {
-        if (!img.load(path)) {
-            return false;
-        }
-        if (img.depth() != 32) {
-            img = img.convertToFormat(QImage::Format_RGB32);
-        }
-        return true;
-    }
-    kDebug() << "EXRcreator - image file size too large" << fileSize << maxSize;
-    return false;
-}
-
-ThumbCreator::Flags EXRCreator::flags() const
-{
-    return ThumbCreator::None;
-}
diff --git a/kioslave/thumbnail/exrcreator.h b/kioslave/thumbnail/exrcreator.h
deleted file mode 100644 (file)
index 45f9e8f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*  This file is part of the KDE libraries
-    Copyright (C) 2004 Brad Hards <bradh@frogmouth.net>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#ifndef _EXRCREATOR_H_
-#define _EXRCREATOR_H_
-
-#include <kio/thumbcreator.h>
-
-class EXRCreator : public ThumbCreator
-{
-public:
-    EXRCreator();
-
-    bool create(const QString &path, int, int, QImage &img) final;
-    Flags flags() const final;
-};
-
-#endif
diff --git a/kioslave/thumbnail/exrthumbnail.desktop b/kioslave/thumbnail/exrthumbnail.desktop
deleted file mode 100644 (file)
index 1cfbc2d..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-[Desktop Entry]
-Type=Service
-Name=EXR Images
-Name[af]=EXR Beelde
-Name[ar]=EXR صور
-Name[ast]=Imáxenes EXR
-Name[be]=Відарысы EXR
-Name[be@latin]=Vyjavy EXR
-Name[bg]=EXR образи
-Name[bn]=ই-এক্স-আর ছবি
-Name[bn_IN]=EXR ছবি
-Name[br]=Skeudennoù EXR
-Name[bs]=EIksR slike
-Name[ca]=Imatges EXR
-Name[ca@valencia]=Imatges EXR
-Name[cs]=EXR obrázky
-Name[csb]=Òbrôzczi EXR
-Name[da]=EXR-billeder
-Name[de]=EXR-Bilder
-Name[el]=Εικόνες EXR
-Name[en_GB]=EXR Images
-Name[eo]=EXR-bildoj
-Name[es]=Imágenes EXR
-Name[et]=EXR pildifailid
-Name[eu]=EXR irudiak
-Name[fa]=تصاویر EXR
-Name[fi]=EXR-kuvat
-Name[fr]=Images EXR
-Name[fy]=EXR-ôfbyldings
-Name[ga]=Íomhánna EXR
-Name[gl]=Imaxes EXR
-Name[gu]=EXR ચિત્રો
-Name[he]=תמונות EXR
-Name[hi]=ईएक्सआर छवियाँ
-Name[hne]=ईएक्सआर फोटू
-Name[hr]=EXR slike
-Name[hsb]=EXR wobrazy
-Name[hu]=EXR-képek
-Name[ia]=Imagines EXR
-Name[id]=Gambar EXR
-Name[is]=EXR myndir
-Name[it]=Immagini EXR
-Name[ja]=EXR 画像
-Name[ka]=EXR გამოსახულებები
-Name[kk]=EXR кескіндері
-Name[km]=រូបភាព EXR
-Name[kn]=ಇಕ್ಸರ್ ಚಿತ್ರಗಳು
-Name[ko]=EXR 그림
-Name[ku]=Wêneyên EXR
-Name[lt]=EXR paveikslėliai
-Name[lv]=EXR attēli
-Name[mai]=ईएक्सआर छविसभ
-Name[mk]=EXR-слики
-Name[ml]=ഇഎക്സ്ആര്‍ ചിത്രങ്ങള്‍
-Name[mr]=EXR प्रतिमा
-Name[ms]=Imej EXR
-Name[nb]=EXR-bilder
-Name[nds]=EXR-Biller
-Name[ne]=EXR छवि
-Name[nl]=EXR-afbeeldingen
-Name[nn]=EXR-bilete
-Name[or]=EXR ପ୍ରତିଛବିଗୁଡ଼ିକ
-Name[pa]=EXR ਚਿੱਤਰ
-Name[pl]=Obrazy EXR
-Name[pt]=Imagens EXR
-Name[pt_BR]=Imagens EXR
-Name[ro]=Imagini EXR
-Name[ru]=Изображения EXR
-Name[se]=EXR-govat
-Name[si]=EXR පිංතූර
-Name[sk]=Obrázky EXR
-Name[sl]=Slike EXR
-Name[sr]=ЕИксР слике
-Name[sr@ijekavian]=ЕИксР слике
-Name[sr@ijekavianlatin]=EXR slike
-Name[sr@latin]=EXR slike
-Name[sv]=EXR-bilder
-Name[ta]=இ எக்ஸ் ஆர் பிம்பங்கள்
-Name[te]=ఈఎక్స్ ఆర్ చిత్రాలు
-Name[tg]=Тасвирҳои EXR
-Name[th]=แฟ้มภาพประเภท EXR
-Name[tr]=EXR Resimleri
-Name[ug]=EXR سۈرەتلەر
-Name[uk]=Зображення EXR
-Name[uz]=EXR-rasmlar
-Name[uz@cyrillic]=EXR-расмлар
-Name[vi]=Ảnh EXR
-Name[wa]=Imådjes EXR
-Name[x-test]=xxEXR Imagesxx
-Name[zh_CN]=EXR 图像
-Name[zh_TW]=EXR 影像
-X-KDE-ServiceTypes=ThumbCreator
-MimeType=image/x-exr;
-X-KDE-Library=exrthumbnail
-CacheThumbnail=true
-IgnoreMaximumSize=true
-InitialPreference=2