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);
}
}
}
$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']);
}
return (isset($lookup[$type_id]) ? $lookup[$type_id] : 'reserved');
}
-}
\ No newline at end of file
+}