@primestyleai/tryon 5.10.16 → 5.10.17

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.
@@ -24147,6 +24147,16 @@ function PrimeStyleTryonInner({
24147
24147
  const minVisible = new Promise((r2) => setTimeout(r2, 4500));
24148
24148
  try {
24149
24149
  const faceResult = await detectFaceMeasurements(objUrl);
24150
+ if (!faceResult) {
24151
+ console.warn("[ps-sdk] face detection returned no result — likely a full-body photo for a face/head product");
24152
+ await minVisible;
24153
+ const msg = measurementType === "head" ? t2("We couldn't detect your head clearly. Please upload a close-up photo that shows your full head and ears.") : t2("We couldn't detect your face clearly. Please upload a close-up selfie that shows both eyes.");
24154
+ setErrorMessage(msg);
24155
+ setView("error");
24156
+ onError?.({ message: msg, code: "FACE_DETECTION_FAILED" });
24157
+ setSizingLoading(false);
24158
+ return;
24159
+ }
24150
24160
  if (faceResult) setFaceLandmarks(faceResult.landmarks);
24151
24161
  const facePayload = {
24152
24162
  product: { title: productTitle, productId: effectiveProductId },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.10.16",
3
+ "version": "5.10.17",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",