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;
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;
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';
170 if (PHP_INT_MAX > 2147483647) {
171 $this->filesize = filesize($this->filename);
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'];
GetId3() by James Heinrich info@getid3.org //.
fseek($bytes, $whence=SEEK_SET)
GetId3() by James Heinrich info@getid3.org //.
Create styles array
The data for the language used.
static intValueSupported($num)
null $hasINT64