# Restore the ability to drag and drop images into the editor \(\#31009\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e4262f97af6f0cfe4af7459dc0f617ae6ae4029d)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: e4262f97af6f0cfe4af7459dc0f617ae6ae4029d

Requested commit: e4262f97af6f0cfe4af7459dc0f617ae6ae4029d

Commit: e4262f97af6f0cfe4af7459dc0f617ae6ae4029d

Tree: aff815ca8224876fbec3a873114d4c34fa049185

Author: Kirill Bulatov

Committer: GitHub

## Message

```
Restore the ability to drag and drop images into the editor (#31009)

`ImageItem`'s `file` is returning `""` as its `path` for single-filed
worktrees like the ones are created for the images dropped from the OS.
`ImageItem::load_image_metadata` had used that `path` in FS operations
and the other method tried to use for icon resolving.

Rework the code to use a more specific, `worktree::File` instead and
always use the `abs_path` when dealing with paths from this `file`.

Release Notes:

- Fixed images not opening on drag and drop into the editor
```

## Parents

- [944a0df436cb7367caed63f7acca4888bb063cc7](https://git.cafe/gitcafe/zed/commit/944a0df436cb7367caed63f7acca4888bb063cc7?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/e4262f97af6f0cfe4af7459dc0f617ae6ae4029d?format=markdown)
