getid3_flac::parsePICTURE() – Parse METADATA_BLOCK_PICTURE flac structure and extract attachment External usage: audio.ogg

You appear to be a bot. Output may be restricted

Description

Parse METADATA_BLOCK_PICTURE flac structure and extract attachment External usage: audio.ogg

Usage

$bool = getid3_flac::parsePICTURE();

Parameters

Returns

bool

Source

File name: wordpress/wp-includes/ID3/module.audio.flac.php


Lines:

1 to 32 of 32
  public function parsePICTURE() {
    $info = &$this->getid3->info;

    $picture = array();
    $picture['typeid']         = getid3_lib::BigEndian2Int($this->fread(4));
    $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['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));
    $picture['datalength']     = getid3_lib::BigEndian2Int($this->fread(4));

    if ($picture['image_mime'] == '-->') {
      $picture['data'] = $this->fread($picture['datalength']);
    } else {
      $picture['data'] = $this->saveAttachment(
        str_replace('/', '_', $picture['picturetype']).'_'.$this->ftell(),
        $this->ftell(),
        $picture['datalength'],
        $picture['image_mime']);
    }

    $info['flac']['PICTURE'][] = $picture;

    return true;
  }
 

 View on GitHub View on Trac