<?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: Reading and Writing Tags for Photos in WPF</title>
	<atom:link href="http://blog.andreweichacker.com/2009/02/reading-and-writing-tags-for-photos-in-wpf/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.andreweichacker.com/2009/02/reading-and-writing-tags-for-photos-in-wpf/</link>
	<description>Andrew Eichacker</description>
	<lastBuildDate>Fri, 30 Jul 2010 23:03:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Scott Hanselman - Dealing with Images with Bad Metadata - Corrupted Color Profiles in WPF</title>
		<link>http://blog.andreweichacker.com/2009/02/reading-and-writing-tags-for-photos-in-wpf/comment-page-1/#comment-4350</link>
		<dc:creator>Scott Hanselman - Dealing with Images with Bad Metadata - Corrupted Color Profiles in WPF</dc:creator>
		<pubDate>Fri, 30 Jul 2010 23:03:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.andreweichacker.com/?p=128#comment-4350</guid>
		<description>[...] an aside, Andrew Eichacker has a nice post on how to read all the BitmapMetadata in WPF. There&#039;s lots in [...]</description>
		<content:encoded><![CDATA[<p>[...] an aside, Andrew Eichacker has a nice post on how to read all the BitmapMetadata in WPF. There&#039;s lots in [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Eichacker</title>
		<link>http://blog.andreweichacker.com/2009/02/reading-and-writing-tags-for-photos-in-wpf/comment-page-1/#comment-2663</link>
		<dc:creator>Andrew Eichacker</dc:creator>
		<pubDate>Tue, 05 Jan 2010 17:52:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.andreweichacker.com/?p=128#comment-2663</guid>
		<description>Sounds like the outputFile is currently in use, or the location is not accessible to the current user.

The outputFile might still be in use from this application, as the stream you opened for it earlier might not quite be closed.  If that&#039;s the case, you could go the route that I suggested above for urza, where you save a temporary file and copy it over.  Alternatively, you could create a loop that waits for the file to be accessible, but be sure to have a cap for that in case it never becomes accessible.

If it is a permissions problem, you&#039;ll have to require that your application be ran with administrator privileges, or notify the user that the file they are trying to modify is not accessible by them (I&#039;d go with the latter).</description>
		<content:encoded><![CDATA[<p>Sounds like the outputFile is currently in use, or the location is not accessible to the current user.</p>
<p>The outputFile might still be in use from this application, as the stream you opened for it earlier might not quite be closed.  If that&#8217;s the case, you could go the route that I suggested above for urza, where you save a temporary file and copy it over.  Alternatively, you could create a loop that waits for the file to be accessible, but be sure to have a cap for that in case it never becomes accessible.</p>
<p>If it is a permissions problem, you&#8217;ll have to require that your application be ran with administrator privileges, or notify the user that the file they are trying to modify is not accessible by them (I&#8217;d go with the latter).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://blog.andreweichacker.com/2009/02/reading-and-writing-tags-for-photos-in-wpf/comment-page-1/#comment-2661</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 05 Jan 2010 04:20:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.andreweichacker.com/?p=128#comment-2661</guid>
		<description>// finally, save the new file over the old file
        using (Stream outputFile = File.Open(filename, FileMode.Create, FileAccess.Write))
        {
            output.Save(outputFile);
        }


On the line output.Save(outputFile);
I&#039;m getting the error &#039;Access is Denied&#039;

Any idea what this means?</description>
		<content:encoded><![CDATA[<p>// finally, save the new file over the old file<br />
        using (Stream outputFile = File.Open(filename, FileMode.Create, FileAccess.Write))<br />
        {<br />
            output.Save(outputFile);<br />
        }</p>
<p>On the line output.Save(outputFile);<br />
I&#8217;m getting the error &#8216;Access is Denied&#8217;</p>
<p>Any idea what this means?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Vincent</title>
		<link>http://blog.andreweichacker.com/2009/02/reading-and-writing-tags-for-photos-in-wpf/comment-page-1/#comment-2518</link>
		<dc:creator>Ben Vincent</dc:creator>
		<pubDate>Sun, 06 Dec 2009 03:13:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.andreweichacker.com/?p=128#comment-2518</guid>
		<description>Interesting thread, I didn&#039;t appreciate another consequence of the Onload vs OnDemand. I&#039;ve published a pretty comprehensive metadata library on Codeplex if anyone is interested (http://fotofly.codeplex.com/).</description>
		<content:encoded><![CDATA[<p>Interesting thread, I didn&#8217;t appreciate another consequence of the Onload vs OnDemand. I&#8217;ve published a pretty comprehensive metadata library on Codeplex if anyone is interested (<a href="http://fotofly.codeplex.com/" rel="nofollow">http://fotofly.codeplex.com/</a>).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Eichacker</title>
		<link>http://blog.andreweichacker.com/2009/02/reading-and-writing-tags-for-photos-in-wpf/comment-page-1/#comment-1883</link>
		<dc:creator>Andrew Eichacker</dc:creator>
		<pubDate>Mon, 17 Aug 2009 16:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.andreweichacker.com/?p=128#comment-1883</guid>
		<description>Likely, the difference wasn&#039;t great enough to be seen by the human eye (or, at the least, an untrained eye).  If you do a bitwise comparison, you&#039;ll find that the two files are not equal; however, the loss isn&#039;t entirely great.  While that is so, it is definitely better to avoid loss at all.</description>
		<content:encoded><![CDATA[<p>Likely, the difference wasn&#8217;t great enough to be seen by the human eye (or, at the least, an untrained eye).  If you do a bitwise comparison, you&#8217;ll find that the two files are not equal; however, the loss isn&#8217;t entirely great.  While that is so, it is definitely better to avoid loss at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jader3rd</title>
		<link>http://blog.andreweichacker.com/2009/02/reading-and-writing-tags-for-photos-in-wpf/comment-page-1/#comment-1879</link>
		<dc:creator>jader3rd</dc:creator>
		<pubDate>Mon, 17 Aug 2009 02:27:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.andreweichacker.com/?p=128#comment-1879</guid>
		<description>I was having the same issues with the encoder.Save throwing an exception, but that went away when I marked the program to use STAThread.
Also, I was having the issue of having the new file being smaller, and used the advice of marking the cache options to None. But I was wondering, I couldn&#039;t see any differnce between the smaller and the larger file. Does someone know what I might have been missing?</description>
		<content:encoded><![CDATA[<p>I was having the same issues with the encoder.Save throwing an exception, but that went away when I marked the program to use STAThread.<br />
Also, I was having the issue of having the new file being smaller, and used the advice of marking the cache options to None. But I was wondering, I couldn&#8217;t see any differnce between the smaller and the larger file. Does someone know what I might have been missing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Eichacker</title>
		<link>http://blog.andreweichacker.com/2009/02/reading-and-writing-tags-for-photos-in-wpf/comment-page-1/#comment-1731</link>
		<dc:creator>Andrew Eichacker</dc:creator>
		<pubDate>Fri, 17 Jul 2009 21:40:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.andreweichacker.com/?p=128#comment-1731</guid>
		<description>Hey urza,

Are you able to write the new image to a separate file?  That is, replace:

        // finally, save the new file over the old file
        using (Stream outputFile = File.Open(filename, FileMode.Create, FileAccess.Write))
        {
            output.Save(outputFile);
        }

with:
        // finally, save the new file over the old file
        using (Stream outputFile = File.Open(filename + &quot;.tmp&quot;, FileMode.Create, FileAccess.Write))
        {
            output.Save(outputFile);
        }

If so, a workaround might be to save it to a temporary file (as shown) and override the original file afterwords.  This way, you can check the newly created file before overriding the original and causing data loss.

Andrew</description>
		<content:encoded><![CDATA[<p>Hey urza,</p>
<p>Are you able to write the new image to a separate file?  That is, replace:</p>
<p>        // finally, save the new file over the old file<br />
        using (Stream outputFile = File.Open(filename, FileMode.Create, FileAccess.Write))<br />
        {<br />
            output.Save(outputFile);<br />
        }</p>
<p>with:<br />
        // finally, save the new file over the old file<br />
        using (Stream outputFile = File.Open(filename + &#8220;.tmp&#8221;, FileMode.Create, FileAccess.Write))<br />
        {<br />
            output.Save(outputFile);<br />
        }</p>
<p>If so, a workaround might be to save it to a temporary file (as shown) and override the original file afterwords.  This way, you can check the newly created file before overriding the original and causing data loss.</p>
<p>Andrew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: urza</title>
		<link>http://blog.andreweichacker.com/2009/02/reading-and-writing-tags-for-photos-in-wpf/comment-page-1/#comment-1682</link>
		<dc:creator>urza</dc:creator>
		<pubDate>Sat, 11 Jul 2009 22:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.andreweichacker.com/?p=128#comment-1682</guid>
		<description>I am here again :/

I still have the owerflow exception. Even with the cloning. It only works with pictures that allready have some metadata. Thats why I tought it works - I tried it on pictures in windows vista MyPictures/Samples - all files there have ratings or other metadata.. but when I download photo or picture from internet. It has no metadata and the code throws up the exception. It also destroys the file. The file has size 0 B and is not readable.

any ideas? why is it only working with files that allready have metadata?</description>
		<content:encoded><![CDATA[<p>I am here again :/</p>
<p>I still have the owerflow exception. Even with the cloning. It only works with pictures that allready have some metadata. Thats why I tought it works &#8211; I tried it on pictures in windows vista MyPictures/Samples &#8211; all files there have ratings or other metadata.. but when I download photo or picture from internet. It has no metadata and the code throws up the exception. It also destroys the file. The file has size 0 B and is not readable.</p>
<p>any ideas? why is it only working with files that allready have metadata?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: urza</title>
		<link>http://blog.andreweichacker.com/2009/02/reading-and-writing-tags-for-photos-in-wpf/comment-page-1/#comment-1673</link>
		<dc:creator>urza</dc:creator>
		<pubDate>Fri, 10 Jul 2009 10:58:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.andreweichacker.com/?p=128#comment-1673</guid>
		<description>http://msdn.microsoft.com/en-us/library/bb643802.aspx</description>
		<content:encoded><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/library/bb643802.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb643802.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: urza</title>
		<link>http://blog.andreweichacker.com/2009/02/reading-and-writing-tags-for-photos-in-wpf/comment-page-1/#comment-1672</link>
		<dc:creator>urza</dc:creator>
		<pubDate>Fri, 10 Jul 2009 10:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.andreweichacker.com/?p=128#comment-1672</guid>
		<description>It seems to work now with the cloning.

Would you know what string do I need to pass to SetQuery if I would also like to change the image title and image description in metadata?</description>
		<content:encoded><![CDATA[<p>It seems to work now with the cloning.</p>
<p>Would you know what string do I need to pass to SetQuery if I would also like to change the image title and image description in metadata?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
