Skip to content

Commit

Permalink
#462 HEIF image support
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHeinrich committed Jan 7, 2025
1 parent 4be7d4f commit 224468d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion getid3/getid3.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class getID3
*/
protected $startup_warning = '';

const VERSION = '1.9.23-202411221042';
const VERSION = '1.9.23-202501071203';
const FREAD_BUFFER_SIZE = 32768;

const ATTACHMENTS_NONE = false;
Expand Down
20 changes: 20 additions & 0 deletions getid3/module.audio-video.quicktime.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,26 @@ public function Analyze() {
$info['mime_type'] = 'video/mp4';
}
}
if (!empty($info['quicktime']['ftyp']['signature']) && in_array($info['quicktime']['ftyp']['signature'], array('heic','heix','hevc','hevx','heim','heis','hevm','hevs'))) {
if ($info['mime_type'] == 'video/quicktime') { // default value, as we
// https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format
$this->error('HEIF files not currently supported');
switch ($info['quicktime']['ftyp']['signature']) {
// https://github.com/strukturag/libheif/issues/83 (comment by Dirk Farin 2018-09-14)
case 'heic': // the usual HEIF images
case 'heix': // 10bit images, or anything that uses h265 with range extension
case 'hevc': // brands for image sequences
case 'hevx': // brands for image sequences
case 'heim': // multiview
case 'heis': // scalable
case 'hevm': // multiview sequence
case 'hevs': // scalable sequence
$info['fileformat'] = 'heif';
$info['mime_type'] = 'image/heif';
break;
}
}
}

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

0 comments on commit 224468d

Please sign in to comment.