Skip to content

Fix setImage latency in mobile-fitting-room: resize garment images to max 1024px#12

Open
tomershlasky wants to merge 1 commit intomainfrom
slack-agent/fix-mobile-fitting-room-image-resize
Open

Fix setImage latency in mobile-fitting-room: resize garment images to max 1024px#12
tomershlasky wants to merge 1 commit intomainfrom
slack-agent/fix-mobile-fitting-room-image-resize

Conversation

@tomershlasky
Copy link
Copy Markdown
Collaborator

Summary

  • The mobile-fitting-room example was calling setImage with the full-resolution blob from urlToImageBlob, while full-featured and outfit-builder both pipe through resizeImageBlob(blob, 1024) first. High-res garment images (e.g. 2000–4000px from fashion sites) cause significant switch latency.
  • Added resizeImageBlob call in applyProduct and in the enterFitRoom initial image path.
  • Updated the README best-practices section to document the 512–1024px recommendation for setImage and note that oversized images increase switch latency.

Root cause

Customer (SwapCommerce) reported ~6s delays switching outfits via set_image. Their example images were 530KB–1.5MB. The mobile-fitting-room example had the same bug: no image resize before setImage, unlike the other examples.

Requested by Jake Rothman in Slack (#swapcommerce--decart)


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants