X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f5fcdc7994bb67cce809bc4777944ae8b7fad4a4..53f4633144ed68c8b8fb5861f992b5489894a940:/wp-includes/ID3/module.audio.flac.php?ds=sidebyside diff --git a/wp-includes/ID3/module.audio.flac.php b/wp-includes/ID3/module.audio.flac.php index 8fa0f4c6..348cce32 100644 --- a/wp-includes/ID3/module.audio.flac.php +++ b/wp-includes/ID3/module.audio.flac.php @@ -135,7 +135,17 @@ class getid3_flac extends getid3_handler if (isset($info['flac']['PICTURE']) && ($this->getid3->option_save_attachments !== getID3::ATTACHMENTS_NONE)) { foreach ($info['flac']['PICTURE'] as $entry) { if (!empty($entry['data'])) { - $info['flac']['comments']['picture'][] = array('image_mime'=>$entry['image_mime'], 'data'=>$entry['data']); + if (!isset($info['flac']['comments']['picture'])) { + $info['flac']['comments']['picture'] = array(); + } + $comments_picture_data = array(); + foreach (array('data', 'image_mime', 'image_width', 'image_height', 'imagetype', 'picturetype', 'description', 'datalength') as $picture_key) { + if (isset($entry[$picture_key])) { + $comments_picture_data[$picture_key] = $entry[$picture_key]; + } + } + $info['flac']['comments']['picture'][] = $comments_picture_data; + unset($comments_picture_data); } } } @@ -343,25 +353,25 @@ class getid3_flac extends getid3_handler $info = &$this->getid3->info; $picture['typeid'] = getid3_lib::BigEndian2Int($this->fread(4)); - $picture['type'] = self::pictureTypeLookup($picture['typeid']); + $picture['picturetype'] = self::pictureTypeLookup($picture['typeid']); $picture['image_mime'] = $this->fread(getid3_lib::BigEndian2Int($this->fread(4))); $descr_length = getid3_lib::BigEndian2Int($this->fread(4)); if ($descr_length) { $picture['description'] = $this->fread($descr_length); } - $picture['width'] = getid3_lib::BigEndian2Int($this->fread(4)); - $picture['height'] = getid3_lib::BigEndian2Int($this->fread(4)); + $picture['image_width'] = getid3_lib::BigEndian2Int($this->fread(4)); + $picture['image_height'] = getid3_lib::BigEndian2Int($this->fread(4)); $picture['color_depth'] = getid3_lib::BigEndian2Int($this->fread(4)); $picture['colors_indexed'] = getid3_lib::BigEndian2Int($this->fread(4)); - $data_length = getid3_lib::BigEndian2Int($this->fread(4)); + $picture['datalength'] = getid3_lib::BigEndian2Int($this->fread(4)); if ($picture['image_mime'] == '-->') { - $picture['data'] = $this->fread($data_length); + $picture['data'] = $this->fread($picture['datalength']); } else { $picture['data'] = $this->saveAttachment( - str_replace('/', '_', $picture['type']).'_'.$this->ftell(), + str_replace('/', '_', $picture['picturetype']).'_'.$this->ftell(), $this->ftell(), - $data_length, + $picture['datalength'], $picture['image_mime']); } @@ -440,4 +450,4 @@ class getid3_flac extends getid3_handler return (isset($lookup[$type_id]) ? $lookup[$type_id] : 'reserved'); } -} \ No newline at end of file +}