@primestyleai/tryon 5.8.20 → 5.8.21

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.
@@ -11116,18 +11116,23 @@ function PrimeStyleTryonInner({
11116
11116
  setBodyLandmarks(null);
11117
11117
  detectMeasurementLines(objUrl).then((lines) => {
11118
11118
  modelPoseRef.current = lines;
11119
- }).catch(() => {
11120
- });
11121
- detectBodyLandmarks(objUrl).then((lm) => {
11119
+ return lines;
11120
+ }).catch(() => null);
11121
+ const landmarksPromise = detectBodyLandmarks(objUrl).then((lm) => {
11122
11122
  setBodyLandmarks(lm);
11123
- }).catch(() => {
11124
- });
11123
+ return lm;
11124
+ }).catch(() => null);
11125
+ const landmarks = await landmarksPromise;
11125
11126
  const payload = {
11126
11127
  method: "photo",
11127
11128
  locale: sizingCountry,
11128
11129
  sizingUnit,
11129
11130
  product: { title: productTitle, description: "", variants: [] },
11130
11131
  bodyImage: data.photoBase64,
11132
+ // BlazePose landmarks (normalized 0–1 coordinates). The backend uses
11133
+ // these to compute exact pixel distances and feed them to Gemini as
11134
+ // anchors instead of asking it to estimate visually.
11135
+ bodyLandmarks: landmarks || void 0,
11131
11136
  measurements: {
11132
11137
  gender: data.gender,
11133
11138
  height: data.height,
@@ -20540,18 +20540,23 @@ function PrimeStyleTryonInner({
20540
20540
  setBodyLandmarks(null);
20541
20541
  detectMeasurementLines(objUrl).then((lines) => {
20542
20542
  modelPoseRef.current = lines;
20543
- }).catch(() => {
20544
- });
20545
- detectBodyLandmarks(objUrl).then((lm) => {
20543
+ return lines;
20544
+ }).catch(() => null);
20545
+ const landmarksPromise = detectBodyLandmarks(objUrl).then((lm) => {
20546
20546
  setBodyLandmarks(lm);
20547
- }).catch(() => {
20548
- });
20547
+ return lm;
20548
+ }).catch(() => null);
20549
+ const landmarks = await landmarksPromise;
20549
20550
  const payload = {
20550
20551
  method: "photo",
20551
20552
  locale: sizingCountry,
20552
20553
  sizingUnit,
20553
20554
  product: { title: productTitle, description: "", variants: [] },
20554
20555
  bodyImage: data.photoBase64,
20556
+ // BlazePose landmarks (normalized 0–1 coordinates). The backend uses
20557
+ // these to compute exact pixel distances and feed them to Gemini as
20558
+ // anchors instead of asking it to estimate visually.
20559
+ bodyLandmarks: landmarks || void 0,
20555
20560
  measurements: {
20556
20561
  gender: data.gender,
20557
20562
  height: data.height,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.8.20",
3
+ "version": "5.8.21",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",