HomePhabricator
Diffusion Comm 253f5590e279

[native] Implement thumbhash generation on Android

Description

[native] Implement thumbhash generation on Android

Summary:
Implemented the generateThumbHash() function on iOS.
Used code from the thumbhash repository: https://github.com/evanw/thumbhash

Didn't convert the original library's Java code to Kotlin because it's unnecessary - interop between these languages works flawlessly. Conversion could potentially introduce bugs.

As gathering bitmap pixels from URI is a bit tricky, I put some in-code comments

Depends on D7779

Test Plan: One easy way is to hook this to expo-image-picker result (e.g. avatar picker) and provide picked uri to the function. It should usually return a 43 char long string (sometimes longer if there is alpha channel).

Reviewers: atul, marcin, varun, ashoat

Reviewed By: atul

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D7780

Details

Provenance
bartekAuthored on May 10 2023, 5:57 AM
Reviewer
atul
Differential Revision
D7780: [native] Implement thumbhash generation on Android
Parents
rCOMM991a876865aa: [native] Implement thumbhash generation on iOS
Branches
Unknown
Tags
Unknown