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

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Mar 10 06:22:57 EST 2011


https://bugzilla.novell.com/show_bug.cgi?id=678480

https://bugzilla.novell.com/show_bug.cgi?id=678480#c0


           Summary: MPMediaItemArtwork is always returned as 55 x 55 px
                    image
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: iPhone
        OS/Version: Apple iOS 4.2
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: soren at wizarts-inc.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Third Party Developer/Partner
           Blocker: ---


Description of Problem:


Steps to reproduce the problem:
1. When running the attached test code I always get a 55 x 55 image from
artwork property on MPMediaItem. This results in a very pixelated image when
asking for a 256 x 256 px image. It seems the source is always only 55 x 55
2. The test code will output the bounds and imagecroprect on the console and
both are 55 x 55.


Actual Results:
55 x 55 pixel image returned

Expected Results:
Larger image corresponding to the cover art attached to the song in Itunes

How often does this happen? 
Always

Additional Information:
I have tried doing a little test in XCode using Objective-C and the image is
returned as expected.



Test sample code is here:
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.MediaPlayer;


namespace PlaylistBugTest
{
    public class Application
    {
        static void Main (string[] args)
        {
            UIApplication.Main (args);
        }
    }

    // The name AppDelegate is referenced in the MainWindow.xib file.
    public partial class AppDelegate : UIApplicationDelegate
    {
        // This method is invoked when the application has loaded its UI and
its ready to run
        public override bool FinishedLaunching (UIApplication app, NSDictionary
options)
        {
            // If you have defined a view, add it here:
            // window.AddSubview (navigationController.View);

            window.MakeKeyAndVisible ();

            // Gets the first song of the first playlist
            MPMediaQuery playlistsQuery = MPMediaQuery.playlistsQuery;
            MPMediaItemCollection[] playlists =
(MPMediaItemCollection[])playlistsQuery.Collections;
            MPMediaPlaylist foundPlaylist = (MPMediaPlaylist)playlists[0];

            MPMediaItem firstSong = foundPlaylist.Items[0];

            MPMediaItemArtwork artwork =
(MPMediaItemArtwork)firstSong.ValueForProperty (MPMediaItemProperty.Artwork);

            var imageRect = artwork.ImageCropRectangle;
            Console.WriteLine (imageRect.ToString ());

            var bounds = artwork.Bounds;
            Console.WriteLine (bounds);

            UIImage artWorkImage = artwork.ImageWithSize (imageRect);

            using (var myImage = new UIImageView (imageRect)) {
                myImage.Image = artWorkImage;
                myImage.Opaque = true;
                window.AddSubview (myImage);
            }

            return true;
        }

        // This method is required in iPhoneOS 3.0
        public override void OnActivated (UIApplication application)
        {
        }
    }
}

-- 
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