<div>Hi!</div><div><br></div><div>Please forget about this problem ("Very long time of parsing of tags").</div><div>After some changes I can not reproduce it.</div><div>Sorry for the trouble.</div><div><br></div>
<div><br></div><div>I have another question about the attached image.</div><div>I found that the file size does not decrease after removal of the picture.</div><div>For example,</div><div> mp3 file without picture have size: 2 078 346 bytes,</div>
<div> size of jpg file to attach: 314 225 bytes,</div><div> size of this mp3 file after attaching the picture: 2 390 164 bytes,</div><div> and size of this mp3 file after deleting of all attached pictures: 2 390 164 bytes.</div>
<div><br></div><div>Why file size does not decrease after removal of the picture?</div><div><br></div><div>For example, I use the next code to delete all pictures from mp3 file:</div><div><br></div><div> TagLib::MPEG::File* pFile = ...;</div>
<div> ...</div><div> TagLib::ID3v2::Tag* pID3v2Tag = pFile->ID3v2Tag();</div><div> if (pID3v2Tag)</div><div> {</div><div> TagLib::ID3v2::FrameList frameList= pID3v2Tag->frameList("APIC");</div>
<div> {</div><div> if (!frameList.isEmpty())</div><div> {</div><div> std::list<TagLib::ID3v2::Frame*>::const_iterator it = frameList.begin();</div><div> while (it != frameList.end())</div>
<div> {</div><div> std::list<TagLib::ID3v2::Frame*>::const_iterator nextIt = it;</div><div> nextIt++;</div><div> pID3v2Tag->removeFrame(*it, true);</div>
<div> it = nextIt;</div><div> }</div><div> }</div><div> }</div><div> }</div><div><div> ....</div><div> pFile->save();</div></div>
<div><br></div><div>After performing of this code all pictures are detached, but size of file is not decreased.</div><div>Probably, I did not correctly use the library?</div><div><br></div>
<div><br><br><div class="gmail_quote">2011/3/5 Scott Wheeler <span dir="ltr"><<a href="mailto:wheeler@kde.org" target="_blank">wheeler@kde.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mar 5, 2011, at 8:53 AM, Vladimir Skuzovatkin wrote:<br>
<br>
> 1) Small (~10Kb) PNG image was written into media file. Time of<br>
> opening file (after writing of image) is equal to ~4 milliseconds.<br>
> 2) Small PNG image was deleted from media file and big (~400Kb) PNG<br>
> image was written into media file. Time of opening file is equal to<br>
> ~30 seconds.<br>
<br>
It could be that there's > 10k of padding available, but not > 400k,<br>
so it has to rewrite the file, which, while it shouldn't take 30<br>
seconds on average, it could on a large file.<br>
<br>
-Scott<br>
_______________________________________________<br>
taglib-devel mailing list<br>
<a href="mailto:taglib-devel@kde.org" target="_blank">taglib-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/taglib-devel" target="_blank">https://mail.kde.org/mailman/listinfo/taglib-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Thanks,<br>Vladimir<br>
</div>