This project is a plugin for Qt4 that adds support for WebP image formats. It allows applications using Qt4 to read and write images in the WebP format, which provides better compression for images compared to traditional formats like JPEG and PNG.
- Read WebP images: Decode and display WebP images in your Qt4 applications.
- Write WebP images: Encode images to WebP format for efficient storage and transfer.
- Efficient compression: Leverage WebP's advanced compression algorithms to save space without compromising quality.
- Qt4: Ensure you have Qt4 installed on your system. You can download it from the official Qt website.
- libwebp: This plugin relies on the libwebp library for encoding and decoding WebP images. Install it using your package manager.
-
Clone the repository:
git clone https://github.com/qtinsider/webp.git cd webp
-
Build the plugin:
qmake make
-
Install the plugin: Copy the resulting shared library to your Qt plugins directory.
Include the plugin in your Qt application as follows:
#include <QtGui>
#include "qwebphandler.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QImageReader reader("image.webp");
if (reader.supportsOption(QImageIOHandler::Size)) {
QSize size = reader.size();
qDebug() << "Image size:" << size;
}
return app.exec();
}