HumanSignal / HumanSignal/label-studio

Image crossOrigin="use-credentials" does not work in preview

Open
#6,463 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

**Describe the bug**

When using `crossOrigin="use-credentials"` for the Image, previews of the image still use `crossorigin="anonymous"` and fail to load from cross origin sources where authentication is required.

**To Reproduce**

1. Setup the labeling interface to use credentials for CORS:

```xml





```

2. Import an image dataset which uses HTTP to load the images. To reproduce you can import the following simple CSV, the image can be fake because the bug is in the `` crossorigin attribute, it doesn't require real images or correctly configured CORS to demonstrate that its broken:

```csv
img
http://completely-fake-domain.fake/test.jpg
```

3. Open project interface to show the list of images
4. Inspect the image preview, observe how it has crossorigin="anonymous" instead of "use-credentials"

**Expected behavior**
Preview `` should use same crossorigin settings as the `` in the labeling interface

Docker Image:
```json
{
"release": "1.13.1",
"label-studio-os-package": {
"version": "1.13.1",
"short_version": "1.13",
"latest_version_from_pypi": "1.13.1",
"latest_version_upload_time": "2024-08-20T17:38:07",
"current_version_is_outdated": false
},

"label-studio-os-backend": {
"message": "ci: Build frontend",
"commit": "d9b816a3781ee806bba50c8c5589fcdb8555a277",
"date": "2024/08/19 19:14:23",
"branch": "",
"version": "1.13.1+0.gd9b816a"
},

"label-studio-frontend": {
"message": "fix: LEAP-762: Fix offsets in domManager for emojis (#6135)",
"commit": "8d8a7fce72b808d00f94cc10b49669121d186c1f",
"date": "2024-08-01T03:08:02.000Z",
"branch": "develop"
},

"dm2": {
"message": "chore: OPTIC-866: Stylus to Sass conversion LS web/libs/datamanager/sr ...",
"commit": "8fbedaa6fdd00338da19c258a798b8799f0cd935",
"date": "2024-07-26T15:12:41.000Z",
"branch": "develop"
},

"label-studio-converter": {
"version": "1.0.5"
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.