@umituz/react-native-ai-generation-content 1.17.285 → 1.17.286
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-generation-content",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.286",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -93,14 +93,21 @@ export const usePartnerStep = (options: UsePartnerStepOptions) => {
|
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
// Try to read as base64, with fallback
|
|
97
|
+
let base64: string | undefined;
|
|
98
|
+
try {
|
|
99
|
+
base64 = await FileSystem.readAsStringAsync(asset.uri, {
|
|
100
|
+
encoding: "base64",
|
|
101
|
+
});
|
|
102
|
+
} catch {
|
|
103
|
+
// If base64 conversion fails, continue without it
|
|
104
|
+
base64 = undefined;
|
|
105
|
+
}
|
|
99
106
|
|
|
100
107
|
const uploadedImage: UploadedImage = {
|
|
101
108
|
uri: asset.uri,
|
|
102
109
|
previewUrl: asset.uri,
|
|
103
|
-
base64: `data:image/jpeg;base64,${base64}
|
|
110
|
+
base64: base64 ? `data:image/jpeg;base64,${base64}` : asset.uri,
|
|
104
111
|
width: asset.width,
|
|
105
112
|
height: asset.height,
|
|
106
113
|
};
|