-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Alex Waygood <[email protected]>
- Loading branch information
1 parent
27983aa
commit 0cf685c
Showing
16 changed files
with
151 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
from _typeshed import Incomplete | ||
from logging import Logger | ||
from typing import Any | ||
|
||
logger: Incomplete | ||
from ._types import Reader | ||
|
||
__version__: str | ||
logger: Logger | ||
|
||
def process_file( | ||
fh, stop_tag=..., details: bool = ..., strict: bool = ..., debug: bool = ..., truncate_tags: bool = ..., auto_seek: bool = ... | ||
): ... | ||
fh: Reader, | ||
stop_tag: str = ..., | ||
details: bool = ..., | ||
strict: bool = ..., | ||
debug: bool = ..., | ||
truncate_tags: bool = ..., | ||
auto_seek: bool = ..., | ||
) -> dict[str, Any]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Stubs-only module with type aliases for ExifRead. | ||
|
||
from typing import Any, Protocol | ||
from typing_extensions import Literal, TypeAlias | ||
|
||
# The second item of the value tuple - if it exists - can be a variety of types, | ||
# including a callable or another dict. | ||
TagDict: TypeAlias = dict[int, tuple[str] | tuple[str, Any]] | ||
|
||
class Reader(Protocol): | ||
def __iter__(self) -> bytes: ... | ||
def read(self, __size: int) -> bytes: ... | ||
def tell(self) -> int: ... | ||
def seek(self, __offset: int, __whence: Literal[0, 1] = ...) -> object: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,48 @@ | ||
from _typeshed import Incomplete | ||
from logging import Logger | ||
from typing import Any | ||
from typing_extensions import Literal | ||
|
||
logger: Incomplete | ||
from ._types import Reader, TagDict | ||
|
||
logger: Logger | ||
|
||
class IfdTag: | ||
printable: Incomplete | ||
tag: Incomplete | ||
field_type: Incomplete | ||
field_offset: Incomplete | ||
field_length: Incomplete | ||
values: Incomplete | ||
def __init__(self, printable: str, tag: int, field_type: int, values, field_offset: int, field_length: int) -> None: ... | ||
printable: str | ||
tag: int | ||
field_type: int | ||
field_offset: int | ||
field_length: int | ||
values: Any # either string, bytes or list of data items | ||
def __init__(self, printable: str, tag: int, field_type: int, values: Any, field_offset: int, field_length: int) -> None: ... | ||
|
||
class ExifHeader: | ||
file_handle: Incomplete | ||
endian: Incomplete | ||
offset: Incomplete | ||
fake_exif: Incomplete | ||
strict: Incomplete | ||
debug: Incomplete | ||
detailed: Incomplete | ||
truncate_tags: Incomplete | ||
tags: Incomplete | ||
file_handle: Reader | ||
endian: Literal["I", "M"] | ||
offset: int | ||
fake_exif: bool | ||
strict: bool | ||
debug: bool | ||
detailed: bool | ||
truncate_tags: bool | ||
tags: dict[str, Any] | ||
def __init__( | ||
self, | ||
file_handle, | ||
endian, | ||
offset, | ||
fake_exif, | ||
file_handle: Reader, | ||
endian: Literal["I", "M"], | ||
offset: int, | ||
fake_exif: bool, | ||
strict: bool, | ||
debug: bool = ..., | ||
detailed: bool = ..., | ||
truncate_tags: bool = ..., | ||
) -> None: ... | ||
def s2n(self, offset, length: int, signed: bool = ...) -> int: ... | ||
def n2b(self, offset, length) -> bytes: ... | ||
def list_ifd(self) -> list[Incomplete]: ... | ||
def dump_ifd(self, ifd, ifd_name: str, tag_dict: Incomplete | None = ..., relative: int = ..., stop_tag=...) -> None: ... | ||
def s2n(self, offset: int, length: int, signed: bool = ...) -> int: ... | ||
def n2b(self, offset: int, length: int) -> bytes: ... | ||
def list_ifd(self) -> list[int]: ... | ||
def dump_ifd( | ||
self, ifd: int, ifd_name: str, tag_dict: TagDict | None = ..., relative: int = ..., stop_tag: str = ... | ||
) -> None: ... | ||
def extract_tiff_thumbnail(self, thumb_ifd: int) -> None: ... | ||
def extract_jpeg_thumbnail(self) -> None: ... | ||
def decode_maker_note(self) -> None: ... | ||
def parse_xmp(self, xmp_bytes: bytes): ... | ||
def parse_xmp(self, xmp_bytes: bytes) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from _typeshed import Incomplete | ||
from logging import Logger | ||
|
||
logger: Incomplete | ||
from ._types import Reader | ||
|
||
def find_jpeg_exif(fh, data, fake_exif) -> tuple[Incomplete, Incomplete, Incomplete]: ... | ||
logger: Logger | ||
|
||
def find_jpeg_exif(fh: Reader, data: bytes, fake_exif: bool) -> tuple[int, bytes, bool]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from _typeshed import Incomplete | ||
from exifread._types import TagDict | ||
|
||
INTEROP_TAGS: Incomplete | ||
INTEROP_INFO: Incomplete | ||
GPS_TAGS: Incomplete | ||
GPS_INFO: Incomplete | ||
EXIF_TAGS: Incomplete | ||
INTEROP_TAGS: TagDict | ||
INTEROP_INFO: tuple[str, TagDict] | ||
GPS_TAGS: TagDict | ||
GPS_INFO: tuple[str, TagDict] | ||
EXIF_TAGS: TagDict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from _typeshed import Incomplete | ||
from exifread._types import TagDict | ||
|
||
TAGS: Incomplete | ||
TAGS: TagDict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
from _typeshed import Incomplete | ||
from collections.abc import Callable | ||
from typing import Any | ||
from typing_extensions import TypeAlias | ||
|
||
TAGS: Incomplete | ||
CAMERA_SETTINGS: Incomplete | ||
FOCAL_LENGTH: Incomplete | ||
SHOT_INFO: Incomplete | ||
AF_INFO_2: Incomplete | ||
FILE_INFO: Incomplete | ||
from exifread._types import TagDict | ||
|
||
def add_one(value): ... | ||
def subtract_one(value): ... | ||
def convert_temp(value): ... | ||
TAGS: TagDict | ||
|
||
CAMERA_SETTINGS: TagDict | ||
FOCAL_LENGTH: TagDict | ||
SHOT_INFO: TagDict | ||
AF_INFO_2: TagDict | ||
FILE_INFO: TagDict | ||
|
||
def add_one(value: int) -> int: ... | ||
def subtract_one(value: int) -> int: ... | ||
def convert_temp(value: int) -> str: ... | ||
|
||
_CameraInfo: TypeAlias = dict[int, tuple[str, str, Callable[[int], Any]]] | ||
|
||
CAMERA_INFO_TAG_NAME: str | ||
CAMERA_INFO_5D: Incomplete | ||
CAMERA_INFO_5DMKII: Incomplete | ||
CAMERA_INFO_5DMKIII: Incomplete | ||
CAMERA_INFO_600D: Incomplete | ||
CAMERA_INFO_MODEL_MAP: Incomplete | ||
CAMERA_INFO_5D: _CameraInfo | ||
CAMERA_INFO_5DMKII: _CameraInfo | ||
CAMERA_INFO_5DMKIII: _CameraInfo | ||
CAMERA_INFO_600D: _CameraInfo | ||
CAMERA_INFO_MODEL_MAP: dict[str, _CameraInfo] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from _typeshed import Incomplete | ||
from exifread._types import TagDict | ||
|
||
TAGS: Incomplete | ||
TAGS: TagDict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from _typeshed import Incomplete | ||
from exifread._types import TagDict | ||
|
||
TAGS: Incomplete | ||
TAGS: TagDict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from _typeshed import Incomplete | ||
from exifread._types import TagDict | ||
|
||
def ev_bias(seq) -> str: ... | ||
def ev_bias(seq: list[int]) -> str: ... | ||
|
||
TAGS_NEW: Incomplete | ||
TAGS_OLD: Incomplete | ||
TAGS_NEW: TagDict | ||
TAGS_OLD: TagDict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from _typeshed import Incomplete | ||
from exifread._types import TagDict | ||
|
||
def special_mode(val): ... | ||
def special_mode(val: bytes) -> str: ... | ||
|
||
TAGS: Incomplete | ||
TAG_0x2020: Incomplete | ||
TAGS: TagDict | ||
TAG_0x2020: TagDict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
from _typeshed import Incomplete | ||
from _typeshed import Self | ||
from collections.abc import Mapping | ||
from fractions import Fraction | ||
from typing import Any, TypeVar, overload | ||
|
||
def ord_(dta): ... | ||
def make_string(seq: bytes | list[Incomplete]) -> str: ... | ||
def make_string_uc(seq) -> str: ... | ||
def get_gps_coords(tags: dict[Incomplete, Incomplete]) -> tuple[Incomplete, Incomplete]: ... | ||
_T = TypeVar("_T") | ||
|
||
@overload | ||
def ord_(dta: str) -> int: ... # type: ignore[misc] | ||
@overload | ||
def ord_(dta: _T) -> _T: ... | ||
def make_string(seq: str | list[int]) -> str: ... | ||
def make_string_uc(seq: str | list[int]) -> str: ... | ||
def get_gps_coords(tags: Mapping[str, Any]) -> tuple[float, float]: ... | ||
|
||
class Ratio(Fraction): | ||
def __new__(cls, numerator: int = ..., denominator: Incomplete | None = ...): ... | ||
def __new__(cls: type[Self], numerator: int = ..., denominator: int | None = ...) -> Self: ... | ||
@property | ||
def num(self): ... | ||
def num(self) -> int: ... | ||
@property | ||
def den(self): ... | ||
def den(self) -> int: ... | ||
def decimal(self) -> float: ... |