feat(exif): write the Xiaomi watermark blob (0x889e) so HyperOS Gallery can frame our captures

HyperOS Gallery reads EXIF 0x889e (a JSON blob) to build its watermark
frame; without it a photo fails with "cannot recognize the parameters".
CameraX/HAL never supplies that vendor tag, so a capture from this app
lacked it while a stock-camera photo carried it.

Read back the same props the stock camera derives the blob from
(ro.product.device / ro.product.marketname / Build.MANUFACTURER) via the
native module, synthesize the blob in exifWrite, and write it only when
the source has none and the device is Xiaomi/Redmi/POCO - a source blob
is never overwritten.
This commit is contained in:
2026-09-11 18:47:01 +07:00
parent 33123d47fd
commit 17ee01b62a
6 changed files with 163 additions and 3 deletions
+2 -1
View File
@@ -10,7 +10,7 @@ import { CINEMA_SKSL, getCinemaUniforms, cinemaIsActive } from './cinemaShader';
import { drawFrameOnCanvas, polaroidLayout, POLAROID_CARD, POLAROID_WIN_W, wallframeLayout, WALLFRAME_W, WALLFRAME_H, WALLFRAME_LAND_W, WALLFRAME_LAND_H } from './frameUtils';
import { patchJpegDpi } from './jpegDpi';
import { writeJpegExif } from './exifWrite';
import { nextPhotoPath, readPhotoBytes } from './photoMeta';
import { nextPhotoPath, readPhotoBytes, getDeviceIdentity } from './photoMeta';
import { applyPhotoRotation } from './skiaImage';
export interface ExportResult {
@@ -721,6 +721,7 @@ export async function processAndExportPhoto(
width: resultImage.width(),
height: resultImage.height(),
dpi: options?.dpi ?? null,
device: getDeviceIdentity(),
},
await readPhotoBytes(sourceUri)
);