<DIV>
<DIV>Pyt please help me, i don't know if i understand good:</DIV>
<DIV> </DIV>
<DIV>If i use padding to add a new frame: let's say that i have a tag with TIT1 and TIT2: </DIV>
<DIV> </DIV>
<DIV>
<DIV><<STRONG>tag header</STRONG>></DIV>
<DIV><<STRONG>TIT1</STRONG> header><<STRONG>TIT1</STRONG> contents></DIV>
<DIV><<STRONG>TIT2 </STRONG>header><<STRONG>TIT2</STRONG> contents></DIV>
<DIV><<STRONG>end</STRONG> of the tag, no padding></DIV>
<DIV><<STRONG>mp3 audio data</STRONG>></DIV>
<DIV><tag<STRONG> footer</STRONG>></DIV>
<DIV><<STRONG>ID3v1</STRONG> tag></DIV></DIV>
<DIV> </DIV>
<DIV><FONT color=#ff0000><STRONG>if i add a new frame (TALB) using padding tag will look like this?:</STRONG></FONT></DIV>
<DIV> </DIV>
<DIV><<STRONG>tag header</STRONG>></DIV>
<DIV><<STRONG>TALB</STRONG> header only></DIV>
<DIV><<STRONG>TIT1</STRONG> header><<STRONG>TIT1</STRONG> contents></DIV>
<DIV><<STRONG>TIT2</STRONG> header><<STRONG>TIT2</STRONG> contents></DIV>
<DIV><<STRONG>end</STRONG> of the tag, start of the <STRONG>padding</STRONG>></DIV>
<DIV><<STRONG>TALB</STRONG> contents (or TALB enlargement, if padding is used to enlarge a frame)></DIV>
<DIV><<STRONG>mp3 audio data</STRONG>></DIV>
<DIV>
<DIV><no footer></DIV>
<DIV><<STRONG>ID3v1</STRONG> tag></DIV></DIV>
<DIV> </DIV>
<DIV>if frame TALB already exists in the tag:</DIV>
<DIV> </DIV>
<DIV>
<DIV>
<DIV><<STRONG>tag header</STRONG>></DIV>
<DIV>
<DIV><<STRONG>TALB</STRONG> header><<STRONG>TALB</STRONG> contents></DIV></DIV>
<DIV><<STRONG>TIT1</STRONG> header><<STRONG>TIT1</STRONG> contents></DIV>
<DIV><<STRONG>TIT2 </STRONG>header><<STRONG>TIT2</STRONG> contents></DIV>
<DIV><<STRONG>end</STRONG> of the tag, no padding></DIV>
<DIV><<STRONG>mp3 audio data</STRONG>></DIV>
<DIV><tag<STRONG> footer</STRONG>></DIV>
<DIV><<STRONG>ID3v1</STRONG> tag></DIV></DIV></DIV>
<DIV> </DIV>
<DIV>and i extend it using padding:</DIV>
<DIV> </DIV>
<DIV>
<DIV><<STRONG>tag header</STRONG>></DIV>
<DIV>
<DIV><<STRONG>TALB</STRONG> header><<STRONG>TALB</STRONG> contents></DIV></DIV>
<DIV><<STRONG>TIT1</STRONG> header><<STRONG>TIT1</STRONG> contents></DIV>
<DIV><<STRONG>TIT2</STRONG> header><<STRONG>TIT2</STRONG> contents></DIV>
<DIV><<STRONG>end</STRONG> of the tag, start of the <STRONG>padding</STRONG>></DIV>
<DIV><<STRONG>TALB </STRONG>aditional content (or TALB enlargement)></DIV>
<DIV><<STRONG>mp3 audio data</STRONG>></DIV>
<DIV>
<DIV><no footer></DIV>
<DIV><<STRONG>ID3v1</STRONG> tag></DIV>
<DIV> </DIV>
<DIV>But how to detect when padding starts? just before last frame, but how to detect when is last frame?</DIV>
<DIV> </DIV>
<DIV>if i have two frame, with its enlargmens in padding:</DIV>
<DIV> </DIV>
<DIV>
<DIV><<STRONG>tag header</STRONG>></DIV>
<DIV>
<DIV><<STRONG>TALB</STRONG> header><<STRONG>TALB</STRONG> contents></DIV></DIV>
<DIV><<STRONG>TIT1</STRONG> header><<STRONG>TIT1</STRONG> contents></DIV>
<DIV><<STRONG>TIT2</STRONG> header><<STRONG>TIT2</STRONG> contents></DIV>
<DIV><<STRONG>end</STRONG> of the tag, start of the <STRONG>padding</STRONG>></DIV>
<DIV><$00 00 00 00 (start of padding?) <STRONG>TALB </STRONG>aditional content></DIV>
<DIV>
<DIV><$00 00 00 00 <STRONG>TIT1 </STRONG>aditional content></DIV></DIV>
<DIV><<STRONG>mp3 audio data</STRONG>></DIV>
<DIV>
<DIV><no footer></DIV>
<DIV><<STRONG>ID3v1</STRONG> tag></DIV>
<DIV> </DIV>
<DIV>in both cases if i use padding to enlarge or add new frames information in padding is just bytes, no headers or flags, before data content?</DIV>
<DIV> </DIV>
<DIV>Thanks, very mach! and help me please :(<BR><BR><B><I>Pyt <py.thoulon@gmail.com></I></B> wrote:</DIV></DIV></DIV></DIV></DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<DIV>><FONT color=#ff0000>Tag size included on tag header, dont include padding?</FONT> </DIV>
<DIV> </DIV>
<DIV>The tag size in the tag header includes the size of : (1) the extended header, (2) the actual frames, (3) the padding. See id3v2.4.0-structure.txt, section 3.1.</DIV>
<DIV> </DIV>
<DIV> ><FONT color=#ff0000>If padding is used to add aditional frames, where is the frame ID since ID is four null chars? or if padding is used to enlarge existing frames how to know what frame are enlarged?</FONT></DIV>
<DIV><FONT color=#ff0000></FONT> </DIV>
<DIV>Let's say you have a tag with padding so that the total size of header+extended header+frames+padding = 4K (a typical case); the size in the tag header would be 4086 (4096 - size of header, which is ten bytes). Let's also say the actual frames use up only 2000 of those 4086 bytes. That leaves 2086 bytes of padding. </DIV>
<DIV>Now, if you want to add a new frame to the tag, you can stick it right after the last of the existing frames, overwriting the padding bytes with the new frame contents. You would make no other change to your tag: the size remains the same, only the relative sizes of frames vs. padding have changed; if you new frame is say 50 bytes long, the tag size still indicates 4086, the total frame size is now 2050, and the padding size only 2036. </DIV>
<DIV>The advantage of this is that if you have enough padding, you can play with the frames without having to rewrite the whole MP3 file (which is generally a lengthy exercise, given the sizes of these beast).</DIV>
<DIV> </DIV>
<DIV>Enlarging a frame means a bit more extensive work because frames have to remain in one piece. Let's say you have a tag with TIT1, TALB, TIPL, TIT2 frames in this order, followed by padding. If you want to enlarge TIPL for example, you will need to rewrite your whole tag (or at least the end of it, starting with TIPL) over the original one, eating up into the padding. <BR> </DIV>
<DIV>><FONT color=#ff0000>And if footer is writting to end of file, is'n possible to write an ID3v1 Tag, right? since ID3v1 tag is located from 0 to 128 bytes at end of file.</FONT></DIV>
<DIV><SPAN class=gmail_quote>Yes, you can. The ID3v2 footer should be located just before the ID3v1 tag. A good parsing algorithm looking for an ID3v2 footer should be able to skip the v1 tag.</SPAN></DIV>
<DIV><SPAN class=gmail_quote></SPAN> </DIV>
<DIV><SPAN class=gmail_quote>Regards,</SPAN></DIV>
<DIV><SPAN class=gmail_quote>Pyt.</SPAN></DIV></BLOCKQUOTE><BR><BR><B><I>Pyt <py.thoulon@gmail.com></I></B> wrote:
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<DIV>><FONT color=#ff0000>Tag size included on tag header, dont include padding?</FONT> </DIV>
<DIV> </DIV>
<DIV>The tag size in the tag header includes the size of : (1) the extended header, (2) the actual frames, (3) the padding. See id3v2.4.0-structure.txt, section 3.1.</DIV>
<DIV> </DIV>
<DIV> ><FONT color=#ff0000>If padding is used to add aditional frames, where is the frame ID since ID is four null chars? or if padding is used to enlarge existing frames how to know what frame are enlarged?</FONT></DIV>
<DIV><FONT color=#ff0000></FONT> </DIV>
<DIV>Let's say you have a tag with padding so that the total size of header+extended header+frames+padding = 4K (a typical case); the size in the tag header would be 4086 (4096 - size of header, which is ten bytes). Let's also say the actual frames use up only 2000 of those 4086 bytes. That leaves 2086 bytes of padding. </DIV>
<DIV>Now, if you want to add a new frame to the tag, you can stick it right after the last of the existing frames, overwriting the padding bytes with the new frame contents. You would make no other change to your tag: the size remains the same, only the relative sizes of frames vs. padding have changed; if you new frame is say 50 bytes long, the tag size still indicates 4086, the total frame size is now 2050, and the padding size only 2036. </DIV>
<DIV>The advantage of this is that if you have enough padding, you can play with the frames without having to rewrite the whole MP3 file (which is generally a lengthy exercise, given the sizes of these beast).</DIV>
<DIV> </DIV>
<DIV>Enlarging a frame means a bit more extensive work because frames have to remain in one piece. Let's say you have a tag with TIT1, TALB, TIPL, TIT2 frames in this order, followed by padding. If you want to enlarge TIPL for example, you will need to rewrite your whole tag (or at least the end of it, starting with TIPL) over the original one, eating up into the padding. <BR> </DIV>
<DIV>><FONT color=#ff0000>And if footer is writting to end of file, is'n possible to write an ID3v1 Tag, right? since ID3v1 tag is located from 0 to 128 bytes at end of file.</FONT></DIV>
<DIV><SPAN class=gmail_quote>Yes, you can. The ID3v2 footer should be located just before the ID3v1 tag. A good parsing algorithm looking for an ID3v2 footer should be able to skip the v1 tag.</SPAN></DIV>
<DIV><SPAN class=gmail_quote></SPAN> </DIV>
<DIV><SPAN class=gmail_quote>Regards,</SPAN></DIV>
<DIV><SPAN class=gmail_quote>Pyt.</SPAN></DIV></BLOCKQUOTE></DIV><p>
<hr size=1><font face="Arial" size="2">To help you stay safe and secure online, we've developed the all new <a href="http://us.rd.yahoo.com/mail/uk/taglines/default/security_centre/*http://uk.security.yahoo.com/"><b>Yahoo! Security Centre</b></a>.</font>