Qt增加webp格式支持
Webp 是一种图片文件格式,能在相同质量的情况下比 PNG 文件尺寸小巧。
Chrome 应用商店图片已全部转换为 WebP 格式
YY(基于Qt开发)也已经把图片格式换成webp了
http://img2webp.net/ 这个网站 将 jpg/png/gif 拖拽进入就可以转换了,转换后的 WebP 文件会在IMG2WebP 上保存一天。
安装默认的参数来看, 转换后的webp图片体积一般在原图的1/10到1/3. 这是非常可观的.
唯一的缺点就是支持平台少, 目前只有chrome支持
QT5.3 已经纳入webp.
Qt5.3之前的版本如果想要支持webp, 则需要自己编译.
参考 Qt bug report
Change I9409e894: Added webp image format plugin
https://codereview.qt-project.org/#change,56026
需要在qt-src-5.1.1\qtimageformats 下增加这些文件
config.tests/libwebp/libwebp.cpp lines Side-by-Side Unified
config.tests/libwebp/libwebp.pro lines Side-by-Side Unified
qtimageformats.pro +, - Side-by-Side Unified
src/plugins/imageformats/imageformats.pro +, - Side-by-Side Unified
src/plugins/imageformats/webp/main.cpp lines Side-by-Side Unified
src/plugins/imageformats/webp/qwebphandler.cpp lines Side-by-Side Unified
src/plugins/imageformats/webp/qwebphandler_p.h lines Side-by-Side Unified
src/plugins/imageformats/webp/webp.json lines Side-by-Side Unified
src/plugins/imageformats/webp/webp.pro lines Side-by-Side Unified
tests/auto/auto.pro +, - Side-by-Side Unified
tests/auto/webp/images/kollada.png new Unified
tests/auto/webp/images/kollada.webp new Unified
tests/auto/webp/images/kollada_lossless.webp new Unified
tests/auto/webp/images/lena.jpg new Unified
tests/auto/webp/images/lena.webp new Unified
tests/auto/webp/images/lena_lossless.webp new Unified
tests/auto/webp/tst_qwebp.cpp lines Side-by-Side Unified
tests/auto/webp/webp.pro lines Side-by-Side Unified
tests/auto/webp/webp.qrc
这些文件我打包了一份. http://download.csdn.net/detail/lingdhox/7303513
你也可以去Qt的git上下载这些文件, 然后覆盖过去
注意:
我编译的版本是5.1.1, 如果是其他版本的话, 请不要直接覆盖.
最后, 执行下 nmake module-qtimageformats
ps: 在configure时, 可以加上参数 -no-plugin-manifests, 就不会产生manifests文件
ps2: webkit 对webp的支持写在features.prf中, config_libwebp: WEBKIT_CONFIG += use_webp
Qt增加webp格式支持的更多相关文章
- iOS开发中WebP格式的64位支持处理
几个月前我们项目中添加了对webp格式的处理.期间遇到了一些问题,这是当中的一个小的记录. 官方下载地址:https://code.google.com/p/webp/downloads/list 对 ...
- SDWebImage支持WebP格式图片
SDWebImage本身就已经支持了webp格式的图片 1.下载libwebp https://github.com/webmproject/libwebp 然后你需要先安装好有homebrew或者m ...
- 火狐不支持webp格式的图片
<!DOCTYPE html> <html lang="en"> <style> ul{list-style: none;} li{float: ...
- 通读SDWebImage③--gif和webP的支持、不同格式图片的处理、方向处理
本文目录 NSData+ImageContentType: 根据NSData获取MIME UIImage+GIF UIImage+WebP UIImage+MultiFormat:根据NSData相应 ...
- 让photoshop cc 支持 webp格式
下载WebP.8bi文件,看PS cc 是32位还是64位,找到对应的文件. brushes8.com-2017-11-03_08-29-21_654098.7z 把 WebP.8bi 复制到pho ...
- 将jpg压缩成webp格式的图片
cwebp名称 cwebp -压缩图像文件为的WebP文件概要 cwebp [选项] INPUT_FILE -o output_file.webp描述 cwebp压缩使用的WebP格式的图像.输入格式 ...
- centos下 将(jgp、png)图片转换成webp格式
由于项目要求需要将jpg.png类型的图片 转换成webp格式,最开始使用了php gd类库里 imagewebp 方法实现,结果发现转换成的webp格式文件会偶尔出现空白内容的情况.像创建了一个透 ...
- 在html中如何兼容使用WebP格式的图片【图片升级到WebP】
把已有的图片转换为WebP格式 要使用WebP格式,需要将你网站用到的图片都制作一份WebP格式的版本,如果你使用CDN服务商,它们一般都会提供转码到WebP格式的选项.如又拍云: 增加这样的配置后, ...
- Qt国际化(Q_DECLARE_TR_FUNCTIONS() 宏给非Qt类添加翻译支持,以前没见过QTextEncoder和QTextDecoder和QLibraryInfo::location()和QEvent::LanguageChange)
Internationalization with Qt 应用程序的国际化就是使得程序能在国际间可用而不仅仅是在本国可用的过程. Relevant Qt Classes andAPIs 以下的类支持Q ...
随机推荐
- Namespaces(命名空间)
datastore,Blobstore,memcache一起为应用存储数据.这对于在全球范围内分割数据是有用的.比如,一个应用可以为多个公司服务,每个公司可以看到它自己的隔离的应用实例,没有公司可以看 ...
- Windows Azure中的配置管理
最近一直在做项目迁移的工作,由传统的ASP.NET转到Windows Azure,这里介绍一下Azure的配置管理.在传统的WinForm或ASP.NET项目下,配置文件为web.config(app ...
- leetcode@ [316] Remove Duplicate Letters (Stack & Greedy)
https://leetcode.com/problems/remove-duplicate-letters/ Given a string which contains only lowercase ...
- usb mass storage device
Problem adding USB host device to KVM Windows guest machine. Status: CLOSED CURRENTRELEASE Aliases ...
- 教程-在F9后提示内存错误,点击了乎略,之后怎么取消乎略?
问题现象:F9后,调试程序,提示内存错误,点击了“乎略”.之后再也没有出现错误了.可是想改这个BUG时,没法取消乎略了. 问题原因:在DLEPHI的选项中是这么一个地方是可以设置的. 问题处理:打开D ...
- POJ 2240 Arbitrage (求负环)
Arbitrage 题目链接: http://acm.hust.edu.cn/vjudge/contest/122685#problem/I Description Arbitrage is the ...
- ds18b20里的 温度值正负判断 为什么要判断大于6348 ,为什么取这个值?
http://zhidao.baidu.com/question/576118682.html?quesup2&oldq=1
- codeforces 631A Interview
A. Interview time limit per test 1 second memory limit per test 256 megabytes input standard input o ...
- Spring Data JPA教程, 第二部分: CRUD(翻译)
我的Spring Data Jpa教程的第一部分描述了,如何配置Spring Data JPA,本博文进一步描述怎样使用Spring Data JPA创建一个简单的CRUD应用.该应用要求如下: pe ...
- 深入学习APC
一.前言 在NT中,有两种类型的APCs:用户模式和内核模式.用户APCs运行在用户模式下目标线程当前上下文中,并且需要从目标线程得到许可来运行.特别是,用户模式的APCs需要目标线程处在alerta ...