GetId3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g //.
More...
GetId3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g //.
module for writing ID3v1 tags
- Author
- James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g http://www.getid3.org GetId3
Definition at line 31 of file Id3v1.php.
◆ __construct()
GetId3\Write\Id3v1::__construct |
( |
| ) |
|
- Returns
- boolean
Definition at line 51 of file Id3v1.php.
◆ FixID3v1Padding()
GetId3\Write\Id3v1::FixID3v1Padding |
( |
| ) |
|
- Returns
- boolean
Definition at line 107 of file Id3v1.php.
References GetId3\Write\Id3v1\WriteID3v1().
113 $getID3 =
new GetId3Core();
114 $getID3->option_tag_id3v2 =
false;
115 $getID3->option_tag_apetag =
false;
116 $getID3->option_tags_html =
false;
117 $getID3->option_extra_info =
false;
118 $getID3->option_tag_id3v1 =
true;
119 $ThisFileInfo = $getID3->analyze($this->filename);
120 if (isset($ThisFileInfo[
'tags'][
'id3v1'])) {
121 foreach ($ThisFileInfo[
'tags'][
'id3v1'] as $key => $value) {
122 $id3v1data[$key] = implode(
',', $value);
124 $this->tag_data = $id3v1data;
◆ RemoveID3v1()
GetId3\Write\Id3v1::RemoveID3v1 |
( |
| ) |
|
Definition at line 132 of file Id3v1.php.
References GetId3\Handler\BaseHandler\fread(), GetId3\Handler\BaseHandler\fseek(), GetId3\Lib\Helper\intValueSupported(), and GetId3\Write\Id3v1\setRealFileSize().
135 if (!empty($this->filename) && is_readable($this->filename) && is_writable($this->filename) && is_file($this->filename)) {
138 $this->errors[] =
'Unable to RemoveID3v1('.$this->filename.
') because filesize ('.$this->filesize.
') is larger than '.round(PHP_INT_MAX / 1073741824).
'GB';
142 if ($fp_source = fopen($this->filename,
'r+b')) {
144 fseek($fp_source, -128, SEEK_END);
145 if (
fread($fp_source, 3) ==
'TAG') {
146 ftruncate($fp_source, $this->filesize - 128);
155 $this->errors[] =
'Could not fopen('.$this->filename.
', "r+b")';
158 $this->errors[] = $this->filename.
' is not writeable';
fseek($bytes, $whence=SEEK_SET)
static intValueSupported($num)
null $hasINT64
◆ setRealFileSize()
GetId3\Write\Id3v1::setRealFileSize |
( |
| ) |
|
- Returns
- boolean
Definition at line 168 of file Id3v1.php.
Referenced by GetId3\Write\Id3v1\RemoveID3v1(), and GetId3\Write\Id3v1\WriteID3v1().
170 if (PHP_INT_MAX > 2147483647) {
171 $this->filesize = filesize($this->filename);
177 $getID3 =
new GetId3Core();
178 $getID3->option_tag_id3v1 =
false;
179 $getID3->option_tag_id3v2 =
false;
180 $getID3->option_tag_apetag =
false;
181 $getID3->option_tags_html =
false;
182 $getID3->option_extra_info =
false;
183 $ThisFileInfo = $getID3->analyze($this->filename);
184 $this->filesize = $ThisFileInfo[
'filesize'];
◆ WriteID3v1()
GetId3\Write\Id3v1::WriteID3v1 |
( |
| ) |
|
- Returns
- boolean
Definition at line 60 of file Id3v1.php.
References GetId3\Handler\BaseHandler\fread(), GetId3\Handler\BaseHandler\fseek(), GetId3\Lib\Helper\intValueSupported(), and GetId3\Write\Id3v1\setRealFileSize().
Referenced by GetId3\Write\Id3v1\FixID3v1Padding().
63 if (!empty($this->filename) && is_readable($this->filename) && is_writable($this->filename) && is_file($this->filename)) {
66 $this->errors[] =
'Unable to WriteID3v1('.$this->filename.
') because filesize ('.$this->filesize.
') is larger than '.round(PHP_INT_MAX / 1073741824).
'GB';
70 if ($fp_source = fopen($this->filename,
'r+b')) {
71 fseek($fp_source, -128, SEEK_END);
72 if (
fread($fp_source, 3) ==
'TAG') {
73 fseek($fp_source, -128, SEEK_END);
75 fseek($fp_source, 0, SEEK_END);
77 $this->tag_data[
'track'] = (isset($this->tag_data[
'track']) ? $this->tag_data[
'track'] : (isset($this->tag_data[
'track_number']) ? $this->tag_data[
'track_number'] : (isset($this->tag_data[
'tracknumber']) ? $this->tag_data[
'tracknumber'] :
'')));
79 $new_id3v1_tag_data = Tag\Id3v1::GenerateID3v1Tag(
80 (isset($this->tag_data[
'title'] ) ? $this->tag_data[
'title'] :
''),
81 (isset($this->tag_data[
'artist'] ) ? $this->tag_data[
'artist'] :
''),
82 (isset($this->tag_data[
'album'] ) ? $this->tag_data[
'album'] :
''),
83 (isset($this->tag_data[
'year'] ) ? $this->tag_data[
'year'] :
''),
84 (isset($this->tag_data[
'genreid']) ? $this->tag_data[
'genreid'] :
''),
85 (isset($this->tag_data[
'comment']) ? $this->tag_data[
'comment'] :
''),
86 (isset($this->tag_data[
'track'] ) ? $this->tag_data[
'track'] :
''));
87 fwrite($fp_source, $new_id3v1_tag_data, 128);
93 $this->errors[] =
'Could not fopen('.$this->filename.
', "r+b")';
98 $this->errors[] =
'File is not writeable: '.$this->filename;
fseek($bytes, $whence=SEEK_SET)
static intValueSupported($num)
null $hasINT64
◆ $errors
GetId3\Write\Id3v1::$errors = array() |
◆ $filename
GetId3\Write\Id3v1::$filename |
◆ $filesize
GetId3\Write\Id3v1::$filesize |
◆ $tag_data
GetId3\Write\Id3v1::$tag_data |
◆ $warnings
GetId3\Write\Id3v1::$warnings = array() |
The documentation for this class was generated from the following file:
- libs/composer/vendor/phansys/getid3/GetId3/Write/Id3v1.php