> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Work with Wix Media

## Article: Work with Wix Media

## Article Link: https://dev.wix.com/docs/api-reference/articles/sdk-setup-and-usage/work-with-wix-media.md

## Article Content:

# Work with Wix Media

The [SDK Media API](https://dev.wix.com/docs/sdk/core-modules/sdk/media.md) contains functionality for working with Wix Media resources.

> **Note:** This API isn't necessary when [extending Wix sites](https://dev.wix.com/docs/api-reference/articles/platform-overview/about-wix-site-development.md) or when [coding in Blocks](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-blocks/code-in-blocks/about-coding-in-blocks.md).

## Overview

The [SDK Media API](https://dev.wix.com/docs/sdk/core-modules/sdk/media.md) enables you to get absolute URLs for Wix Media resources, including scaled and cropped images.

With the [SDK Media API](https://dev.wix.com/docs/sdk/core-modules/sdk/media.md), you can:

- Get an absolute URL for a Wix Media resource.
- Scale a Wix Media image to fit specified dimensions.
- Scale a Wix Media image to fill specified dimensions.
- Crop a Wix Media image.

Wix APIs identify Wix Media resources using internal identifiers with the following structure:

```url
wix:image://v1/<uri>/<filename>#originWidth=<width>&originHeight=<height>[&watermark=<watermark_manifest_string>]
```

For example, a product or cart item object may refer to its associated image with an identifier such as `"wix:image://v1/3c76e2_c5331f937348492a97df87b..."`.

You can use the SDK Media API to obtain an absolute URL for such an image, so you can access and manipulate it in your own code. You can obtain a URL for the original image, or for a scaled or cropped version of the image.

## Example

This example shows how to use `getImageUrl()` to obtain an absolute URL from the Wix Media identifier for an image provided by the `getCurrentCart()` method.

```javascript
import { media } from "@wix/sdk";
import { currentCart } from "@wix/ecom";

const { cart } = await currentCart.getCurrentCart();

const { url } = media.getImageUrl(cart.lineItems[0].image);
```