Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/06-api-reference/classes/TextToImageModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ The input shape as an array of numbers.

> **interrupt**(): `void`

Defined in: [modules/computer_vision/TextToImageModule.ts:133](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts#L133)
Defined in: [modules/computer_vision/TextToImageModule.ts:138](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts#L138)

Interrupts model generation. The model is stopped in the nearest step.

Expand Down
4 changes: 2 additions & 2 deletions packages/bare-resource-fetcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"clean": "del-cli lib"
},
"peerDependencies": {
"@dr.pogodin/react-native-fs": "^2.0.0",
"@kesha-antonov/react-native-background-downloader": "^4.0.0",
Comment thread
msluszniak marked this conversation as resolved.
"@dr.pogodin/react-native-fs": ">=2.0.0",
"@kesha-antonov/react-native-background-downloader": ">=4.0.0",
"react-native": "*",
"react-native-executorch": "*"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/expo-resource-fetcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
},
"peerDependencies": {
"expo": ">=54.0.0",
"expo-asset": "^12.0.0",
"expo-file-system": "^19.0.0",
"expo-asset": ">=12.0.0",
"expo-file-system": ">=19.0.0",
"react-native": "*",
"react-native-executorch": "*"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ResourceFetcher } from '../../utils/ResourceFetcher';
import { ResourceSource } from '../../types/common';
import { BaseModule } from '../BaseModule';
import { Buffer } from 'buffer';

import { PNG } from 'pngjs/browser';
import { RnExecutorchErrorCode } from '../../errors/ErrorCodes';
import { parseUnknownError, RnExecutorchError } from '../../errors/errorUtils';
Expand Down Expand Up @@ -121,10 +121,15 @@ export class TextToImageModule extends BaseModule {
return '';
}
const png = new PNG({ width: imageSize, height: imageSize });
png.data = Buffer.from(outputArray);
png.data = outputArray as unknown as Buffer;
const pngBuffer = PNG.sync.write(png, { colorType: 6 });
const pngString = pngBuffer.toString('base64');
return pngString;
const pngArray = new Uint8Array(pngBuffer as unknown as ArrayBufferLike);
let binary = '';
const chunkSize = 8192;
for (let i = 0; i < pngArray.length; i += chunkSize) {
binary += String.fromCharCode(...pngArray.subarray(i, i + chunkSize));
}
return btoa(binary);
Comment thread
msluszniak marked this conversation as resolved.
}

/**
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4429,8 +4429,8 @@ __metadata:
react-native-executorch: "workspace:*"
typescript: "npm:~5.9.2"
peerDependencies:
"@dr.pogodin/react-native-fs": ^2.0.0
"@kesha-antonov/react-native-background-downloader": ^4.0.0
"@dr.pogodin/react-native-fs": ">=2.0.0"
"@kesha-antonov/react-native-background-downloader": ">=4.0.0"
react-native: "*"
react-native-executorch: "*"
languageName: unknown
Expand All @@ -4450,8 +4450,8 @@ __metadata:
typescript: "npm:~5.9.2"
peerDependencies:
expo: ">=54.0.0"
expo-asset: ^12.0.0
expo-file-system: ^19.0.0
expo-asset: ">=12.0.0"
expo-file-system: ">=19.0.0"
react-native: "*"
react-native-executorch: "*"
languageName: unknown
Expand Down
Loading