Commit 86928426 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

[piexwasm] Remove files app ImageOrientation dependency

JEITA EXIF image orientation is a number in [1..8]. PIEX C++ defaults
to 1 if there is no image orientation or its value is invalid. Return
the value in the PiexLoaderResponse and let the client code deal with
converting it to other types [1].

[1] In files app, make image_request_task.js convert the value in the
PiexLoaderResponse to ImageOrientation type. No change in behavior.

Bug: 1132695
Change-Id: I728680d17c31426d72b6b09bd52ee821540cbcd0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2432231Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Auto-Submit: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811119}
parent 5e5c039e
......@@ -334,7 +334,8 @@ ImageRequestTask.prototype.downloadOriginal_ = function(onSuccess, onFailure) {
this.piexLoader_.load(this.request_.url, chrome.runtime.reload)
.then(
function(data) {
this.request_.orientation = data.orientation;
this.request_.orientation =
ImageOrientation.fromExifOrientation(data.orientation);
this.request_.colorSpace = data.colorSpace;
this.ifd_ = data.ifd;
this.contentType_ = data.mimeType;
......
......@@ -89,11 +89,11 @@ function PiexLoaderResponse(data) {
this.mimeType = data.mimeType || 'image/jpeg';
/**
* @public {!ImageOrientation}
* JEITA EXIF image orientation being an integer in [1..8].
* @public {number}
* @const
*/
this.orientation =
ImageOrientation.fromExifOrientation(data.orientation);
this.orientation = data.orientation;
/**
* @public {ColorSpace}
......
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