<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Alexander Kiel &#187; Lightroom</title>
	<atom:link href="http://www.alexanderkiel.net/category/lightroom/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alexanderkiel.net</link>
	<description>On Photography and other Things</description>
	<lastBuildDate>Wed, 27 Jan 2010 15:13:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>FormatMessageW Error in Lightroom Export Plugins</title>
		<link>http://www.alexanderkiel.net/2008/01/05/formatmessagew-error-in-lightroom-export-plugins/</link>
		<comments>http://www.alexanderkiel.net/2008/01/05/formatmessagew-error-in-lightroom-export-plugins/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 22:30:22 +0000</pubDate>
		<dc:creator>Alexander Kiel</dc:creator>
				<category><![CDATA[Lightroom]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://alexk.homeip.net/2008/01/05/formatmessagew-error-in-lightroom-export-plugins/</guid>
		<description><![CDATA[In November 2007 Adobe announced a Export SDK preview of there photo management application Lightroom. The Export SDK allows developers to write plugins for Lightroom which allow the user to export his photos to various places like Flickr, Smugmug or Picasa in an easy way.

On November 20th, 2007 Jeffrey Friedl announced its own Flickr Export [...]]]></description>
			<content:encoded><![CDATA[<p>In November 2007 Adobe <a href="http://blogs.adobe.com/lightroomjournal/2007/11/lightroom_13_the_export_sdk_pr.html">announced a Export SDK preview</a> of there photo management application <a href="http://www.adobe.com/products/photoshoplightroom/">Lightroom</a>. The <a href="http://labs.adobe.com/technologies/lightroomsdk/">Export SDK</a> allows developers to write plugins for Lightroom which allow the user to export his photos to various places like <a href="http://www.flickr.com/">Flickr</a>, <a href="http://www.smugmug.com/">Smugmug</a> or <a href="http://picasa.google.com/">Picasa</a> in an easy way.</p>

<p>On November 20th, 2007 Jeffrey Friedl <a href="http://regex.info/blog/2007-11-20/640">announced</a> its own <a href="http://regex.info/blog/photo-tech/lightroom-flickr/">Flickr Export Plugin</a> and on November 26th RBerteig first <a href="http://regex.info/blog/photo-tech/lightroom-flickr/#comment-11610">commented about a FormatMessageW Error</a> which occurs on Jeffrey&#8217;s and on the original Adobe Flickr Export Plugin.</p>

<h2>A bit History of FormatMessageW Debugging</h2>

<p>I for my part did not try any Export Plugin before January 1st, 2008. But as I did my first upload to Flickr, I got the FormatMessageW Error. I got it every time, not at some occurrences as others. As I went back to Jeffrey&#8217;s plugin site, I saw a big FormatMessageW Error box which told, that no one knows the reason behind this meaningless error. This let me start to debug Jeffrey&#8217;s plugin in order to get it working.</p>

<p>As the error occurs after a certain amount of time, I began make my photo smaller and smaller with the build-in resize control. On the standard Flickr size of boxed 500 px x 500 px my photo uploaded fine without the error. First I thought that the problem has something to do with the file size, I investigated the limit which was at about 600 kb. But than as I had a download running at the same time, the error also occurred at the small size. This brought me back into the time domain and at the end I knew that the FormatMessageW Error comes up after exactly 30 seconds.</p>

<p>After a bit of goggling, I found the Microsoft KnowledgeBase Article <a href="http://support.microsoft.com/kb/q181050/">Internet Explorer error &#8220;connection timed out&#8221; when server does not respond within five minutes</a> in which you can read:</p>

<blockquote>
  <p>By design, Internet Explorer imposes a time-out limit for the server to return data. The
  time-out limit is five minutes for versions 4.0 and 4.01 and is 60 minutes for versions 5.x and
  6. Also, the time-out limit is 30 seconds for Windows Internet Explorer 7.</p>
</blockquote>

<p>After reading a post on microsoft.public.inetsdk.programming.wininet called <a href="http://groups.google.com/group/microsoft.public.inetsdk.programming.wininet/browse_thread/thread/814785b124a8aac3">Increase timeout values. WinInet</a> where Saju Paul says:</p>

<blockquote>
  <p>I have IE7 installed and I am using the WinInet library for http requests.
  There is a peculiar requirement in my app where I have to wait for a long
  time to get the response for the request I make calling HttpSendRequest. But
  the call times out after 30 seconds or so.</p>
</blockquote>

<p>I came to the conclusion, that the timeout might be the problem. The reason is, that both the Internet Explorer and Lightroom use the same WinInet API for <acronym title="Hypertext Transfer Protocol">HTTP</acronym> requests. If you read the not so helpful error message from Lightroom carefully,</p>

<ol class="code"><li class="alt"><code>An internal error has occurred: Win32 API error (unknown error --</code></li><li><code>FormatMessageW failed) when calling HttpSendRequest from</code></li><li class="alt"><code>private_AgHttpClient_post_L</code></li></ol>

<p>you can see that Ligthroom is calling <code>HttpSendRequest</code>. The same API method as Saju Paul called and obviously the <acronym title="Internet Explorer">IE</acronym> too.</p>

<h2>A Workaround to FormatMessageW</h2>

<p>The KnowledgeBase Article suggests a solution for the timeout problem which consists of setting a non-standard timeout in the Windows Registry. I tried it setting the timeout to 60 seconds and whoops the FormatMessageW Error occurred after 60 seconds. So setting it to any value you need can be considered as an first workaround to the problem.</p>

<p>But I would <em>not recommend</em> you to do this unless you need a solution today and you know what you are doing if you edit your registry. Note that Adobe is aware of this bug. Please read the thread <a href="http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&amp;catid=664&amp;threadid=1326270">FormatMessageW failed error &#8211; Solution in sight?</a> on the Lightroom SDK forum where Eric Scouten says:</p>

<blockquote>
  <p>To be a little more clear about this, we have seen this happen occasionally, but not reliably.
  Only this morning did Alexander add the clue that it seems to be timeout related. (Thanks,
  Alex!) This might explain why we had less luck reproducing it using our internal LAN than
  some of you might have had using slower connections.</p>
  
  <p>Before the holiday break, we did attempt a fix internally, but we&#8217;re not rushing to release it
  since we&#8217;re not convinced that we fully understand the cause of the bug.</p>
</blockquote>

<p>That means that Adobe is aware of this bug until before the holidays and that they have my hint now to work on a solution. So I would guess that this problem will be solved in the next release of Lightroom.</p>

<p>For that folks of you who want set the timeout value to a non-standard value, please follow these  steps:</p>

<ul>
<li>Be sure that you have WinXP SP2 with IE7 as I don&#8217;t be able to test this for Vista</li>
<li>Shut down Lightroom and any application which uses the Internet Explorer </li>
<li>Download the file <a href="/blog/wp-content/uploads/2008/01/formatmessagew-60.reg">formatmessagew-60.reg</a></li>
<li>Double-click on this file in order to invoke it</li>
<li>Answer the question &#8220;Are you sure you want to add the information in path of .reg file to the registry?&#8221; with yes</li>
<li>Reboot your computer</li>
</ul>

<p>Please note that this instruction is provided <em>WITHOUT ANY WARRANTY</em>. I can&#8217;t take any responsibility for any problem you might have because of this registry update.</p>

<p>To uninstall the registry patch, please download and execute the file <a href="/blog/wp-content/uploads/2008/01/formatmessagew-uninstall.reg">formatmessagew-uninstall.reg</a>.</p>

<p>What did the .REG file change in the registry? It adds a single DWORD value with the name <code>ReceiveTimeout</code> and a value of 60000 (one minute) into the key <code>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings</code>. This is the same as described in this <a href="http://support.microsoft.com/kb/q181050/">KnowledgeBase Article</a>.</p>

<p>The file <a href="/blog/wp-content/uploads/2008/01/formatmessagew-60.reg">formatmessagew-60.reg</a> sets a timeout of only one minute. I provide it as an default, because higher values do not always work for me. But here comes a list of alternatives which sets a timeout as specified in the filename:</p>

<ul>
<li>120 seconds: <a href="/blog/wp-content/uploads/2008/01/formatmessagew-120.reg">formatmessagew-120.reg</a></li>
<li>180 seconds: <a href="/blog/wp-content/uploads/2008/01/formatmessagew-180.reg">formatmessagew-180.reg</a></li>
<li>300 seconds: <a href="/blog/wp-content/uploads/2008/01/formatmessagew-300.reg">formatmessagew-300.reg</a></li>
<li>600 seconds: <a href="/blog/wp-content/uploads/2008/01/formatmessagew-600.reg">formatmessagew-600.reg</a></li>
</ul>

<p>If you have any questions regarding the FormatMessageW and its workaround, please be free to ask here in the comments or in the <a href="http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&amp;catid=664&amp;threadid=1326270">SDK forum thread</a>.</p>

<h2>At the End</h2>

<p>At the end of the day I thank Adobe for a great peace of software namely Lightroom and Jeffrey Friedl for his effort in rolling out a feature rich Flickr Export Plugin. I&#8217;m sure that Adobe will fix this bug and I&#8217;m looking forward for the full-fledged SDK.</p>

<div class="update">

<h2>Update</h2>

<p>I decided to provide an .REG file for the registry update. I hope that it makes it easier for you to apply the little patch.</p>

</div>

<div class="update">

<h2>Update2</h2>

<p>I added an uninstall .REG file.</p>

</div>

<div class="update">

<h2>Update3 (04.04.2008)</h2>

<p>The problem is still present in <acronym title="Adobe Photoshop Lightroom">LR</acronym> 2 beta with an other error message, with says:</p>

<blockquote>
  <p>An internal error has occurred: ?:0: attempt to index a nil value</p>
</blockquote>

<p>And it seems to not honor my registry patch. I tried the 60 second one but the error pops up after 30 seconds in <acronym title="Adobe Photoshop Lightroom">LR</acronym> 2 beta where <acronym title="Adobe Photoshop Lightroom">LR</acronym> 1.3.1 gets up to the 60 second barrier.</p>

</div>]]></content:encoded>
			<wfw:commentRss>http://www.alexanderkiel.net/2008/01/05/formatmessagew-error-in-lightroom-export-plugins/feed/</wfw:commentRss>
		<slash:comments>118</slash:comments>
		</item>
		<item>
		<title>Lightroom 1.2 is out</title>
		<link>http://www.alexanderkiel.net/2007/09/14/lightroom-12-is-out/</link>
		<comments>http://www.alexanderkiel.net/2007/09/14/lightroom-12-is-out/#comments</comments>
		<pubDate>Fri, 14 Sep 2007 09:55:17 +0000</pubDate>
		<dc:creator>Alexander Kiel</dc:creator>
				<category><![CDATA[Lightroom]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://alexk.homeip.net/2007/09/14/lightroom-12-is-out/</guid>
		<description><![CDATA[Adobe today releases a bug fix update of here professional workflow solution for photographers Lightroom 1.2. You can download it at the Adobe Photoshop Lightroom Product Page.

I installed it right now at my desktop and my notebook under Windows XP. The only problem I had is the user interface language of Lightroom. It is now [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe today releases a bug fix update of here professional workflow solution for photographers Lightroom 1.2. You can download it at the <a href="http://www.adobe.com/products/photoshoplightroom/">Adobe Photoshop Lightroom Product Page</a>.</p>

<p>I installed it right now at my desktop and my notebook under Windows XP. The only problem I had is the user interface language of Lightroom. It is now bounded to the regional settings of Windows XP. If you have a German Windows but want a English Lightroom like me, you have to switch the regional settings to English.</p>

<p>If you use Photoshop <acronym title="Creative Suite 3">CS3</acronym>, you should update <acronym title="Adobe Camera Raw">ACR</acronym> to 4.2 in order to stay in sync with the <acronym title="Adobe Photoshop Lightroom">LR</acronym> RAW Converter. You can use the Adobe Updater from the help menu in <acronym title="Creative Suite 3">CS3</acronym>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.alexanderkiel.net/2007/09/14/lightroom-12-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

