Commit 26907789 authored by Kuo Jen Wei's avatar Kuo Jen Wei Committed by Commit Bot

[CCA] Fix orientation EXIF lose after square cut.

Fix by correcting the orientation before square cut.

Bug: b/141670036
Test: Take photo in square mode with different orientation, verify the
orientation of result file is correct.

Change-Id: I7350d0846c438e8f6f4af5482ccef3b03df4ee23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857801Reviewed-by: default avatarShik Chen <shik@chromium.org>
Commit-Queue: Kuo Jen Wei <inker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705474}
parent f0eb7e08
......@@ -834,6 +834,11 @@ cca.views.camera.Square = function(stream, doSavePhoto, captureResolution) {
Object.seal(this);
this.doSavePhoto_ = async (result, ...args) => {
// Since the image blob after square cut will lose its EXIF including
// orientation information. Corrects the orientation before the square cut.
result.blob = await new Promise(
(resolve, reject) =>
cca.util.orientPhoto(result.blob, resolve, reject));
result.blob = await this.cropSquare(result.blob);
await this.doAscentSave_(result, ...args);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment