| Conditions | 4 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.0218 |
| Changes | 0 | ||
| 1 | """heic_parse |
||
| 26 | 1 | def parse_heic(item: str) -> dict: |
|
| 27 | """parse_heic |
||
| 28 | --- |
||
| 29 | The parses heic files |
||
| 30 | """ |
||
| 31 | 1 | heif_file = pyheif.read_heif(item) |
|
| 32 | 1 | if not heif_file.metadata: |
|
| 33 | 1 | return {}
|
|
| 34 | 1 | for metadata in heif_file.metadata: |
|
| 35 | |||
| 36 | 1 | if metadata['type'] == 'Exif': |
|
| 37 | 1 | fstream = io.BytesIO(metadata['data'][6:]) |
|
| 38 | |||
| 39 | 1 | return exifread.process_file(fstream) |
|
| 40 | return {}
|
||
| 41 |