<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Save UIImage Object as a PNG or JPEG File</title>
	<atom:link href="http://iPhoneDeveloperTips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html/feed" rel="self" type="application/rss+xml" />
	<link>http://iPhoneDeveloperTips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html</link>
	<description>iOS Developer Tips, Tricks and Tutorials.</description>
	<lastBuildDate>Wed, 08 Feb 2012 06:31:16 -0600</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Daniel</title>
		<link>http://iPhoneDeveloperTips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html#comment-66342</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Sat, 28 Jan 2012 02:53:58 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5640#comment-66342</guid>
		<description>Hi, I have a problem when I try to test the app on the device:

- When I look for the path to save the photo in the Documents directory, I get this path /var/mobile/Applications/9920C9E8-37E4-424C-ABA1-9F6E224594ED/Documents - this is because I&#039;m running the app on the device, I think.

- But, when I try to write out the content of the SAME path, I get the content of the Library/ApplicationSupport/iPhoneSimulator/5.0/Applications/IDofTheApplication/Documents - as I would be running it on the iPhone Simulator.

So, I can&#039;t know what am I saving and if it is everything ok.
Can anyone help me with this problem?

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hi, I have a problem when I try to test the app on the device:</p>
<p>- When I look for the path to save the photo in the Documents directory, I get this path /var/mobile/Applications/9920C9E8-37E4-424C-ABA1-9F6E224594ED/Documents &#8211; this is because I&#8217;m running the app on the device, I think.</p>
<p>- But, when I try to write out the content of the SAME path, I get the content of the Library/ApplicationSupport/iPhoneSimulator/5.0/Applications/IDofTheApplication/Documents &#8211; as I would be running it on the iPhone Simulator.</p>
<p>So, I can&#8217;t know what am I saving and if it is everything ok.<br />
Can anyone help me with this problem?</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Terry Vogelaar</title>
		<link>http://iPhoneDeveloperTips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html#comment-66238</link>
		<dc:creator>Terry Vogelaar</dc:creator>
		<pubDate>Thu, 26 Jan 2012 03:11:41 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5640#comment-66238</guid>
		<description>No, I didn&#039;t. I just display it smaller, so it doesn&#039;t bother me anymore. But it is a bit silly that it doesn&#039;t work.</description>
		<content:encoded><![CDATA[<p>No, I didn&#8217;t. I just display it smaller, so it doesn&#8217;t bother me anymore. But it is a bit silly that it doesn&#8217;t work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michel</title>
		<link>http://iPhoneDeveloperTips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html#comment-66235</link>
		<dc:creator>Michel</dc:creator>
		<pubDate>Thu, 26 Jan 2012 01:58:53 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5640#comment-66235</guid>
		<description>Hi,

It sounds like I have a similar problem.
On an old device (iPod touch about 3 years old) things work fine, but on an iPhone 4 I also get a double size PNG file. Did you solve the problem?

Thanks for the reply if you have the time.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>It sounds like I have a similar problem.<br />
On an old device (iPod touch about 3 years old) things work fine, but on an iPhone 4 I also get a double size PNG file. Did you solve the problem?</p>
<p>Thanks for the reply if you have the time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhuri</title>
		<link>http://iPhoneDeveloperTips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html#comment-66101</link>
		<dc:creator>madhuri</dc:creator>
		<pubDate>Mon, 23 Jan 2012 01:22:16 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5640#comment-66101</guid>
		<description>Hi, Thanks for the gr8 tutorial. 
My question is how to know the name of the image taken by the user using camera type source  in order to write the name of the image to the document directory.
And also how can we save the image taken by the user in the documents directory?</description>
		<content:encoded><![CDATA[<p>Hi, Thanks for the gr8 tutorial.<br />
My question is how to know the name of the image taken by the user using camera type source  in order to write the name of the image to the document directory.<br />
And also how can we save the image taken by the user in the documents directory?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven</title>
		<link>http://iPhoneDeveloperTips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html#comment-63857</link>
		<dc:creator>Steven</dc:creator>
		<pubDate>Mon, 05 Dec 2011 04:34:59 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5640#comment-63857</guid>
		<description>Awesome tutorial!
Works, Please make another tutorial on how to load the image from Documents! VERY MUCH appreciated!!</description>
		<content:encoded><![CDATA[<p>Awesome tutorial!<br />
Works, Please make another tutorial on how to load the image from Documents! VERY MUCH appreciated!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Terry Vogelaar</title>
		<link>http://iPhoneDeveloperTips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html#comment-60636</link>
		<dc:creator>Terry Vogelaar</dc:creator>
		<pubDate>Wed, 28 Sep 2011 03:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5640#comment-60636</guid>
		<description>Very helpful! I use it to save the artwork of the currently playing track. And I only have 1 minor problem with it. I ask for a 300 x 300 pixel image, but get a 640 x 640 pixel image. 

Here&#039;s the code:

NSString  *pngPath = [NSHomeDirectory() stringByAppendingPathComponent:@&quot;Documents/Artwork.png&quot;];
UIImage *plaatje;
MPMediaItem *currentItem;
currentItem = [[MPMusicPlayerController iPodMusicPlayer] nowPlayingItem];
if (currentItem == NULL)
    return @&quot;&quot;;
else {
    CGSize artworkImageViewSize = CGSizeMake(300, 300);
    MPMediaItemArtwork *artwork = [currentItem valueForProperty:MPMediaItemPropertyArtwork];
    if (artwork != nil) {
        plaatje = [artwork imageWithSize:artworkImageViewSize];
        [UIImagePNGRepresentation(plaatje) writeToFile:pngPath atomically:YES];
        return pngPath;
    } else {
        return @&quot;&quot;;
    }
}</description>
		<content:encoded><![CDATA[<p>Very helpful! I use it to save the artwork of the currently playing track. And I only have 1 minor problem with it. I ask for a 300 x 300 pixel image, but get a 640 x 640 pixel image. </p>
<p>Here&#8217;s the code:</p>
<p>NSString  *pngPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Artwork.png"];<br />
UIImage *plaatje;<br />
MPMediaItem *currentItem;<br />
currentItem = [[MPMusicPlayerController iPodMusicPlayer] nowPlayingItem];<br />
if (currentItem == NULL)<br />
    return @&#8221;";<br />
else {<br />
    CGSize artworkImageViewSize = CGSizeMake(300, 300);<br />
    MPMediaItemArtwork *artwork = [currentItem valueForProperty:MPMediaItemPropertyArtwork];<br />
    if (artwork != nil) {<br />
        plaatje = [artwork imageWithSize:artworkImageViewSize];<br />
        [UIImagePNGRepresentation(plaatje) writeToFile:pngPath atomically:YES];<br />
        return pngPath;<br />
    } else {<br />
        return @&#8221;";<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://iPhoneDeveloperTips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html#comment-56712</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Wed, 27 Jul 2011 14:02:20 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5640#comment-56712</guid>
		<description>Hello Everyone else who is having an issue with the views. I was able to fix it by actually creating an XIB with a capture button and a back button that is activated using the initWithNibName. I removed the - (id)init and then turned the - (void)buttonPressed:(UIButton *)button  in to an action called -(IBAction)buttonPressed and referenced it using a capture image in the XIB view. This way I was able to activate the image capture event while remaining in my own custom view controller. At the end of the image capture, once the &quot;Use&quot; button is selected, the XIB view is brought up which has a &quot;Back&quot; button that links back to the original form with the button that loads the CameraCaptureView.XIB view. If anyone needs help then reply to this and I&#039;ll check back later. Thanks again for the OP, you are a life saver my friend!

Nick</description>
		<content:encoded><![CDATA[<p>Hello Everyone else who is having an issue with the views. I was able to fix it by actually creating an XIB with a capture button and a back button that is activated using the initWithNibName. I removed the &#8211; (id)init and then turned the &#8211; (void)buttonPressed:(UIButton *)button  in to an action called -(IBAction)buttonPressed and referenced it using a capture image in the XIB view. This way I was able to activate the image capture event while remaining in my own custom view controller. At the end of the image capture, once the &#8220;Use&#8221; button is selected, the XIB view is brought up which has a &#8220;Back&#8221; button that links back to the original form with the button that loads the CameraCaptureView.XIB view. If anyone needs help then reply to this and I&#8217;ll check back later. Thanks again for the OP, you are a life saver my friend!</p>
<p>Nick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://iPhoneDeveloperTips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html#comment-56711</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Wed, 27 Jul 2011 13:32:13 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5640#comment-56711</guid>
		<description>Hello,

I am using a custom MainViewController to show all of my views. I have created a view for the camera controller and it seems to work fine, however I am unable to get back to my original view. I know that the camera creates it&#039;s own view instance and I am activating it through a button in a form from another view, but after image is captured, it returns to the activate button screen that it creates. I was able to rig it up to display the original form it was on using initWithNibName but when it loads the view non of the buttons or functions work because I think it&#039;s still outside of the MainViewController. 

Is there a way to integrate this script to work inside my view controller and get rid of all of the automatically generated separate view for the image capture script? Thanks for your help.

Nick</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I am using a custom MainViewController to show all of my views. I have created a view for the camera controller and it seems to work fine, however I am unable to get back to my original view. I know that the camera creates it&#8217;s own view instance and I am activating it through a button in a form from another view, but after image is captured, it returns to the activate button screen that it creates. I was able to rig it up to display the original form it was on using initWithNibName but when it loads the view non of the buttons or functions work because I think it&#8217;s still outside of the MainViewController. </p>
<p>Is there a way to integrate this script to work inside my view controller and get rid of all of the automatically generated separate view for the image capture script? Thanks for your help.</p>
<p>Nick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://iPhoneDeveloperTips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html#comment-55699</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Thu, 14 Jul 2011 22:35:50 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5640#comment-55699</guid>
		<description>I agree that the camera takes a while to save the file but I guess my goal would be to have the code return to the main screen (in my app at least) while the file is saving. The time it takes to save isn&#039;t an issue, the fact that the app waits for the save to take place before moving on to the next step is what is causing my current headache. Thanks for replying John, any input is highly welcome.</description>
		<content:encoded><![CDATA[<p>I agree that the camera takes a while to save the file but I guess my goal would be to have the code return to the main screen (in my app at least) while the file is saving. The time it takes to save isn&#8217;t an issue, the fact that the app waits for the save to take place before moving on to the next step is what is causing my current headache. Thanks for replying John, any input is highly welcome.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Muchow</title>
		<link>http://iPhoneDeveloperTips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html#comment-55688</link>
		<dc:creator>John Muchow</dc:creator>
		<pubDate>Thu, 14 Jul 2011 17:29:47 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5640#comment-55688</guid>
		<description>That does seems long, however I know the delay can be pretty long for the camera to save a file.</description>
		<content:encoded><![CDATA[<p>That does seems long, however I know the delay can be pretty long for the camera to save a file.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

