Skip to content

Commit 9344b06

Browse files
authored
fix: OSError:broken data stream (#1430)
1 parent 70b6f0f commit 9344b06

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020

2121
### Fixed
2222
- Auto annotation, TF annotation and Auto segmentation apps (https://github.com/opencv/cvat/pull/1409)
23+
- Import works with truncated images now: "OSError:broken data stream" on corrupt images (https://github.com/opencv/cvat/pull/1430)
2324

2425
### Security
2526
-

cvat/apps/engine/media_extractors.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
import av.datasets
1414
import numpy as np
1515
from pyunpack import Archive
16-
from PIL import Image
16+
from PIL import Image, ImageFile
17+
18+
# fixes: "OSError:broken data stream" when executing line 72 while loading images downloaded from the web
19+
# see: https://stackoverflow.com/questions/42462431/oserror-broken-data-stream-when-reading-image-file
20+
ImageFile.LOAD_TRUNCATED_IMAGES = True
1721

1822
from cvat.apps.engine.mime_types import mimetypes
1923

0 commit comments

Comments
 (0)