Compare commits
4 Commits
d7264523b3
...
c31d0bc695
Author | SHA1 | Date |
---|---|---|
Jean-Claude | c31d0bc695 | |
Jean-Claude | a4fd94b90f | |
erix | 483490f055 | |
erix | c4e94061f8 |
10
README.md
10
README.md
|
@ -6,10 +6,12 @@ vimiv RawPrev enables support for RAW images by extracting the embedded thumbnai
|
|||
### Supported Formats
|
||||
The following RAW formats are currently supported:
|
||||
|
||||
| **Format** | **Extension** | **Dependency** |
|
||||
| :--- | :---: | :--- |
|
||||
| Canon Raw 2 | `.cr2` | [dcraw](https://www.dechifro.org/dcraw/) |
|
||||
| Canon Raw 3 | `.cr3` | [exiftool](https://exiftool.org/) |
|
||||
| **Format** | **Extension** | **Dependency** |
|
||||
| :--- | :---: | :--- |
|
||||
| Canon Raw 2 | `.cr2` | [dcraw](https://www.dechifro.org/dcraw/) |
|
||||
| Canon Raw 3 | `.cr3` | [exiftool](https://exiftool.org/) |
|
||||
| Fujifilm RAF | `.raf` | [dcraw](https://www.dechifro.org/dcraw/) |
|
||||
| Olympus ORF | `.orf` | [dcraw](https://www.dechifro.org/dcraw/) |
|
||||
|
||||
### Installation
|
||||
- Depending on the RAW file format, different dependencies are required. Please see the list above and install the required dependencies.
|
||||
|
|
10
__init__.py
10
__init__.py
|
@ -11,10 +11,18 @@ from vimiv.utils import log
|
|||
_logger = log.module_logger(__name__)
|
||||
|
||||
|
||||
def test_raf(header: bytes, _f: BinaryIO) -> bool:
|
||||
return header[:15] == b"FUJIFILMCCD-RAW"
|
||||
|
||||
|
||||
def test_cr2(header: bytes, _f: BinaryIO) -> bool:
|
||||
return header[:2] in (b"II", b"MM") and header[8:10] == b"CR"
|
||||
|
||||
|
||||
def test_orf(header: bytes, _f: BinaryIO) -> bool:
|
||||
return header[:4] == b"IIRO"
|
||||
|
||||
|
||||
@lru_cache(maxsize=40)
|
||||
def load_cr2(path) -> QPixmap:
|
||||
"""Extract the thumbnail from the image and initialize QPixmap"""
|
||||
|
@ -123,7 +131,9 @@ def load_cr3(path) -> QPixmap:
|
|||
|
||||
def init(info: str, *_args: Any, **_kwargs: Any) -> None:
|
||||
"""Setup RawPrev plugin by adding the raw handler"""
|
||||
api.add_external_format("raf", test_raf, load_cr2)
|
||||
api.add_external_format("cr2", test_cr2, load_cr2)
|
||||
api.add_external_format("cr3", test_cr3, load_cr3)
|
||||
api.add_external_format("orf", test_orf, load_cr2)
|
||||
|
||||
_logger.debug("Initialized RawPrev")
|
||||
|
|
Loading…
Reference in New Issue