Skip to content

🎥 Make videos programmatically with React

update get-image-dimensions - I don't think CORS applies here

Jonny Burgera304bac3d59c
diff --git a/packages/docs/docs/get-image-dimensions.md b/packages/docs/docs/get-image-dimensions.md
index c60bdc10c7..e68c62a924 100644
--- a/packages/docs/docs/get-image-dimensions.md
+++ b/packages/docs/docs/get-image-dimensions.md
@@ -5,14 +5,10 @@ id: get-image-dimensions
crumb: "@remotion/media-utils"
---
-_Part of the `@remotion/media-utils` package of helper functions.Available from v4.0.143._
+_Part of the `@remotion/media-utils` package of helper functions. Available from v4.0.143._
Takes an image `src`, retrieves the dimensions of an image.
-:::info
-To avoid [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) problems, ensure that you have the proper permissions to access the image and that the image server is configured with appropriate CORS headers to allow requests from your domain.
-:::
-
## Arguments
### `src`
@@ -44,12 +40,10 @@ The image height, in pixels (px).
// @target: ESNext
import { getImageDimensions } from "@remotion/media-utils";
-await getImageDimensions("https://example.com/remote-image.png");
-/* {
- width: 100,
- height: 100
-} */
-
+const { width, height } = await getImageDimensions(
+ "https://example.com/remote-image.png",
+);
+console.log(width, height);
```
## Caching behavior