attached picture

View: New views
11 Messages — Rating Filter:   Alert me  

attached picture

by manigault :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi i've just started with taglib a few days ago and for now it works
fine. I am working on a function to extract artowrks from a file if
the file is MPEG with ID3v2 tag  TagLib::ID3v2::AttachedPictureFrame
do the job but how can i do that for MP4 fie formats. I have try doing
it by using TagLib::MP4::Tag::itemListMap but there is no item for
picture frame so any suggestions how to do it? :)
_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel

Re: attached picture

by Bugzilla from lalinsky@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 16, 2009 at 9:25 AM, Martin Obreshkov
<martin.trashbox@...> wrote:
> Hi i've just started with taglib a few days ago and for now it works
> fine. I am working on a function to extract artowrks from a file if
> the file is MPEG with ID3v2 tag  TagLib::ID3v2::AttachedPictureFrame
> do the job but how can i do that for MP4 fie formats. I have try doing
> it by using TagLib::MP4::Tag::itemListMap but there is no item for
> picture frame so any suggestions how to do it? :)

I'm afraid you can't do that in TagLib 1.6.  I didn't realize I forgot
to add explicit support for covr atoms. :( The MP4 atoms that hold
cover art are identical to standard text atoms, but they use a special
"flag" to determine whether the image is PNG or JPEG. The current
implementation will clear the flag even on existing covr atoms if you
save them, so the missing feature is also a bug. I'll fix this today,
and do a 1.6.1 release this sunday.

Something like this will work then:

file->tag()->itemListMap()["covr"] = TagLib::MP4::Item(imageData,
TagLib::MP4::Item::FormatPNG);

--
Lukas Lalinsky
lalinsky@...
_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel

Re: attached picture

by manigault :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, i implemented it by myself you can take a look of the code just
modified a few files
Implemented
TagLib::MP4::Item::Item(const ByteVector &value);
ByteVector TagLib::MP4::Item::toByteVector() const;
void TagLib::MP4::Item::parseCover(Atom *atom, TagLib::File *file);

and use it like this

TagLib::MP4::ItemListMap itemsListMap =  mp4Tag->itemListMap();
TagLib::MP4::Item coverItem = itemsListMap["covr"];
char * image = coverItem.toByteVector().data();

the changes are attached if you want to use it

2009/10/16 Lukáš Lalinský <lalinsky@...>:

> On Fri, Oct 16, 2009 at 9:25 AM, Martin Obreshkov
> <martin.trashbox@...> wrote:
>> Hi i've just started with taglib a few days ago and for now it works
>> fine. I am working on a function to extract artowrks from a file if
>> the file is MPEG with ID3v2 tag  TagLib::ID3v2::AttachedPictureFrame
>> do the job but how can i do that for MP4 fie formats. I have try doing
>> it by using TagLib::MP4::Tag::itemListMap but there is no item for
>> picture frame so any suggestions how to do it? :)
>
> I'm afraid you can't do that in TagLib 1.6.  I didn't realize I forgot
> to add explicit support for covr atoms. :( The MP4 atoms that hold
> cover art are identical to standard text atoms, but they use a special
> "flag" to determine whether the image is PNG or JPEG. The current
> implementation will clear the flag even on existing covr atoms if you
> save them, so the missing feature is also a bug. I'll fix this today,
> and do a 1.6.1 release this sunday.
>
> Something like this will work then:
>
> file->tag()->itemListMap()["covr"] = TagLib::MP4::Item(imageData,
> TagLib::MP4::Item::FormatPNG);
>
> --
> Lukas Lalinsky
> lalinsky@...
> _______________________________________________
> taglib-devel mailing list
> taglib-devel@...
> https://mail.kde.org/mailman/listinfo/taglib-devel
>


_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel

mp4.zip (34K) Download Attachment

Re: attached picture

by Bugzilla from lalinsky@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/10/16 Martin Obreshkov <martin.trashbox@...>:

> Yes, i implemented it by myself you can take a look of the code just
> modified a few files
> Implemented
> TagLib::MP4::Item::Item(const ByteVector &value);
> ByteVector TagLib::MP4::Item::toByteVector() const;
> void TagLib::MP4::Item::parseCover(Atom *atom, TagLib::File *file);
>
> and use it like this
>
> TagLib::MP4::ItemListMap itemsListMap =  mp4Tag->itemListMap();
> TagLib::MP4::Item coverItem = itemsListMap["covr"];
> char * image = coverItem.toByteVector().data();
>
> the changes are attached if you want to use it

Thanks, that's great. What's missing is storing of the atom flag in
MP4::Item. In case of the covr atom it can be:

0x0D = JPEG
0x0E = PNG

--
Lukas Lalinsky
lalinsky@...
_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel

Re: attached picture

by manigault :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi again, are you going to release a new version with new features
added for now we i am maintaining the code by myself but don't want to
do that for a long time i prefer to work with library without
modifying it. So how is the new release going :)
Regards Martin

2009/10/16 Lukáš Lalinský <lalinsky@...>:

> 2009/10/16 Martin Obreshkov <martin.trashbox@...>:
>> Yes, i implemented it by myself you can take a look of the code just
>> modified a few files
>> Implemented
>> TagLib::MP4::Item::Item(const ByteVector &value);
>> ByteVector TagLib::MP4::Item::toByteVector() const;
>> void TagLib::MP4::Item::parseCover(Atom *atom, TagLib::File *file);
>>
>> and use it like this
>>
>> TagLib::MP4::ItemListMap itemsListMap =  mp4Tag->itemListMap();
>> TagLib::MP4::Item coverItem = itemsListMap["covr"];
>> char * image = coverItem.toByteVector().data();
>>
>> the changes are attached if you want to use it
>
> Thanks, that's great. What's missing is storing of the atom flag in
> MP4::Item. In case of the covr atom it can be:
>
> 0x0D = JPEG
> 0x0E = PNG
>
> --
> Lukas Lalinsky
> lalinsky@...
> _______________________________________________
> taglib-devel mailing list
> taglib-devel@...
> https://mail.kde.org/mailman/listinfo/taglib-devel
>
_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel

Re: attached picture

by Bugzilla from lalinsky@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Oct 19, 2009 at 7:47 PM, Martin Obreshkov
<martin.trashbox@...> wrote:
> Hi again, are you going to release a new version with new features
> added for now we i am maintaining the code by myself but don't want to
> do that for a long time i prefer to work with library without
> modifying it. So how is the new release going :)

Well, I planned it for this weekend, which didn't happen so hopefully
next weekend. :) But it's going to be a bug-fix release only. The MP4
cover art issue is technically also a new feature, but the fact that
it writes incorrect covr atoms is more important for me.

--
Lukas Lalinsky
lalinsky@...
_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel

Re: attached picture

by manigault :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, thanks i will provide as much feedback as possible
here http://en.roolz.org/Blog/Entries/2008/10/29_Using_taglib_to_extract_cover_image_from_MP3-files.html
is a post for a bug in AttachedPictureFrame::parseFields function

2009/10/19 Lukáš Lalinský <lalinsky@...>:

> On Mon, Oct 19, 2009 at 7:47 PM, Martin Obreshkov
> <martin.trashbox@...> wrote:
>> Hi again, are you going to release a new version with new features
>> added for now we i am maintaining the code by myself but don't want to
>> do that for a long time i prefer to work with library without
>> modifying it. So how is the new release going :)
>
> Well, I planned it for this weekend, which didn't happen so hopefully
> next weekend. :) But it's going to be a bug-fix release only. The MP4
> cover art issue is technically also a new feature, but the fact that
> it writes incorrect covr atoms is more important for me.
>
> --
> Lukas Lalinsky
> lalinsky@...
> _______________________________________________
> taglib-devel mailing list
> taglib-devel@...
> https://mail.kde.org/mailman/listinfo/taglib-devel
>
_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel

Re: attached picture

by Bugzilla from lalinsky@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Oct 19, 2009 at 10:12 PM, Martin Obreshkov
<martin.trashbox@...> wrote:
> Ok, thanks i will provide as much feedback as possible
> here http://en.roolz.org/Blog/Entries/2008/10/29_Using_taglib_to_extract_cover_image_from_MP3-files.html
> is a post for a bug in AttachedPictureFrame::parseFields function

Well, I don't think this is a bug in TagLib. The attached screenshot
of code starts reading the image data where the textural description
should start. If that does work correctly then it's because the file
contains corrupted ID3v2 tags. There should be at least one null byte
(2 for UTF-16) before the image data.

--
Lukas Lalinsky
lalinsky@...
_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel

Re: attached picture

by manigault :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi about your post

Thanks, that's great. What's missing is storing of the atom flag in
MP4::Item. In case of the covr atom it can be:

0x0D = JPEG
0x0E = PNG

in MP4::Atom there is no implementation of reading atoms flags so i thing i will have to read them by myself :)
But i couldn't find much info about it, can you tell me what is the format of the flags, are they stored right after (4 bytes atom length + 4 bytes atom name)
Thanks :) 

2009/10/19 Lukáš Lalinský <lalinsky@...>
On Mon, Oct 19, 2009 at 10:12 PM, Martin Obreshkov
> Ok, thanks i will provide as much feedback as possible
> here http://en.roolz.org/Blog/Entries/2008/10/29_Using_taglib_to_extract_cover_image_from_MP3-files.html
> is a post for a bug in AttachedPictureFrame::parseFields function

Well, I don't think this is a bug in TagLib. The attached screenshot
of code starts reading the image data where the textural description
should start. If that does work correctly then it's because the file
contains corrupted ID3v2 tags. There should be at least one null byte
(2 for UTF-16) before the image data.

--
Lukas Lalinsky
lalinsky@...
_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel


_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel

Re: attached picture

by Bugzilla from lalinsky@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Oct 20, 2009 at 12:10 PM, Martin Obreshkov
<martin.trashbox@...> wrote:

> Hi about your post
>>
>> Thanks, that's great. What's missing is storing of the atom flag in
>> MP4::Item. In case of the covr atom it can be:
>>
>> 0x0D = JPEG
>> 0x0E = PNG
>
> in MP4::Atom there is no implementation of reading atoms flags so i thing i
> will have to read them by myself :)
> But i couldn't find much info about it, can you tell me what is the format
> of the flags, are they stored right after (4 bytes atom length + 4 bytes
> atom name)

You should create a modified version of MP4::Tag::parseData. That
function already parses correctly the data atom (which is format <4b
int size> <4b char name> <4b int flags> <data>), but but doesn't save
the flags. It only uses it compare to the expected flag for the atom.

--
Lukas Lalinsky
lalinsky@...
_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel

Re: attached picture

by manigault :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks it works like charm :)
Please keep me in touch for related stuff about taglib :)

2009/10/20 Lukáš Lalinský <lalinsky@...>
On Tue, Oct 20, 2009 at 12:10 PM, Martin Obreshkov
> Hi about your post
>>
>> Thanks, that's great. What's missing is storing of the atom flag in
>> MP4::Item. In case of the covr atom it can be:
>>
>> 0x0D = JPEG
>> 0x0E = PNG
>
> in MP4::Atom there is no implementation of reading atoms flags so i thing i
> will have to read them by myself :)
> But i couldn't find much info about it, can you tell me what is the format
> of the flags, are they stored right after (4 bytes atom length + 4 bytes
> atom name)

You should create a modified version of MP4::Tag::parseData. That
function already parses correctly the data atom (which is format <4b
int size> <4b char name> <4b int flags> <data>), but but doesn't save
the flags. It only uses it compare to the expected flag for the atom.

--
Lukas Lalinsky
lalinsky@...
_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel


_______________________________________________
taglib-devel mailing list
taglib-devel@...
https://mail.kde.org/mailman/listinfo/taglib-devel