---
title: "init(imageURL:orientation:)"
framework: foundationmodels
role: symbol
role_heading: Initializer
path: "foundationmodels/attachment/init(imageurl:orientation:)"
---

# init(imageURL:orientation:)

Creates an attachment from a file URL pointing to an image.

## Declaration

```swift
init(imageURL: URL, orientation: CGImagePropertyOrientation? = nil)
```

## Parameters

- `imageURL`: A URL to the image file to attach.
- `orientation`: The orientation to apply to the image. Pass nil to use the image’s natural orientation.

## See Also

### Creating an attachment instance

- [init(_:orientation:)](foundationmodels/attachment/init(_:orientation:).md)
