[MOD-2490] ImageFactory: JPEG EXIF orientation is wrongly ignored
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-10-19T23:48:16.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | ImageFactory |
Labels | ImageFactory, android, exif, image, ios, jpeg, orientation |
Reporter | Rene Pot |
Assignee | Joshua Quick |
Created | 2019-02-11T15:44:31.000+0000 |
Updated | 2021-10-19T23:48:16.000+0000 |
Description
*Summary:*
All of the "ti.imagefactory" module's APIs ignore a JPEG's EXIF orientation if assigned on both Android and iOS. This typically happens with camera photos or images from the photo gallery. This causes the images generated from this module's methods such as
compress()
, imageAsCropped()
, etc. to have the wrong orientation.
*Solution:*
All APIs should compensate for the JPEG's EXIF orientation and generate a new image using an upright orientation.
*Note:*
We could copy the EXIF orientation from the source image to the generated image, but this will only work for JPEGs and not PNGs. Our APIs support a "format" option which allows it to generate a PNG, making this not a viable solution.
*Work-Around:*
There is a community module "fh.imagefactory" that handles EXIF orientation, but it's for Android only.
https://github.com/freshheads/fh.imagefactory
PR (ti.imagefactory): https://github.com/appcelerator-modules/ti.imagefactory/pull/192
Fixed in release... https://github.com/appcelerator-modules/ti.imagefactory/releases/tag/v5.1.0-android