[Mono-bugs] [Bug 678480] MPMediaItemArtwork is always returned as 55 x 55 px image

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Mar 17 07:17:10 EDT 2011



Søren Thulesen <soren at wizarts-inc.com> changed:

           What    |Removed                     |Added
                 CC|                            |soren at wizarts-inc.com

--- Comment #2 from Søren Thulesen <soren at wizarts-inc.com> 2011-03-17 11:17:09 UTC ---
Hi Miguel, thanx a lot for your response.
I have already asked on stackoverflow. Got a link to a some objective-c code
trying to do the same thing that I was. I tried it out i XCode and it actually
I can see that my bugreport might not describe the problem 100% accurately so
here is some further info.

If I do the following in monotouch:

MPMediaItem firstSong = foundPlaylist.Items[0];

MPMediaItemArtwork artwork = (MPMediaItemArtwork)firstSong.ValueForProperty

var imageRect = new RectangleF (0f, 0f, 256.0f, 256.0f);
UIImage artWorkImage = artwork.ImageWithSize (imageRect);

Console.WriteLine (artwork.Bounds);
Console.WriteLine (artWorkImage.Size);
Console.WriteLine (artWorkImage.CurrentScale);

it will say that bounds is 55 x 55 and that i have a 55 x 55 sized image and
currentscale is 1.
This is not so good, since I asked for 256 x 256 image and I can see it in high
res in IPod (and in objective c.. see below)

if I do this in XCode:

MPMediaItemArtwork *artwork = [self valueForProperty:
CGRect bounds = artwork.bounds;
UIImage *image = [artwork imageWithSize:CGSizeMake(256.0f, 256.0f)]; 
CGSize size = image.size;
CGFloat scale = image.scale;

Then I can see that bounds is 55 x 55 (like it was in monotouch which I still
think is weird)
Size is 320 x 320 (which is also a little weird, considering I asked for a 256
x 256 image) and scale is 1 as in monotouch.

So it appers that monotouch is not returning the larger image to me from

When I add the image to an UIImageView the XCode version is fine, but the
Monotouch version is very pixelated.

I try to live by the "select is not broken" from the pragmatic programmer (that
the bug is most likely in my own code) but this time I cannot see what I am
doing wrong. As I see it the objective-c and monotouch code is doing the exact
same thing.

Best regards and thanx a lot for an awesome product!


Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list