Skip to content

feat: add buildFifeSuffix utility for high-res screenshot URLs#156

Open
icebear0828 wants to merge 1 commit intogoogle-labs-code:mainfrom
icebear0828:feat/fife-image-options
Open

feat: add buildFifeSuffix utility for high-res screenshot URLs#156
icebear0828 wants to merge 1 commit intogoogle-labs-code:mainfrom
icebear0828:feat/fife-image-options

Conversation

@icebear0828
Copy link
Copy Markdown
Contributor

Summary

  • Adds buildFifeSuffix() utility and FifeImageOptions type for appending FIFE sizing parameters to screenshot URLs
  • Exports both from the main entry point so users can request higher-resolution images from getImage()

Fixes #152

Usage

import { buildFifeSuffix } from "@google/stitch-sdk";

const url = await screen.getImage();
const hiRes = url + buildFifeSuffix({ width: 780 });           // =w780
const both  = url + buildFifeSuffix({ width: 780, height: 1688 }); // =w780-h1688

E2E verification (real FIFE service)

Suffix Dimensions Size
(none) 187×512 47 KB
=w780 780×2132 345 KB
=w780-h1688 618×1688 316 KB

Test plan

  • npm run test — 87 tests pass (includes 6 new fife.test.ts)
  • npm run test:scripts — 57 tests pass
  • npm run test:smoke — all smoke checks pass
  • E2E: 3 rounds against live FIFE service, all resolve to valid images

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.

getImage() returns low-resolution screenshots — no way to request higher resolution

1 participant