Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2928] ImageFactory: Add WebP format support

GitHub Issuen/a
TypeNew Feature
Resolution Date2021-10-19T23:49:23.000+0000
Affected Version/sn/a
Fix Version/sn/a
LabelsImageFactory, android, compress, image, webp
ReporterJoshua Quick
AssigneeJoshua Quick


*Summary:* We should add ".webp" image format support to the "ti.imagefactory" module on Android. *Proposed Solution:* All transformation methods such as imageAsRotated(), imageAsResized(), etc. already support a "format" option which can be set to ImageFactory.JPEG or ImageFactory.PNG. We should add a new ImageFactory.WEBP constant and support compressing to that format. We should also add a 3rd optional argument to the compress() method. Currently, this method defaults to JPEG, but this will allow it be formatted to WEBP or PNG as well.
compress(blob, quality [, format ])
The following Android-only method should look at the "fileUrl" argument's file extension to determine which image format to compress to. That is, if the file extension is .webp, then it should compress to WebP.
compressToFile(blob, quality, fileUrl)
*Note:* iOS does not natively support the WebP image file format. This will be an Android only feature.


  1. Joshua Quick 2021-09-15

    PR (ti.imagefactory): https://github.com/appcelerator-modules/ti.imagefactory/pull/192
  2. Joshua Quick 2021-10-19

    Added to release... https://github.com/appcelerator-modules/ti.imagefactory/releases/tag/v5.1.0-android

JSON Source