Lines Matching refs:this

271 …$this->startup_error .= 'getID3() requires PHP v'.$required_php_version.' or higher - you are runn…
284 $this->memory_limit = $memoryLimit;
286 if ($this->memory_limit <= 0) {
288 } elseif ($this->memory_limit <= 4194304) {
289 …$this->startup_error .= 'PHP has less than 4MB available memory and will very likely run out. Incr…
290 } elseif ($this->memory_limit <= 12582912) {
291 …$this->startup_warning .= 'PHP has less than 12MB available memory and might run out if all module…
296 …$this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbi…
303 …$this->startup_error .= 'WARNING: php.ini contains "mbstring.func_overload = '.ini_get('mbstring.f…
311 …$this->startup_error .= 'magic_quotes_runtime must be disabled before running getID3(). Surround g…
317 …$this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid…
324 $this->startup_error .= 'getid3.lib.php is missing or corrupt'."\n";
327 if ($this->option_max_2gb_check === null) {
328 $this->option_max_2gb_check = (PHP_INT_MAX <= 2147483647);
343 …$this->startup_warning .= '"'.$helperappsdir.'" cannot be defined as GETID3_HELPERAPPSDIR because …
363 …$this->startup_warning .= 'GETID3_HELPERAPPSDIR must not have any spaces in it - use 8dot3 naming …
373 if (!empty($this->startup_error)) {
374 echo $this->startup_error;
375 throw new getid3_exception($this->startup_error);
390 return $this->option_fread_buffer_size;
403 if (isset($this->$opt) === false) {
406 $this->$opt = $val;
422 if (!empty($this->startup_error)) {
423 throw new getid3_exception($this->startup_error);
425 if (!empty($this->startup_warning)) {
426 foreach (explode("\n", $this->startup_warning) as $startup_warning) {
427 $this->warning($startup_warning);
432 $this->filename = $filename;
433 $this->info = array();
434 $this->info['GETID3_VERSION'] = $this->version();
435 $this->info['php_memory_limit'] = (($this->memory_limit > 0) ? $this->memory_limit : false);
448 $this->fp = $fp;
449 …} elseif ((is_readable($filename) || file_exists($filename)) && is_file($filename) && ($this->fp =…
468 $this->info['filesize'] = (!is_null($filesize) ? $filesize : filesize($filename));
472 $this->info['filepath'] = str_replace('\\', '/', realpath(dirname($filename)));
473 $this->info['filename'] = getid3_lib::mb_basename($filename);
474 $this->info['filenamepath'] = $this->info['filepath'].'/'.$this->info['filename'];
477 $this->info['avdataoffset'] = 0;
478 $this->info['avdataend'] = $this->info['filesize'];
479 $this->info['fileformat'] = ''; // filled in later
480 $this->info['audio']['dataformat'] = ''; // filled in later, unset if not used
481 $this->info['video']['dataformat'] = ''; // filled in later, unset if not used
482 $this->info['tags'] = array(); // filled in later, unset if not used
483 $this->info['error'] = array(); // filled in later, unset if not used
484 $this->info['warning'] = array(); // filled in later, unset if not used
485 $this->info['comments'] = array(); // filled in later, unset if not used
486 …$this->info['encoding'] = $this->encoding; // required by id3v2 and iso modules - can…
489 if ($this->option_max_2gb_check) {
493 $fseek = fseek($this->fp, 0, SEEK_END);
494 if (($fseek < 0) || (($this->info['filesize'] != 0) && (ftell($this->fp) == 0)) ||
495 ($this->info['filesize'] < 0) ||
496 (ftell($this->fp) < 0)) {
497 $real_filesize = getid3_lib::getFileSizeSyscall($this->info['filenamepath']);
500 unset($this->info['filesize']);
501 fclose($this->fp);
504 unset($this->info['filesize']);
505 fclose($this->fp);
508 $this->info['filesize'] = $real_filesize;
509 …$this->warning('File is larger than '.round(PHP_INT_MAX / 1073741824).'GB (filesystem reports it a…
516 $this->error($e->getMessage());
533 if (!$this->openfile($filename, $filesize, $fp)) {
534 return $this->info;
540 if ($this->$option_tag) {
541 $this->include_module('tag.'.$tag_name);
544 $tag = new $tag_class($this);
552 if (isset($this->info['id3v2']['tag_offset_start'])) {
553 …$this->info['avdataoffset'] = max($this->info['avdataoffset'], $this->info['id3v2']['tag_offset_en…
556 if (isset($this->info[$tag_key]['tag_offset_start'])) {
557 …$this->info['avdataend'] = min($this->info['avdataend'], $this->info[$tag_key]['tag_offset_start']…
562 if (!$this->option_tag_id3v2) {
563 fseek($this->fp, 0);
564 $header = fread($this->fp, 10);
566 $this->info['id3v2']['header'] = true;
567 $this->info['id3v2']['majorversion'] = ord($header[3]);
568 $this->info['id3v2']['minorversion'] = ord($header[4]);
569 …$this->info['avdataoffset'] += getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; …
574 fseek($this->fp, $this->info['avdataoffset']);
575 $formattest = fread($this->fp, 32774);
578 …$determined_format = $this->GetFileFormat($formattest, ($original_filename ? $original_filename : …
582 fclose($this->fp);
583 return $this->error('unable to determine file format');
587 …etermined_format['fail_id3']) && (in_array('id3v1', $this->info['tags']) || in_array('id3v2', $thi…
589 fclose($this->fp);
590 return $this->error('ID3 tags not allowed on this file type.');
592 $this->warning('ID3 tags not allowed on this file type.');
597 if (isset($determined_format['fail_ape']) && in_array('ape', $this->info['tags'])) {
599 fclose($this->fp);
600 return $this->error('APE tags not allowed on this file type.');
602 $this->warning('APE tags not allowed on this file type.');
607 $this->info['mime_type'] = $determined_format['mime_type'];
611 fclose($this->fp);
612 …return $this->error('Format not supported, module "'.$determined_format['include'].'" was removed.…
617 …_exists('mb_convert_encoding') && !function_exists('iconv') && !in_array($this->encoding, array('I…
624 return $this->error($errormessage);
633 …return $this->error('Format not supported, module "'.$determined_format['include'].'" is corrupt.'…
635 $class = new $class_name($this);
640 fclose($this->fp);
643 if ($this->option_tags_process) {
644 $this->HandleAllTags();
648 if ($this->option_extra_info) {
649 $this->ChannelsBitratePlaytimeCalculations();
650 $this->CalculateCompressionRatioVideo();
651 $this->CalculateCompressionRatioAudio();
652 $this->CalculateReplayGain();
653 $this->ProcessAudioStreams();
657 if ($this->option_md5_data) {
659 if (!$this->option_md5_data_source || empty($this->info['md5_data_source'])) {
660 $this->getHashdata('md5');
665 if ($this->option_sha1_data) {
666 $this->getHashdata('sha1');
670 $this->CleanUp();
673 $this->error('Caught exception: '.$e->getMessage());
677 return $this->info;
689 $this->CleanUp();
690 if (!isset($this->info['error'])) {
691 $this->info['error'] = array();
693 $this->info['error'][] = $message;
694 return $this->info;
706 $this->info['warning'][] = $message;
719 if (empty($this->info['audio'][$key]) && isset($this->info['audio'][$key])) {
720 unset($this->info['audio'][$key]);
722 if (empty($this->info['video'][$key]) && isset($this->info['video'][$key])) {
723 unset($this->info['video'][$key]);
728 if (!empty($this->info)) {
729 foreach ($this->info as $key => $value) {
730 if (empty($this->info[$key]) && ($this->info[$key] !== 0) && ($this->info[$key] !== '0')) {
731 unset($this->info[$key]);
737 if (empty($this->info['fileformat'])) {
738 if (isset($this->info['avdataoffset'])) {
739 unset($this->info['avdataoffset']);
741 if (isset($this->info['avdataend'])) {
742 unset($this->info['avdataend']);
747 if (!empty($this->info['error'])) {
748 $this->info['error'] = array_values(array_unique($this->info['error']));
750 if (!empty($this->info['warning'])) {
751 $this->info['warning'] = array_values(array_unique($this->info['warning']));
755 unset($this->info['php_memory_limit']);
1381 foreach ($this->GetFileFormatArray() as $format_name => $info) {
1394 $GetFileFormatArray = $this->GetFileFormatArray();
1402 $GetFileFormatArray = $this->GetFileFormatArray();
1420 if ($encoding == $this->encoding) {
1429 $this->CharConvert($array[$key], $encoding);
1434 $array[$key] = trim(getid3_lib::iconv_fallback($encoding, $this->encoding, $value));
1460 'id3v1' => array('id3v1' , $this->encoding_id3v1),
1477 if (isset($this->info[$comment_name]) && !isset($this->info[$comment_name]['encoding'])) {
1478 $this->info[$comment_name]['encoding'] = $encoding;
1482 if (!empty($this->info[$comment_name]['comments'])) {
1483 foreach ($this->info[$comment_name]['comments'] as $tag_key => $valuearray) {
1490 $this->info['tags'][trim($tag_name)][trim($tag_key)][$key] = $value;
1492 $this->info['tags'][trim($tag_name)][trim($tag_key)][] = $value;
1498 unset($this->info[$comment_name]['comments'][$tag_key]);
1502 if (!isset($this->info['tags'][$tag_name])) {
1507 …$this->CharConvert($this->info['tags'][$tag_name], $this->info[$comment_name]['encoding']); …
1509 if ($this->option_tags_html) {
1510 foreach ($this->info['tags'][$tag_name] as $tag_key => $valuearray) {
1516 …$this->info['tags_html'][$tag_name][$tag_key] = getid3_lib::recursiveMultiByteCharString2HTML($val…
1525 if (!empty($this->info['tags'])) {
1527 foreach ($this->info['tags'] as $tagtype => $tagarray) {
1531 $this->info['comments']['picture'][] = $tagarray;
1533 if (isset($this->info['tags'][$tagtype][$tagname][$key])) {
1534 unset($this->info['tags'][$tagtype][$tagname][$key]);
1536 if (isset($this->info['tags_html'][$tagtype][$tagname][$key])) {
1537 unset($this->info['tags_html'][$tagtype][$tagname][$key]);
1545 if (empty($this->info[$unset_key][$tagtype]['picture'])) {
1546 unset($this->info[$unset_key][$tagtype]['picture']);
1548 if (empty($this->info[$unset_key][$tagtype])) {
1549 unset($this->info[$unset_key][$tagtype]);
1551 if (empty($this->info[$unset_key])) {
1552 unset($this->info[$unset_key]);
1556 if (isset($this->info[$tagtype]['comments']['picture'])) {
1557 unset($this->info[$tagtype]['comments']['picture']);
1559 if (empty($this->info[$tagtype]['comments'])) {
1560 unset($this->info[$tagtype]['comments']);
1562 if (empty($this->info[$tagtype])) {
1563 unset($this->info[$tagtype]);
1578 return getid3_lib::CopyTagsToComments($ThisFileInfo, $this->option_tags_html);
1593 return $this->error('bad algorithm "'.$algorithm.'" in getHashdata()');
1596 …if (!empty($this->info['fileformat']) && !empty($this->info['dataformat']) && ($this->info['filefo…
1618 …$this->warning('Failed making system call to vorbiscomment.exe - '.$algorithm.'_data is incorrect …
1619 $this->info[$algorithm.'_data'] = false;
1632 $file = $this->info['filenamepath'];
1656 …$this->warning('Failed making system call to vorbiscomment(.exe) - '.$algorithm.'_data will be inc…
1657 $this->info[$algorithm.'_data'] = false;
1664 $this->info[$algorithm.'_data'] = md5_file($temp);
1668 $this->info[$algorithm.'_data'] = sha1_file($temp);
1684 …if (!empty($this->info['avdataoffset']) || (isset($this->info['avdataend']) && ($this->info['avdat…
1687 …$this->info[$algorithm.'_data'] = getid3_lib::hash_data($this->info['filenamepath'], $this->info['…
1694 $this->info[$algorithm.'_data'] = md5_file($this->info['filenamepath']);
1698 $this->info[$algorithm.'_data'] = sha1_file($this->info['filenamepath']);
1710 if (!empty($this->info['audio']['channelmode']) || !isset($this->info['audio']['channels'])) {
1712 } elseif ($this->info['audio']['channels'] == 1) {
1713 $this->info['audio']['channelmode'] = 'mono';
1714 } elseif ($this->info['audio']['channels'] == 2) {
1715 $this->info['audio']['channelmode'] = 'stereo';
1720 …$CombinedBitrate += (isset($this->info['audio']['bitrate']) ? $this->info['audio']['bitrate'] : 0);
1721 …$CombinedBitrate += (isset($this->info['video']['bitrate']) ? $this->info['video']['bitrate'] : 0);
1722 if (($CombinedBitrate > 0) && empty($this->info['bitrate'])) {
1723 $this->info['bitrate'] = $CombinedBitrate;
1732 …if (isset($this->info['video']['dataformat']) && $this->info['video']['dataformat'] && (!isset($th…
1734 …if (isset($this->info['audio']['bitrate']) && ($this->info['audio']['bitrate'] > 0) && ($this->inf…
1736 if (isset($this->info['playtime_seconds']) && ($this->info['playtime_seconds'] > 0)) {
1738 if (isset($this->info['avdataend']) && isset($this->info['avdataoffset'])) {
1741 …$this->info['bitrate'] = round((($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $t…
1742 $this->info['video']['bitrate'] = $this->info['bitrate'] - $this->info['audio']['bitrate'];
1748 …if ((!isset($this->info['playtime_seconds']) || ($this->info['playtime_seconds'] <= 0)) && !empty(…
1749 …$this->info['playtime_seconds'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) /…
1752 if (!isset($this->info['bitrate']) && !empty($this->info['playtime_seconds'])) {
1753 …$this->info['bitrate'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->i…
1755 …if (isset($this->info['bitrate']) && empty($this->info['audio']['bitrate']) && empty($this->info['…
1756 if (isset($this->info['audio']['dataformat']) && empty($this->info['video']['resolution_x'])) {
1758 $this->info['audio']['bitrate'] = $this->info['bitrate'];
1759 …} elseif (isset($this->info['video']['resolution_x']) && empty($this->info['audio']['dataformat'])…
1761 $this->info['video']['bitrate'] = $this->info['bitrate'];
1766 if (!empty($this->info['playtime_seconds']) && empty($this->info['playtime_string'])) {
1767 $this->info['playtime_string'] = getid3_lib::PlaytimeString($this->info['playtime_seconds']);
1775 if (empty($this->info['video'])) {
1778 if (empty($this->info['video']['resolution_x']) || empty($this->info['video']['resolution_y'])) {
1781 if (empty($this->info['video']['bits_per_sample'])) {
1785 switch ($this->info['video']['dataformat']) {
1794 $BitrateCompressed = $this->info['filesize'] * 8;
1798 if (!empty($this->info['video']['frame_rate'])) {
1799 $FrameRate = $this->info['video']['frame_rate'];
1803 if (!empty($this->info['playtime_seconds'])) {
1804 $PlaytimeSeconds = $this->info['playtime_seconds'];
1808 if (!empty($this->info['video']['bitrate'])) {
1809 $BitrateCompressed = $this->info['video']['bitrate'];
1815 …$BitrateUncompressed = $this->info['video']['resolution_x'] * $this->info['video']['resolution_y']…
1817 $this->info['video']['compression_ratio'] = $BitrateCompressed / $BitrateUncompressed;
1825 …mpty($this->info['audio']['bitrate']) || empty($this->info['audio']['channels']) || empty($this->i…
1828this->info['audio']['compression_ratio'] = $this->info['audio']['bitrate'] / ($this->info['audio']…
1830 if (!empty($this->info['audio']['streams'])) {
1831 foreach ($this->info['audio']['streams'] as $streamnumber => $streamdata) {
1833 …$this->info['audio']['streams'][$streamnumber]['compression_ratio'] = $streamdata['bitrate'] / ($s…
1844 if (isset($this->info['replay_gain'])) {
1845 if (!isset($this->info['replay_gain']['reference_volume'])) {
1846 $this->info['replay_gain']['reference_volume'] = 89.0;
1848 if (isset($this->info['replay_gain']['track']['adjustment'])) {
1849 …$this->info['replay_gain']['track']['volume'] = $this->info['replay_gain']['reference_volume'] - $
1851 if (isset($this->info['replay_gain']['album']['adjustment'])) {
1852 …$this->info['replay_gain']['album']['volume'] = $this->info['replay_gain']['reference_volume'] - $
1855 if (isset($this->info['replay_gain']['track']['peak'])) {
1856 …$this->info['replay_gain']['track']['max_noclip_gain'] = 0 - getid3_lib::RGADamplitude2dB($this->i…
1858 if (isset($this->info['replay_gain']['album']['peak'])) {
1859 …$this->info['replay_gain']['album']['max_noclip_gain'] = 0 - getid3_lib::RGADamplitude2dB($this->i…
1869 …if (!empty($this->info['audio']['bitrate']) || !empty($this->info['audio']['channels']) || !empty(…
1870 if (!isset($this->info['audio']['streams'])) {
1871 foreach ($this->info['audio'] as $key => $value) {
1873 $this->info['audio']['streams'][0][$key] = $value;
1885 return tempnam($this->tempdir, 'gI3');
1969 $this->getid3 = $getid3;
1972 $this->dependency_to = str_replace('getid3_', '', $call_module);
1990 $this->setStringMode($string);
1993 $saved_avdataoffset = $this->getid3->info['avdataoffset'];
1994 $saved_avdataend = $this->getid3->info['avdataend'];
1995 …$saved_filesize = (isset($this->getid3->info['filesize']) ? $this->getid3->info['filesize'] : …
1998 $this->getid3->info['avdataoffset'] = 0;
1999 $this->getid3->info['avdataend'] = $this->getid3->info['filesize'] = $this->data_string_length;
2002 $this->Analyze();
2005 $this->getid3->info['avdataoffset'] = $saved_avdataoffset;
2006 $this->getid3->info['avdataend'] = $saved_avdataend;
2007 $this->getid3->info['filesize'] = $saved_filesize;
2010 $this->data_string_flag = false;
2017 $this->data_string_flag = true;
2018 $this->data_string = $string;
2019 $this->data_string_length = strlen($string);
2026 if ($this->data_string_flag) {
2027 return $this->data_string_position;
2029 return ftell($this->getid3->fp);
2040 if ($this->data_string_flag) {
2041 $this->data_string_position += $bytes;
2042 return substr($this->data_string, $this->data_string_position - $bytes, $bytes);
2044 $pos = $this->ftell() + $bytes;
2046 …throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') because beyond PHP fi…
2060 …if (($this->getid3->memory_limit > 0) && (($bytes / $this->getid3->memory_limit) > 0.99)) { // ena…
2061 …_exception('cannot fread('.$bytes.' from '.$this->ftell().') that is more than available PHP memor…
2063 $part = fread($this->getid3->fp, $bytes);
2080 if ($this->data_string_flag) {
2083 $this->data_string_position = $bytes;
2087 $this->data_string_position += $bytes;
2091 $this->data_string_position = $this->data_string_length + $bytes;
2098 $pos = $this->ftell() + $bytes;
2100 $pos = $this->getid3->info['filesize'] + $bytes;
2106 return fseek($this->getid3->fp, $bytes, $whence);
2118 if ($this->data_string_flag) {
2120 $thischar = substr($this->data_string, $this->data_string_position++, 1);
2123 $this->data_string_position--;
2130 if ($this->data_string_position >= $this->data_string_length) {
2144 $thischar = fgetc($this->getid3->fp);
2147 fseek($this->getid3->fp, -1, SEEK_CUR);
2154 if (feof($this->getid3->fp)) {
2168 if ($this->data_string_flag) {
2169 return $this->data_string_position >= $this->data_string_length;
2171 return feof($this->getid3->fp);
2180 return $this->dependency_to == $module;
2189 $this->getid3->info['error'][] = $text;
2200 return $this->getid3->warning($text);
2225 if ($this->getid3->option_save_attachments === getID3::ATTACHMENTS_NONE) {
2230 } elseif ($this->getid3->option_save_attachments === getID3::ATTACHMENTS_INLINE) {
2232 $this->fseek($offset);
2233 …$attachment = $this->fread($length); // get whole data in one pass, till it is anyway stored in me…
2242 …$dir = rtrim(str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->getid3->option_save_attachm…
2254 $this->fseek($offset);
2255 $buffersize = ($this->data_string_flag ? $length : $this->getid3->fread_buffer_size());
2258 …if (($buffer = $this->fread(min($buffersize, $bytesleft))) === false || ($byteswritten = fwrite($f…
2282 $this->warning('Failed to extract attachment '.$name.': '.$e->getMessage());
2287 $this->fseek($offset + $length);