Re: ID3 Album Art
Re: ID3 Album Art
- Subject: Re: ID3 Album Art
- From: Gregory Weston <email@hidden>
- Date: Sun, 11 May 2008 08:24:11 -0400
Mr. Gecko wrote:
Hello I am using this ID3 Framework for cocoa http://
drewfamily.homemail.com.au/Cocoa_-_ID3Tag_framework.html
and I want to add an image from the web which is an jpeg.
I have already tried this.
TagAPI *MP3 = [[TagAPI alloc] initWithGenreList:nil];
[MP3 examineFile:MP3Path];
NSBitmapImageRep *image = [[NSBitmapImageRep alloc] initWithData:
[NSData dataWithContentsOfURL:[NSURL URLWithString:[object
objectForKey:@"image"]]]];
NSMutableDictionary *imageDict = [NSMutableDictionary dictionary];
[imageDict setObject:image forKey:@"Image"];
[imageDict setObject:@"jpeg" forKey:@"Picture Type"];
[imageDict setObject:@"image/jpeg" forKey:@"Mime Type"];
[imageDict setObject:@"Album Art" forKey:@"Description"];
NSMutableArray *imageArr = [NSMutableArray new];
[imageArr addObject:imageDict];
[MP3 setImages:imageArr];
[MP3 updateFile];
and it did not work.
can anyone give me an example?
Thanks,
Mr. Gecko
My first reaction is that this is probably a question for the author
of the framework rather than for the Cocoa list. The address for that
is apparently email@hidden.
On looking through the code, I do have a couple of comments:
Your MP3 object is never released or autoreleased here. Not sure if
that's a leak or if you just didn't show the complete snippet.
Ditto image and imageArr.
There's a quirk in the fooWithContentsOfURL: methods in Cocoa whereby
you might get gzipped data instead of the actual content you're
expecting. It depends on the OS version and the URL scheme, so you
might want to split up that line a bit and make sure that what you're
actually getting back is sane.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden