Skip to content

Commit 224468d

Browse files
committed
#462 HEIF image support
#462
1 parent 4be7d4f commit 224468d

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

getid3/getid3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ class getID3
387387
*/
388388
protected $startup_warning = '';
389389

390-
const VERSION = '1.9.23-202411221042';
390+
const VERSION = '1.9.23-202501071203';
391391
const FREAD_BUFFER_SIZE = 32768;
392392

393393
const ATTACHMENTS_NONE = false;

getid3/module.audio-video.quicktime.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,26 @@ public function Analyze() {
224224
$info['mime_type'] = 'video/mp4';
225225
}
226226
}
227+
if (!empty($info['quicktime']['ftyp']['signature']) && in_array($info['quicktime']['ftyp']['signature'], array('heic','heix','hevc','hevx','heim','heis','hevm','hevs'))) {
228+
if ($info['mime_type'] == 'video/quicktime') { // default value, as we
229+
// https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format
230+
$this->error('HEIF files not currently supported');
231+
switch ($info['quicktime']['ftyp']['signature']) {
232+
// https://github.com/strukturag/libheif/issues/83 (comment by Dirk Farin 2018-09-14)
233+
case 'heic': // the usual HEIF images
234+
case 'heix': // 10bit images, or anything that uses h265 with range extension
235+
case 'hevc': // brands for image sequences
236+
case 'hevx': // brands for image sequences
237+
case 'heim': // multiview
238+
case 'heis': // scalable
239+
case 'hevm': // multiview sequence
240+
case 'hevs': // scalable sequence
241+
$info['fileformat'] = 'heif';
242+
$info['mime_type'] = 'image/heif';
243+
break;
244+
}
245+
}
246+
}
227247

228248
if (!$this->ReturnAtomData) {
229249
unset($info['quicktime']['moov']);

0 commit comments

Comments
 (0)