Coder Social home page Coder Social logo

Add webp support about lximage-qt HOT 19 CLOSED

agaida avatar agaida commented on July 18, 2024
Add webp support

from lximage-qt.

Comments (19)

tsujan avatar tsujan commented on July 18, 2024

I didn't know about WebP. Will look into it.

from lximage-qt.

tsujan avatar tsujan commented on July 18, 2024

It already shows WebP. Just the extension could be added.

from lximage-qt.

agaida avatar agaida commented on July 18, 2024

for me it does not - maybe a fault on my side - and i see no dependencies to webp in lximage-qt

from lximage-qt.

tsujan avatar tsujan commented on July 18, 2024

Put a jpeg image in the same folder, open it with lximage-qt and check Show Thumbnails! Isn't it opened?

It's enough to add the mime type to lximage-qt. They say there are animated webp too but that's another problem.

from lximage-qt.

agaida avatar agaida commented on July 18, 2024

i only see the icons - but can't open the images

from lximage-qt.

tsujan avatar tsujan commented on July 18, 2024

Strange! Here the images can be opened. In fact, there's nothing special about opening WebP; I have a personal Qt5 image viewer that opens it too -- I just added the type to it for convenience and will do the same for lximage-qt.

from lximage-qt.

tsujan avatar tsujan commented on July 18, 2024

i only see the icons - but can't open the images

Maybe it's because of libwebp. Here, on Manjaro, I have it installed. Now I can't check my Debian to see if there's such a package.

Edit: On Debian, it's called libwebp6.

from lximage-qt.

agaida avatar agaida commented on July 18, 2024

is installed, the dev headers are installed - freeglut3 dev headers are installed - something is missed, but i don't know what :)

from lximage-qt.

tsujan avatar tsujan commented on July 18, 2024

OK, Qt supports webp images through qt5-imageformats (qt5-image-formats-plugins in Debian). Install it and try again!

Here, in a simple program, qDebug()<<QImageReader::supportedImageFormats(); gives:

("bmp", "bw", "cur", "dds", "eps", "epsf", "epsi", "exr", "gif", "icns", "ico", "jp2", "jpeg", "jpg", "kra", "mng", "ora", "pbm", "pcx", "pgm", "pic", "png", "ppm", "psd", "ras", "rgb", "rgba", "sgi", "svg", "svgz", "tga", "tif", "tiff", "wbmp", "webp", "xbm", "xcf", "xpm")

Now, the problem is that, if we add webp or other extra formats to the desktop file or the code, the user may still not be able to open them. On the other hand, if we don't add them, LXImage-Qt's potential will remain hidden.

from lximage-qt.

agaida avatar agaida commented on July 18, 2024

thanks - it works for me™

from lximage-qt.

agaida avatar agaida commented on July 18, 2024

@tsujan - erm src/mainwindow.cpp

// popup a file dialog and retrieve the selected image file name
QString MainWindow::openFileName() {
  QString filterStr;
  QList<QByteArray> formats = QImageReader::supportedImageFormats();

Nothing to do - adding the dependency to the package is sufficient, the formats are dynamic.

from lximage-qt.

tsujan avatar tsujan commented on July 18, 2024

Unless webp is added to the MimeType section of lximage-qt.desktop, lximage-qt won't appear on the right-click menu of webp images. It's not a big deal because the user could change associations.

from lximage-qt.

pmattern avatar pmattern commented on July 18, 2024

IMO it would be pretty much desirable to have WebP in LXImage-Qt's desktop entry file.
Small problem is a MIME (internet media) type doesn't seem to be assigned yet: http://www.iana.org/assignments/media-types/media-types.xhtml#image...

from lximage-qt.

tsujan avatar tsujan commented on July 18, 2024

IMO it would be pretty much desirable to have WebP in LXImage-Qt's desktop entry file

I agree but the problem is that, when the user doesn't have qt5-imageformats installed, he clicks on a WebP image and it won't open -- unless, somehow, we make qt5-imageformats an installation dependency.

from lximage-qt.

agaida avatar agaida commented on July 18, 2024

Runtime dependencies are up to the distribution maintainers i guess - but we should mention qt5-imageformats in the README.md.
For some purists a dependency will be to hard, so i only recommend it (recommends are installed by default in debian :P )

from lximage-qt.

pmattern avatar pmattern commented on July 18, 2024

Yeah. I mean if I got it right Qt Image Formats does not have to be taken into account at all at build time in order to be used. Rather, if LXImage-Qt was compiled that way it can still handle all file formats supported by Qt Image Formats when the latter is added on a running system.

@tsujan
In my previous post I was referring to the desktop entry file only. And regarding this file I still think there's nothing reasonable we can do right now as we would have to file a MIME Type which simply isn't assigned yet.

from lximage-qt.

tsujan avatar tsujan commented on July 18, 2024

In my previous post I was referring to the desktop entry file only.

Yes, I know.

And regarding this file I still think there's nothing reasonable we can do right now as we would have to file a MIME Type which simply isn't assigned yet.

That's correct.

from lximage-qt.

ralf3u avatar ralf3u commented on July 18, 2024

I wanted to open a webp-image from the file-manager PCManFM-Qt 1.1.0 in Lubuntu 22.10 with LXQt 1.1.0. In the file-manager I can see a thumbnail. But if I press enter, then the image does not appear in LXImage-Qt 1.1.0.

According to #68 (comment), I did this in the terminal:

sudo apt install qt5-imageformats

The answer was: Unable to locate package qt5-imageformats.

Then according to #68 (comment), I did this in the terminal:

sudo apt install qt5-image-formats-plugins

I closed the file-manager. I opened it again. In the file-manager I can see a thumbnail. But if I press enter then the image still does not appear in LXImage-Qt 1.1.0.

What did I do wrong or rather what should I do to see webp-images in LXImage-Qt?
Thank you for an answer in advance.

from lximage-qt.

tsujan avatar tsujan commented on July 18, 2024

what should I do to see webp-images in LXImage-Qt?

Right click → Open With... → Other Applications → Choose lximage-qt once for all.

from lximage-qt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.