@zodic/shared 0.0.351 → 0.0.353
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 +1 -1
- package/utils/faceSwapHelpers.ts +3 -3
package/package.json
CHANGED
package/utils/faceSwapHelpers.ts
CHANGED
|
@@ -28,7 +28,7 @@ export const resizeImage = async (
|
|
|
28
28
|
url: string,
|
|
29
29
|
label: string
|
|
30
30
|
): Promise<ArrayBuffer> => {
|
|
31
|
-
const resizeEndpoint = `https://
|
|
31
|
+
const resizeEndpoint = `https://zodic-image-handler.fly.dev/resize-image?url=${encodeURIComponent(
|
|
32
32
|
url
|
|
33
33
|
)}`;
|
|
34
34
|
try {
|
|
@@ -159,8 +159,8 @@ export const sendRequest = async (
|
|
|
159
159
|
throw new Error('PiAPI FaceSwap Error: Invalid response structure');
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
// Check the response code
|
|
163
|
-
if (data.code !== 0) {
|
|
162
|
+
// Check the response code (accept both 0 and 200 as success)
|
|
163
|
+
if (data.code !== 0 && data.code !== 200) {
|
|
164
164
|
const errorMsg = data.message || 'Unknown error';
|
|
165
165
|
const detailedError = data.data.error
|
|
166
166
|
? ` - ${data.data.error.message || 'No detailed error message'}`
|