expo-ble模块测试demo 增加图片缩放处理

This commit is contained in:
Yudi Xiao
2025-12-12 16:58:57 +08:00
parent 07a66f3923
commit b6fc903105
3 changed files with 8 additions and 4 deletions

View File

@@ -437,7 +437,10 @@ export const useBleExplorer = () => {
if (!isJpeg) {
console.debug(`Converting image to JPEG...`);
const context = ImageManipulator.ImageManipulator.manipulate(media.uri);
const context = ImageManipulator.ImageManipulator.manipulate(media.uri).resize({
width: BLE_UUIDS.SCREEN_SIZE,
height: BLE_UUIDS.SCREEN_SIZE
});
const imageRef = await context.renderAsync();
const result = await imageRef.saveAsync({
compress: 1,