getid3_asf::ASF_WMpicture() –

You appear to be a bot. Output may be restricted

Description

Usage

$array = getid3_asf::ASF_WMpicture( $data );

Parameters

$data
( string ) required

Returns

array

Source

File name: wordpress/wp-includes/ID3/module.audio-video.asf.php
Lines:

1 to 49 of 49
  public function ASF_WMpicture(&$data) {
    //typedef struct _WMPicture{
    //  LPWSTR  pwszMIMEType;
    //  BYTE  bPictureType;
    //  LPWSTR  pwszDescription;
    //  DWORD  dwDataLen;
    //  BYTE*  pbData;
    //} WM_PICTURE;

    $WMpicture = array();

    $offset = 0;
    $WMpicture['image_type_id'] = getid3_lib::LittleEndian2Int(substr($data, $offset, 1));
    $offset += 1;
    $WMpicture['image_type']    = self::WMpictureTypeLookup($WMpicture['image_type_id']);
    $WMpicture['image_size']    = getid3_lib::LittleEndian2Int(substr($data, $offset, 4));
    $offset += 4;

    $WMpicture['image_mime'] = '';
    do {
      $next_byte_pair = substr($data, $offset, 2);
      $offset += 2;
      $WMpicture['image_mime'] .= $next_byte_pair;
    } while ($next_byte_pair !== "\x00\x00");

    $WMpicture['image_description'] = '';
    do {
      $next_byte_pair = substr($data, $offset, 2);
      $offset += 2;
      $WMpicture['image_description'] .= $next_byte_pair;
    } while ($next_byte_pair !== "\x00\x00");

    $WMpicture['dataoffset'] = $offset;
    $WMpicture['data'] = substr($data, $offset);

    $imageinfo = array();
    $WMpicture['image_mime'] = '';
    $imagechunkcheck = getid3_lib::GetDataImageSize($WMpicture['data'], $imageinfo);
    unset($imageinfo);
    if (!empty($imagechunkcheck)) {
      $WMpicture['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]);
    }
    if (!isset($this->getid3->info['asf']['comments']['picture'])) {
      $this->getid3->info['asf']['comments']['picture'] = array();
    }
    $this->getid3->info['asf']['comments']['picture'][] = array('data'=>$WMpicture['data'], 'image_mime'=>$WMpicture['image_mime']);

    return $WMpicture;
  }
 

 View on GitHub View on Trac