• 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: Viewing a UIImageJPEGRepresentation image on the desktop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Viewing a UIImageJPEGRepresentation image on the desktop


  • Subject: Re: Viewing a UIImageJPEGRepresentation image on the desktop
  • From: Randall Meadows <email@hidden>
  • Date: Fri, 23 Oct 2009 10:47:29 -0600

On Oct 22, 2009, at 3:38 PM, The Grand Poohbah wrote:

I need to examine an image that was stored in a property list as a NSData UIImageJPEGRepresentation. The property list is a plist file that is sent to me from an iPhone as an email attachment. The image is a "Data" class item in the property list and stored as a long series of hex bytes. I could view the image on an iPhone because that's how the image was created in the first place (I wrote it), but I'd much rather view it directly on my OS X Mac hardware.

Is there a way in OS X to view an image that was stored as a NSData UIImageJPEGRepresentation?

What I do often when debugging image issues is, stop in the debugger once I have a handle to the image data (in an NSData object), and make this call in the GDB console (assume imgData is the NSData object containing the JPEG image data):


call (BOOL)[imgData writeToFile:@"/Users/randy/Desktop/image.jpg" atomically:NO]

The result (1 or 0) will be printed out, and if 1 the image file can be found on your Desktop.

I've also skipped the NSData object completely, when all I have in my code is a UIImage object:

call (BOOL)[(NSData *)UIImagePNGRepresentation(myUiImage) writeToFile:@"/Users/randy/Desktop/image.jpg" atomically:NO]

(Disclaimer: written in Mail.app, but it should be pretty darn close to correct.)



--
randy



_______________________________________________

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


References: 
 >Viewing a UIImageJPEGRepresentation image on the desktop (From: The Grand Poohbah <email@hidden>)

  • Prev by Date: Make an NSButton send a message on right click
  • Next by Date: Re: IKImageBrowserView Dragging outside
  • Previous by thread: Viewing a UIImageJPEGRepresentation image on the desktop
  • Next by thread: Make an NSButton send a message on right click
  • Index(es):
    • Date
    • Thread