Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif
EXIF_PY := $(if $(shell which EXIF.py),EXIF.py,./EXIF.py)

# Find images, support multiple case insensitive extensions and file names with spaces
FIND_IMAGES := find tests/resources -regextype posix-egrep -iregex ".*\.(bmp|gif|heic|heif|jpg|jpeg|png|tiff|webp|arw)" -print0 | LC_COLLATE=C sort -fz | xargs -0
FIND_IMAGES := find tests/resources -regextype posix-egrep -iregex ".*\.(bmp|gif|heic|heif|jpg|jpeg|png|tiff|webp|arw|avif)" -print0 | LC_COLLATE=C sort -fz | xargs -0


.PHONY: help
Expand Down
2 changes: 1 addition & 1 deletion exifread/core/find_exif.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def determine_type(fh: BinaryIO) -> Tuple[int, bytes, int]:
if data[0:2] in [b"II", b"MM"]:
# it's a TIFF file
offset, endian = find_tiff_exif(fh)
elif data[4:12] == b"ftypheic":
elif data[4:12] in [b"ftypheic", b"ftypavif", b"ftypmif1"]:
fh.seek(0)
heic = HEICExifFinder(fh)
offset, endian = heic.find_exif()
Expand Down
2 changes: 1 addition & 1 deletion exifread/core/heic.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def _parse_iref(self, box: Box) -> None:

def find_exif(self) -> Tuple[int, bytes]:
ftyp = self.expect_parse("ftyp")
if ftyp.major_brand != b"heic" or ftyp.minor_version != 0:
if ftyp.major_brand not in [b"heic", b"avif", b"mif1"] or ftyp.minor_version != 0:
return 0, b""

meta = self.expect_parse("meta")
Expand Down
Binary file added tests/resources/avif/mountains.avif
Binary file not shown.
56 changes: 54 additions & 2 deletions tests/resources/dump.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
Opening: tests/resources/avif/mountains.avif
EXIF ColorSpace (Short): sRGB
EXIF ComponentsConfiguration (Undefined): YCbCr
EXIF Contrast (Short): Normal
EXIF CustomRendered (Short): Normal
EXIF DateTimeDigitized (ASCII): 2024:04:05 10:59:24
EXIF DateTimeOriginal (ASCII): 2024:04:05 10:59:24
EXIF DigitalZoomRatio (Ratio): 1
EXIF ExifImageLength (Long): 1080
EXIF ExifImageWidth (Long): 1920
EXIF ExifVersion (Undefined): 0230
EXIF ExposureBiasValue (Signed Ratio): 0
EXIF ExposureMode (Short): Auto Exposure
EXIF ExposureProgram (Short): Aperture Priority
EXIF ExposureTime (Ratio): 1/1000
EXIF FNumber (Ratio): 5
EXIF FileSource (Undefined): Digital Camera
EXIF Flash (Short): Flash did not fire, auto mode
EXIF FlashPixVersion (Undefined): 0100
EXIF FocalLength (Ratio): 25
EXIF GainControl (Short): Low gain up
EXIF ISOSpeedRatings (Short): 200
EXIF LensModel (ASCII): LEICA DG SUMMILUX 25/F1.4
EXIF LensSpecification (Ratio): [25, 25, 7/5, 7/5]
EXIF LightSource (Short): Unknown
EXIF MakerNote (Undefined): [79, 77, 32, 83, 89, 83, 84, 69, 77, 0, 0, 0, 73, 73, 4, 0, 7, 0, 9, 2, ... ]
EXIF MaxApertureValue (Ratio): 1
EXIF MeteringMode (Short): Pattern
EXIF Saturation (Short): Normal
EXIF SceneCaptureType (Short): Standard
EXIF SensitivityType (Short): Standard Output Sensitivity
EXIF Sharpness (Short): Normal
EXIF UserComment (Undefined):
EXIF WhiteBalance (Short): Auto
GPS GPSVersionID (Byte): [2, 3, 0, 0]
Image Artist (ASCII):
Image Copyright (ASCII):
Image DateTime (ASCII): 2025:08:02 22:48:04
Image ExifOffset (Long): 932
Image GPSInfo (Long): 16626
Image ImageDescription (ASCII):
Image Make (ASCII): OLYMPUS CORPORATION
Image Model (ASCII): E-PL8
Image Orientation (Short): Horizontal (normal)
Image PrintIM (Undefined): [80, 114, 105, 110, 116, 73, 77, 0, 48, 51, 48, 48, 0, 0, 37, 0, 1, 0, 20, 0, ... ]
Image ResolutionUnit (Short): Pixels/Inch
Image Software (ASCII): GIMP 2.10.36
Image XResolution (Ratio): 350
Image YCbCrPositioning (Short): Co-sited
Image YResolution (Ratio): 350

Opening: tests/resources/heic/heic_hdlr_box.jpg
No EXIF information found

Expand Down Expand Up @@ -162,8 +213,9 @@ Image YCbCrPositioning (Short): Centered
Image YResolution (Ratio): 72

Opening: tests/resources/heic/spring_1440x960.heic
File format not recognized.
No EXIF information found
EXIF DateTimeOriginal (ASCII): 2020:12:03 15:04:31
EXIF SubSecTimeOriginal (ASCII): 04
Image ExifOffset (Long): 26

Opening: tests/resources/jpg/Canon_40D.jpg
File has JPEG thumbnail
Expand Down