MCPcopy Create free account
hub / github.com/ad3lre/echo / drawFirstFrameFromLoadedImage

Function drawFirstFrameFromLoadedImage

frontend/src/utils/gifFirstFrame.ts:7–21  ·  view source on GitHub ↗

* Draw the first decoded frame of an image into a PNG data URL (freezes GIFs). * Returns null if decode/canvas fails (e.g. tainted canvas from cross-origin without CORS). * * Tries: CORS Image → plain Image → same-origin fetch+blob (cookie-aware) for relative/API URLs.

(img: HTMLImageElement)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Calls

no outgoing calls

Tested by

no test coverage detected