Page MenuHomePhabricator

[web] Move `exifRotate` from `input-state-container` to `media-utils`
ClosedPublic

Authored by atul on Jun 28 2023, 3:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 28, 8:21 PM
Unknown Object (File)
Fri, Jun 28, 1:55 AM
Unknown Object (File)
Thu, Jun 27, 1:38 PM
Unknown Object (File)
Wed, Jun 26, 9:29 AM
Unknown Object (File)
Tue, Jun 25, 10:12 PM
Unknown Object (File)
Mon, Jun 24, 2:48 PM
Unknown Object (File)
Sat, Jun 15, 11:04 AM
Unknown Object (File)
Wed, Jun 12, 6:04 PM
Subscribers

Details

Summary

I needed to use validateFile outside of input-state-container, but saw that it took exifRotate as an argument.

I first considered moving exifRotate to media-utils and exporting it globally so I could access it from input-state-container and elsewhere. But upon reading the code further, it looks like we only ever use exifRotate in processFile(file: File), so I just moved it right above without exporting.


Depends on D8363 (kind of)

Test Plan

Logged value of browser and exifRotate in Safari/Chrome/FireFox:

0a580a.png (218×466 px, 27 KB)

8430c3.png (254×498 px, 32 KB)

fbcb2c.png (90×896 px, 19 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

remove extraneous type export

web/media/media-utils.js
101–103 ↗(On Diff #28235)

I sandwiched this between the type definition and the function to make it clear that these lines are "connected" to processFile... but happy to move it above type definition if that's more consistent.

atul published this revision for review.Jun 28 2023, 3:52 PM
This revision is now accepted and ready to land.Jun 28 2023, 6:50 PM
This revision was landed with ongoing or failed builds.Jul 28 2023, 2:53 PM
This revision was automatically updated to reflect the committed changes.