@@ -263,39 +263,36 @@ def _parse_iloc(self, box: Box):
263
263
extents .append ((extent_offset , extent_length ))
264
264
box .locs [item_id ] = extents
265
265
266
- """ Added a few box names, which as unhandled aborted data extraction:
267
- hdlr, pitm, dinf, iprp, idat, iref
268
- Handling is initially NONE.
269
- They were found in .heif photo files produced by Nokia 8.3 5G.
270
- They are part of the standard, referring to:
271
- - ISO/IEC 14496-12 fifth edition 2015-02-20 (chapter 8.10 Metadata)
272
- found in: https://mpeg.chiariglione.org/standards/mpeg-4/iso-base-media-file-format/text-isoiec-14496-12-5th-edition
273
- (The newest is ISO/IEC 14496-12:2022, but would cost 208 Swiss Francs at iso.org)
274
- - A C++ example: https://exiv2.org/book/#BMFF
275
- """
266
+ # Added a few box names, which as unhandled aborted data extraction:
267
+ # hdlr, pitm, dinf, iprp, idat, iref
268
+ #
269
+ # Handling is initially `None`.
270
+ # They were found in .heif photo files produced by Nokia 8.3 5G.
271
+ #
272
+ # They are part of the standard, referring to:
273
+ # - ISO/IEC 14496-12 fifth edition 2015-02-20 (chapter 8.10 Metadata)
274
+ # found in:
275
+ # https://mpeg.chiariglione.org/standards/mpeg-4/iso-base-media-file-format/text-isoiec-14496-12-5th-edition
276
+ # (The newest is ISO/IEC 14496-12:2022, but would cost 208 Swiss Francs at iso.org)
277
+ # - A C++ example: https://exiv2.org/book/#BMFF
278
+
276
279
def _parse_hdlr (self , box : Box ):
277
- logger .debug ("HEIC: found 'hdlr' Box, skipped" )
278
- pass
280
+ logger .debug ("HEIC: found 'hdlr' Box %s, skipped" , box .name )
279
281
280
282
def _parse_pitm (self , box : Box ):
281
- logger .debug ("HEIC: found 'pitm' Box, skipped" )
282
- pass
283
+ logger .debug ("HEIC: found 'pitm' Box %s, skipped" , box .name )
283
284
284
285
def _parse_dinf (self , box : Box ):
285
- logger .debug ("HEIC: found 'dinf' Box, skipped" )
286
- pass
286
+ logger .debug ("HEIC: found 'dinf' Box %s, skipped" , box .name )
287
287
288
288
def _parse_iprp (self , box : Box ):
289
- logger .debug ("HEIC: found 'iprp' Box, skipped" )
290
- pass
289
+ logger .debug ("HEIC: found 'iprp' Box %s, skipped" , box .name )
291
290
292
291
def _parse_idat (self , box : Box ):
293
- logger .debug ("HEIC: found 'idat' Box, skipped" )
294
- pass
292
+ logger .debug ("HEIC: found 'idat' Box %s, skipped" , box .name )
295
293
296
294
def _parse_iref (self , box : Box ):
297
- logger .debug ("HEIC: found 'iref' Box, skipped" )
298
- pass
295
+ logger .debug ("HEIC: found 'iref' Box %s, skipped" , box .name )
299
296
300
297
def find_exif (self ) -> tuple :
301
298
ftyp = self .expect_parse ('ftyp' )
@@ -304,7 +301,7 @@ def find_exif(self) -> tuple:
304
301
meta = self .expect_parse ('meta' )
305
302
assert meta .subs ['iinf' ].exif_infe is not None
306
303
item_id = meta .subs ['iinf' ].exif_infe .item_id
307
- extents = meta .subs ['iloc' ].locs [item_id ]
304
+ extents = meta .subs ['iloc' ].locs [item_id ]
308
305
logger .debug ('HEIC: found Exif location.' )
309
306
# we expect the Exif data to be in one piece.
310
307
assert len (extents ) == 1
@@ -319,15 +316,15 @@ def find_exif(self) -> tuple:
319
316
exif_tiff_header_offset = self .get32 ()
320
317
321
318
if exif_tiff_header_offset == 0 :
322
- """ This case was found in HMD Nokia 8.3 5G heic photos.
323
- The TIFF header just sits there without any 'Exif'.
324
- """
319
+ # This case was found in HMD Nokia 8.3 5G heic photos.
320
+ # The TIFF header just sits there without any 'Exif'.
321
+
325
322
offset = 0
326
323
endian = '?' # Haven't got Endian info yet
327
- else :
324
+ else :
328
325
assert exif_tiff_header_offset >= 6
329
- assert self .get (exif_tiff_header_offset )[- 6 :] == b'Exif\x00 \x00 '
326
+ assert self .get (exif_tiff_header_offset )[- 6 :] == b'Exif\x00 \x00 '
330
327
offset = self .file_handle .tell ()
331
- endian = self .file_handle .read (1 )
332
-
328
+ endian = str ( self .file_handle .read (1 ) )
329
+
333
330
return offset , endian
0 commit comments