Definition at line 18 of file write.id3v1.php.
◆ FixID3v1Padding() [1/2]
getid3_write_id3v1::FixID3v1Padding |
( |
| ) |
|
Definition at line 62 of file write.id3v1.php.
References getID3\analyze(), and WriteID3v1().
68 $ThisFileInfo = $getID3->
analyze($this->filename);
69 if (isset($ThisFileInfo[
'tags'][
'id3v1'])) {
70 foreach ($ThisFileInfo[
'tags'][
'id3v1'] as $key => $value) {
71 $id3v1data[$key] = implode(
',', $value);
73 $this->tag_data = $id3v1data;
◆ FixID3v1Padding() [2/2]
getid3_write_id3v1::FixID3v1Padding |
( |
| ) |
|
Definition at line 69 of file write.id3v1.php.
References getID3\analyze(), and WriteID3v1().
75 $getID3->option_tag_id3v2 =
false;
76 $getID3->option_tag_apetag =
false;
77 $getID3->option_tags_html =
false;
78 $getID3->option_extra_info =
false;
79 $getID3->option_tag_id3v1 =
true;
80 $ThisFileInfo = $getID3->
analyze($this->filename);
81 if (isset($ThisFileInfo[
'tags'][
'id3v1'])) {
82 foreach ($ThisFileInfo[
'tags'][
'id3v1'] as $key => $value) {
83 $id3v1data[$key] = implode(
',', $value);
85 $this->tag_data = $id3v1data;
◆ getid3_write_id3v1() [1/2]
getid3_write_id3v1::getid3_write_id3v1 |
( |
| ) |
|
◆ getid3_write_id3v1() [2/2]
getid3_write_id3v1::getid3_write_id3v1 |
( |
| ) |
|
◆ RemoveID3v1() [1/2]
getid3_write_id3v1::RemoveID3v1 |
( |
| ) |
|
Definition at line 79 of file write.id3v1.php.
81 if (is_writeable($this->filename)) {
82 if ($fp_source = @fopen($this->filename,
'r+b')) {
84 fseek($fp_source, -128, SEEK_END);
85 if (fread($fp_source, 3) ==
'TAG') {
86 ftruncate($fp_source, filesize($this->filename) - 128);
94 $this->errors[] =
'Could not open '.$this->filename.
' mode "r+b"';
97 $this->errors[] = $this->filename.
' is not writeable';
◆ RemoveID3v1() [2/2]
getid3_write_id3v1::RemoveID3v1 |
( |
| ) |
|
Definition at line 91 of file write.id3v1.php.
References getid3_lib\intValueSupported(), and setRealFileSize().
93 if (!empty($this->filename) && is_readable($this->filename) && is_writable($this->filename) && is_file($this->filename)) {
96 $this->errors[] =
'Unable to RemoveID3v1('.$this->filename.
') because filesize ('.$this->filesize.
') is larger than '.round(PHP_INT_MAX / 1073741824).
'GB';
99 if ($fp_source = fopen($this->filename,
'r+b')) {
101 fseek($fp_source, -128, SEEK_END);
102 if (fread($fp_source, 3) ==
'TAG') {
103 ftruncate($fp_source, $this->filesize - 128);
111 $this->errors[] =
'Could not fopen('.$this->filename.
', "r+b")';
114 $this->errors[] = $this->filename.
' is not writeable';
static intValueSupported($num)
◆ setRealFileSize()
getid3_write_id3v1::setRealFileSize |
( |
| ) |
|
Definition at line 119 of file write.id3v1.php.
References getID3\analyze().
Referenced by RemoveID3v1(), and WriteID3v1().
120 if (PHP_INT_MAX > 2147483647) {
121 $this->filesize = filesize($this->filename);
127 $getID3->option_tag_id3v1 =
false;
128 $getID3->option_tag_id3v2 =
false;
129 $getID3->option_tag_apetag =
false;
130 $getID3->option_tags_html =
false;
131 $getID3->option_extra_info =
false;
132 $ThisFileInfo = $getID3->
analyze($this->filename);
133 $this->filesize = $ThisFileInfo[
'filesize'];
◆ WriteID3v1() [1/2]
getid3_write_id3v1::WriteID3v1 |
( |
| ) |
|
Definition at line 29 of file write.id3v1.php.
References getid3_id3v1\GenerateID3v1Tag().
Referenced by FixID3v1Padding().
31 if (is_writeable($this->filename)) {
32 if ($fp_source = @fopen($this->filename,
'r+b')) {
34 fseek($fp_source, -128, SEEK_END);
35 if (fread($fp_source, 3) ==
'TAG') {
36 fseek($fp_source, -128, SEEK_END);
38 fseek($fp_source, 0, SEEK_END);
42 @$this->tag_data[
'title'],
43 @$this->tag_data[
'artist'],
44 @$this->tag_data[
'album'],
45 @$this->tag_data[
'year'],
46 @$this->tag_data[
'genreid'],
47 @$this->tag_data[
'comment'],
48 @$this->tag_data[
'track']);
49 fwrite($fp_source, $new_id3v1_tag_data, 128);
54 $this->errors[] =
'Could not open '.$this->filename.
' mode "r+b"';
58 $this->errors[] =
'File is not writeable: '.$this->filename;
GenerateID3v1Tag($title, $artist, $album, $year, $genreid, $comment, $track='')
◆ WriteID3v1() [2/2]
getid3_write_id3v1::WriteID3v1 |
( |
| ) |
|
Definition at line 31 of file write.id3v1.php.
References getid3_id3v1\GenerateID3v1Tag(), getid3_lib\intValueSupported(), and setRealFileSize().
33 if (!empty($this->filename) && is_readable($this->filename) && is_writable($this->filename) && is_file($this->filename)) {
36 $this->errors[] =
'Unable to WriteID3v1('.$this->filename.
') because filesize ('.$this->filesize.
') is larger than '.round(PHP_INT_MAX / 1073741824).
'GB';
39 if ($fp_source = fopen($this->filename,
'r+b')) {
40 fseek($fp_source, -128, SEEK_END);
41 if (fread($fp_source, 3) ==
'TAG') {
42 fseek($fp_source, -128, SEEK_END);
44 fseek($fp_source, 0, SEEK_END);
46 $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'] :
'')));
49 (isset($this->tag_data[
'title'] ) ? $this->tag_data[
'title'] :
''),
50 (isset($this->tag_data[
'artist'] ) ? $this->tag_data[
'artist'] :
''),
51 (isset($this->tag_data[
'album'] ) ? $this->tag_data[
'album'] :
''),
52 (isset($this->tag_data[
'year'] ) ? $this->tag_data[
'year'] :
''),
53 (isset($this->tag_data[
'genreid']) ? $this->tag_data[
'genreid'] :
''),
54 (isset($this->tag_data[
'comment']) ? $this->tag_data[
'comment'] :
''),
55 (isset($this->tag_data[
'track'] ) ? $this->tag_data[
'track'] :
''));
56 fwrite($fp_source, $new_id3v1_tag_data, 128);
61 $this->errors[] =
'Could not fopen('.$this->filename.
', "r+b")';
65 $this->errors[] =
'File is not writeable: '.$this->filename;
GenerateID3v1Tag($title, $artist, $album, $year, $genreid, $comment, $track='')
static intValueSupported($num)
◆ $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: