• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ID3 Album Art
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Problem with CIFilters
  • Next by Date: Re: Problem with CIFilters
  • Previous by thread: ID3 Album Art
  • Next by thread: UI tool kit gone in IB 3?
  • Index(es):
    • Date
    • Thread