<?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></title>
	<atom:link href="http://www.marcelpatek.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marcelpatek.com/blog</link>
	<description></description>
	<lastBuildDate>Sat, 12 Jan 2013 15:55:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Adding random static images to your web-site</title>
		<link>http://www.marcelpatek.com/blog/2012/08/04/random-images-web/</link>
		<comments>http://www.marcelpatek.com/blog/2012/08/04/random-images-web/#comments</comments>
		<pubDate>Sat, 04 Aug 2012 15:38:09 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[jquery ajax]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[web technologies]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=1989</guid>
		<description><![CDATA[There are times when one wishes to add just a &#8220;simple&#8221; static photo to improve feel and presentation of our/client&#8217;s site or photo blog. The idea usually goes like this: I have a series of images that I want to display on my website. I do not need a slideshow. I just want to display [...]]]></description>
				<content:encoded><![CDATA[<p>There are times when one wishes to add just a &#8220;simple&#8221; static photo to improve feel and presentation of our/client&#8217;s site or photo blog. The idea usually goes like this:</p>
<ul>
<li>I have a series of images that I want to display on my website.</li>
<li>I do not need a slideshow.</li>
<li>I just want to display one image (on the page load) and I want to grab it at random.</li>
<li>My site is either based on WordPress theme or it is just a plain xhtml site.</li>
</ul>
<p>To accomplish this task, three web components are needed: html, css, and some sort of JavaScript. For the latter, I picked jQuery library which is well suited for this task. In addition, other standard web technologies will be used, such as JSON and Ajax.</p>
<div class="space"></div>
<h3><strong>Prerequisites:</strong></h3>
<p>For the following part, we will need to be comfortable with a simple editing of <span style="font-style:italic;">html</span> code, preparing <em>JSON</em> list of our photos, including <em>jQuery/Ajax</em> script, and with a little bit of <em>css</em> styling.</p>
<div class="space"></div>
<div class="space"></div>
<p><span id="more-1989"></span></p>
<div class="space"></div>
<div class="separator"></div>
<div class="space"></div>
<h2><strong>Putting all things together:</strong></h2>
<p>First, we start off with creating a structured list that will contain file name and title (description) of our photos. In this example, we have five photos with two data sets for each (title and url). Feel free to add, replace, or remove photos from this file, but always make sure that its structure remains the same. &#8220;Title&#8221; is essentially a header or photo description that will be displayed with it and &#8220;url&#8221; field takes the file name of your image.<br />
I often check integrity of JSON file at: <a href="http://jsonlint.com/">Jsonlint</a>.</p>
<div class="space"></div>
<p style="padding-left: 20px;"><span style="color: #ff00ff;">Example of JSON file &#8211; images.json</span></p>
<div class="space"></div>
<pre class="brush: jscript; title: ; notranslate">
// Building jason list
{&quot;images&quot;:[ 	 
{ 	 
	&quot;title&quot;: &quot;Sunset at the Horshoe Bend, AZ&quot;, 	 
	&quot;url&quot;: &quot;1.jpg&quot;	  
	 },	 
	 {	 
	&quot;title&quot;: &quot;Kauai Highlands&quot;, 	 
	&quot;url&quot;: &quot;2.jpg&quot; 
	 },	 
	 {	 
	&quot;title&quot;: &quot;Storm is coming&quot;, 	 
	&quot;url&quot;: &quot;3.jpg&quot;
	 },	 
	 {	 
	&quot;title&quot;: &quot;Venice - Grand Canal view from the Rialto Bridge&quot;, 	 
	&quot;url&quot;: &quot;4.jpg&quot; 
	 },	 
	 {	 
	&quot;title&quot;: &quot;Mexican wolf&quot;, 	 
	&quot;url&quot;: &quot;5.jpg&quot;  
	 }	 
	 ] 	 
}
</pre>
<div class="space"></div>
<p>Next, save the above code as images.json and create a new directory on your web server where all images and the just saved .json file will be located. I have chosen <em>images_rand</em> to distinguish it from common web-site images. For example, if your web site is at www.yoursite.com, new directory would go to: www.yoursite.com/images_rand. Again, this is where both images and the above images.json file would go.</p>
<div class="space"></div>
<h6>Editing html page:</h6>
<p>This is a very simple step: just place new <em>div</em> element into your html document, somewhere between the <em>body</em> tags:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;body&gt;
......
&lt;div id=&quot;singleshot&quot;&gt; 	 
&lt;/div&gt;
......
&lt;/body&gt;
</pre>
<p>I have assigned this element new id and called it &#8220;singleshot&#8221;. This is where the random image and description will be injected by the jQuery call. </p>
<div class="space"></div>
<h6>Styling the image:</h6>
<p>Position and style can be adjusted in <em>css</em> stylesheet which gets loaded with your page. You can find its name by viewing the page source from any browser.<br />
The link that you are looking for is in the <em>head</em> sections. For example:</p>
<p style="padding-left: 20px;"><span style="color: #ff00ff;">Part of the html <em>head</em> section</span></p>
<pre class="brush: xml; title: ; notranslate">
&lt;head&gt;
.....
&lt;link rel=&quot;stylesheet&quot; href=&quot;http:/www.yoursite/css/style.css&quot; type=&quot;text/css&quot; media=&quot;all&quot; /&gt;
.....
&lt;script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js?ver=1.6.2'&gt;&lt;/script&gt;
.....
&lt;/head&gt;
</pre>
<div class="space"></div>
<p style="padding-left: 20px;"><span style="color: #ff00ff;">Example of css file</span></p>
<pre class="brush: css; title: ; notranslate">
#singleshot {
 		padding:7px; 
 		background-color: rgb(80,80,80); 
 		-moz-border-radius: 5px; 
 		-webkit-border-radius: 5px; 
 	      border-radius: 5px;
       	margin-bottom: 60px;
       	width:665px;
       	height: 499px;
            }
#singleshot p {
	       background: rgba(90,90,90,0.3);
	       color: rgb(20,20,20);
	       position: relative;
	       top: -500px;
	       margin: 0 0 0 0 ;
	       padding: 5px 0 5px 0;
	       text-align: center;
	       font-family: Arial, Helvetica;
	       font-size: 2.2em;
	       font-weight: bold;
             }        
</pre>
<p>I have assigned this element new id called &#8220;singleshot&#8221;. This is where the image and description will be injected by jQuery call. </p>
<div class="space"></div>
<h6>jQuery code:</h6>
<p>First, we need to include jQuery library into our page. To accomplish this, include its source into the <em>head</em> section as shown above (part of the html section, line 5). The latest (Aug 2012) source is always at: <a href="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">Google Ajax API CDN</a>.<br />
Check for the most recent version at: <a href="http://docs.jquery.com/Downloading_jQuery">jQuery main web site </a>.<br />
Enter the following script into the <em>html</em> body, just before the &#8220;singleshot&#8221; <em>div</em> element at line 3 above (Editing html page).</p>
<div class="space"></div>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
  jQuery.getJSON('http://www.yoursite.com/../images_rand/images.json', function(data) { //Ajax call
         var item = data.images[Math.floor(Math.random()*data.images.length)]; //select image at random
         //build the complete &lt;img&gt; tag
         jQuery('&lt;img src=&quot;http://yoursite.com/../images_rand/' + item.url + ' &quot; width=&quot;665px&quot; height=&quot;499px&quot;&gt;').appendTo('#singleshot');
         jQuery('&lt;p&gt;' + item.title + '&lt;/p&gt;').appendTo('#singleshot'); //attach &quot;title&quot; to separate &lt;p&gt; tag
});
&lt;/script&gt;
</pre>
<div class="space"></div>
<div class="note">
<div class="notewarning">Since I was adapting this script for a WordPress template, I use jQuery instead of $ sign in the front of jQuery statements (else the script won&#8217;t work in WordPress).</div>
</div>
<p>The script starts with Ajax call to <em>images.json</em> file located on your server. Data is read into an array and random entry is assigned to a variable <em>item</em>. In the next step, the complete <em>img</em> tag is built by adding the image file name (url) and image dimensions, which are constant for the web page. Once done, the <em>img</em> tag is appended to <em>#singleshot</em> id in the empty <em>div</em> element. The last step of our script grabs the <em>title</em> and places it into a separate <em>p</em> tag.<br />
That&#8217;s all. Change the path to your images.json file and image dimensions to fit your page.</p>
<div class="space"></div>
<p>Final result is at the lower part of my <a href="http://www.marcelpatek.com/blog">Photography web site</a>.</p>
<div class="space"></div>
<div class="my_blog" style="border: 1px solid gray">
<table>
<tr>
<td>
<div id="attachment_1753" class="wp-caption alignmiddle" style="width: 705px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/08/blog_ajax.png" rel="shadowbox[sbpost-1989];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/08/blog_ajax.png" alt="" title="Example of working script" width="695" height="430" class="size-full wp-image-1753"/></a>
<p class="wp-caption-text">Example of working script at photo.marcelpatek.com</p>
</div>
</td>
</tr>
</table>
</div>
<div class="space"></div>
<div class="note">
<div class="notetip">While the code above works just fine, color of the description text sometimes does not match the image lightness. If we were just able to change the text color depending on image tones &#8230; Read below.
</div>
</div>
<div class="space"></div>
<h2><strong>Further improving our script:</strong></h2>
<p>In order to match the image density with color of the description header, we have to modify two parts. Namely, the <em>json</em> file and the <em>jQuery/Ajax</em> script.<br />
Below  is the new <em>json</em> list with additional tag, called <em>&#8220;scene&#8221;</em>. This is where we define the image category (light, dark, normal). Each category will then be used to change the <em>css</em> style of our description text.</p>
<div class="space"></div>
<pre class="brush: jscript; title: ; notranslate">
// Modified jason list (images1.json)
{&quot;images&quot;:[ 	 
{ 	 
	&quot;title&quot;: &quot;Sunset at the Horshoe Bend, AZ&quot;, 	 
	&quot;url&quot;: &quot;1.jpg&quot;,
	&quot;scene&quot;: &quot;light&quot;	  
	 },	 
	 {	 
	&quot;title&quot;: &quot;Kauai Highlands&quot;, 	 
	&quot;url&quot;: &quot;2.jpg&quot;,
	&quot;scene&quot;: &quot;dark&quot; 
	 },	 
	 {	 
	&quot;title&quot;: &quot;Gathering before the storm&quot;, 	 
	&quot;url&quot;: &quot;3.jpg&quot;,
	&quot;scene&quot;: &quot;light&quot;
	 },	 
	 {	 
	&quot;title&quot;: &quot;Venice - Grand Canal view from the Rialto Bridge&quot;, 	 
	&quot;url&quot;: &quot;4.jpg&quot;,
	&quot;scene&quot;: &quot;normal&quot; 
	 },	 
	 {	 
	&quot;title&quot;: &quot;Mexican wolf in Sonora Desert Museum in Tucson, AZ&quot;, 	 
	&quot;url&quot;: &quot;5.jpg&quot;,
	&quot;scene&quot;: &quot;normal&quot;  
	 }	 
	 ] 	 
} 	
</pre>
<div class="space"></div>
<p>Save the list as <em>images1.json</em> and upload it into the same directory as the <em>images.json</em> file above.</p>
<div class="space"></div>
<p>Now, the jQuery part. We define several additional variables to describe the color and the text background. Then, depending on the image category, empty variable <em>scene</em> is assigned the corresponding values and it is passed as a style into the <em>p</em> element at line 15.</p>
<div class="space"></div>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
  jQuery.getJSON('http://www.yoursite.com/../images_rand/images1.json', function(data) {
       var item = data.images[Math.floor(Math.random()*data.images.length)];
       //change rgb values below for the best color-match
       var light = &quot;color: rgb(20,20,100); background: rgba(190,190,190,0.25)&quot;;
       var dark =  &quot;color: rgb(255,206,0); background: rgba(90,90,90,0.25)&quot;;
       var normal = &quot;color: rgb(230,184,0); background: rgba(90,90,90,0.25)&quot;;
       var scene = &quot;&quot;; //keep the original style
       
		if (item.scene == 'dark') {scene = dark}
		else if (item.scene == &quot;light&quot;) {scene = light} 
	      else {scene = normal}

       jQuery('&lt;img src=&quot;http://www.yoursite.com/../images_rand/' + item.url + ' &quot; width=&quot;665px&quot; height=&quot;499px&quot; title=&quot;Random image&quot; alt=&quot;&quot; /&gt;').appendTo('#singleshot');
       jQuery('&lt;p style=&quot;' + scene + '&quot;&gt;' + item.title + '&lt;/p&gt;').appendTo('#singleshot');
});
&lt;/script&gt;
</pre>
<div class="space"></div>
<p>That&#8217;s it. Change the jQuery script on your html page and tweak the color settings between lines 5-7.</p>
<div class="space"></div>
<div class="separator"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2012/08/04/random-images-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retiring Windows XP to VMware Virtual Machine</title>
		<link>http://www.marcelpatek.com/blog/2012/04/15/retiring-xp-to-vmware-virtual-machine/</link>
		<comments>http://www.marcelpatek.com/blog/2012/04/15/retiring-xp-to-vmware-virtual-machine/#comments</comments>
		<pubDate>Sun, 15 Apr 2012 17:25:22 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[Windows XP]]></category>
		<category><![CDATA[Windows7]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=1576</guid>
		<description><![CDATA[Background: After many years of working with Windows XP OS, I recently (and finally) upgraded my OS system to Windows 7. I liked the XP system quite a lot, however, with so many recent software applications that were only working under newer OSs (e.g., Adobe Lightroom 4), I realized that it was the time to [...]]]></description>
				<content:encoded><![CDATA[<h3>Background:</h3>
<p>After many years of working with Windows XP OS, I recently (and finally) upgraded my OS system to Windows 7. I liked the XP system quite a lot, however, with so many recent software applications that were only working under newer OSs (e.g., Adobe Lightroom 4), I realized that it was the time to move on. I did a &#8220;clean&#8221; install on my current C: partition, which obviously meant that I lost all my programs and settings as installation went through the partition formatting. Another challenge was to maintain my disk partitioning scheme as I am used to have four partitions:</p>
<ol>
<li>Drive C: the main and boot partition with system maintenance software</li>
<li>Drive D: productivity software (Photoshop, Lightroom, Office, &#8230;)</li>
<li>Drive E: web and internet software</li>
<li>Drive F: data only</li>
</ol>
<p>Since C: partition contains Windows registry, links and registration info for the remaining software on those other partitions is lost. Having so many customizations and applications working well on my XP machine, I did not feel like losing them all at once. This is where the virtual machine comes in.</p>
<div class="note">
<div class="notetip">A little bit of background &#8211; virtual machine is a <a href="http://en.wikipedia.org/wiki/Virtual_machine">software implementation</a> of a computer system (real physical computer) that runs programs like a physical machine. It can be thought of as a computer in another computer. It comes handy when one wants to test a software outside of the main computer system or wants to keep older computer setup (or operating system), like in this case.
</div>
</div>
<div class="space"></div>
<p><span id="more-1576"></span></p>
<h2><strong>Software needed for the transition: </strong></h2>
<p>While I am sure that there are other options available, I am used to make system backups (images) of all critical partitions (C, D, E) with Acronis True Image (TI) application (at this time &#8211; <a href="http://www.acronis.com/homecomputing/products/trueimage/?gclid=CLbby7-5t68CFecZQgodlFTGkg" target="_blank">Home 2012</a>).  For the virtualization part, I use VMware Workstation 7 ( <a href="http://www.vmware.com/products/workstation/overview.html" target="_blank">version 8</a> is now available) application that runs both under Window and Linux systems. Depending on the version of True Image (and the .tib file), we may also need a copy (evaluation copy is just fine) of <a href="http://www.winimage.com/download.htm">WinImage</a>.</p>
<div class="space"></div>
<div class="note">
<div class="noteclassic">Here is the sequence of file transformations for two scenarios:<br />
a) TrueImage Echo -&gt; .tib -&gt; [TrueImage .tib -&gt; .vmdk] -&gt; VMware Workstation<br />
b) TrueImage Home 2012 -&gt; .tib -&gt; [TrueImage Home 2012 .tib -&gt; .vhd] -&gt; WinImage -&gt; vmdk -&gt; VMware Workstation
</div>
</div>
<div class="space"></div>
<p><strong style="margin-left:20px">From tib to vmdk:</strong><br />
I was quite happy with Acronis True Image Echo Workstation that was able to convert True Image images (.tib) directly to VMware .vmdk format (see the menu snapshot on the left). Done that way, the virtual disk could be used directly in the VMware Workstation or Player software (scenario a, Fig. 1).</p>
<div id="attachment_1595" class="wp-caption alignleft" style="width: 389px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/TI_Echo-vm.png" rel="shadowbox[sbpost-1576];player=img;"><img class="size-full wp-image-1595" title="True Image Echo menu" src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/TI_Echo-vm.png" alt="" width="379" height="253" /></a>
<p class="wp-caption-text">Fig. 1 TI-Echo Workstation Tools menu</p>
</div>
<p>Unfortunately, True Image Home 2012 edition does not support this feature and can only save virtual disks in .vhd format (found in &#8220;Acronis backup conversion&#8221; section). Had I made my .vmdk disks with the earlier Echo version, I would save myself quite a lengthy process of vhd to vmdk conversion. Since I used the newer Home 2012 edition and have the corresponding version of .tib file, here is how to proceed.</p>
<p>First, if you still have the older version of .tib image file, there is a free version of virtual disk (VD) conversion application from VMware called &#8220;VMware vCenter Converter Standalone Client&#8221; that can convert many third party VD file types into the vmdk type (Fig.2). Unfortunately, newer (TI-Home 2012)<img class="centerinfo tool_tip" src="http://www.marcelpatek.com/blog/wp-content/themes/Carta/images/question_mark_icon.gif" alt="info" width="14" height="14" tooltip="Acronis TrueImage Home 2012"/> VD .tib files cannot be converted.</p>
<div class="space"></div>
<div id="attachment_1605" class="wp-caption alignleft" style="width: 317px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmconverter_filetypes.png" rel="shadowbox[sbpost-1576];player=img;"><img class="size-full wp-image-1605" title="VMware converter" src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmconverter_filetypes.png" alt="" width="307" height="144" /></a>
<p class="wp-caption-text">Fig. 2 VMware Converter filetypes</p>
</div>
<p>If you only have image files created with TrueImage Home 2012, go to &#8220;Tools and utilities&#8221; tab and launch &#8220;Acronis backup conversion&#8221; under the &#8220;Backup conversion&#8221; section. Choose the .tib image of partition that you want to convert, click Next and choose archive location of the future .vhd file. Click Next, confirm, and wait until the conversion finishes. With the new .vhd file in hand, proceed to WinImage conversion into the .vmdk file.</p>
<div class="space"></div>
<div class="note">
<div class="notewarning">I recommend making a copy of the original .tib disk image file as I lost the original image after .tib -> .vhd conversion. So, just in case.  </div>
</div>
<div class="space"></div>
<p><strong style="margin-left:20px">WinImage:</strong><br />
As mentioned above and unless you already have it, download and install the copy of <a href="http://www.winimage.com/download.htm">WinImage</a>. I will go only briefly through the steps as there is already one detailed <a href="http://www.mydigitallife.info/how-to-convert-and-import-vhd-to-vmdk-vmware/">description on the web</a>.</p>
<div id="attachment_1646" class="wp-caption alignleft" style="width: 359px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/winimage0.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/winimage0-349x333.png" alt="" title="Getting to convert .vhd file" width="349" height="333" class="size-medium wp-image-1646" /></a>
<p class="wp-caption-text">Fig. 3 Convert Virtual Hard Disk image &#8230;</p>
</div>
<div id="attachment_1648" class="wp-caption alignright" style="width: 484px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/winimage1.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/winimage1.png" alt="" title="Select the .vhd file" width="474" height="316" class="size-full wp-image-1648" /></a>
<p class="wp-caption-text">Fig. 4 Select the .vhd file to convert</p>
</div>
<div class="space"></div>
<ol>
<li>Start the WinImage</li>
<li>Go to &#8220;Disk&#8221; and choose &#8220;Convert Virtual Hard Disk image &#8230;&#8221; (Fig. 3).</li>
<li>Next, select the earlier created .vhd file (Fig. 4).</li>
<li>Click &#8220;Next&#8221; and choose what type of virtual disk you want to create (I prefer dynamically expanding disk, Fig. 5).</li>
<li>Click OK and type the name of .vmdk file in the &#8220;file name&#8221; field (Fig. 6).</li>
<li>Click OK and wait for conversion to complete.</li>
<li>At the end, WinImage will ask to select the partition to connect to. Click &#8220;Cancel&#8221;.</li>
</ol>
<div class="my_blog">
<table>
<tr>
<td>
<div id="attachment_1652" class="wp-caption alignleft" style="width: 445px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/winimage3.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/winimage3.png" alt="" title="Type of the vd" width="435" height="152" class="size-full wp-image-1652" /></a>
<p class="wp-caption-text">Fig. 5 Choose the type of VD</p>
</div>
</td>
<td>
<div id="attachment_1653" class="wp-caption alignleft" style="width: 277px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/winimage2.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/winimage2.png" alt="" title="final file" width="267" height="113" class="size-full wp-image-1653" /></a>
<p class="wp-caption-text">Fig. 6 Type name of the final .vmdk file</p>
</div>
</td>
</tr>
</table>
</div>
<div class="space"></div>
<p>At this point, we should have one or more original partitions (in this case C, D, and E) converted to virtual disks and saved as the corresponding .vmdk files. Now, it is time to launch VMware Workstation.</p>
<div class="space"></div>
<p><strong style="margin-left:20px">VMware Workstation setup:</strong><br />
The following steps assume that you have VMware Workstation installed on your computer. For this tutorial, I will be using version 7. Here is the outline of main steps that we will go through:</p>
<ul>
<li>Create new virtual machine with a default hard disk.   </li>
<li>Replace the above disk with the boot partition created earlier (former c: drive).   </li>
<li>Customize this virtual machine (memory, network, shared folders).   </li>
<li>Add additional virtual disks (former D, E drives &#8211; if applicable).</li>
<li>Troubleshoot shared folders and internet access.</li>
</ul>
<p>We will start by launching the VMware Workstation. </p>
<ol>
<li>File -> New -> Virtual machine. </li>
<li>Choose the typical machine, click Next and at the Operating system page, select &#8220;I will install OS later&#8221; (Fig. 7).</li>
</ol>
<div id="attachment_1683" class="wp-caption alignleft" style="width: 377px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmset1.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmset1-367x333.png" alt="" title="set os system" width="367" height="333" class="size-medium wp-image-1683" /></a>
<p class="wp-caption-text">Fig. 7 Choosing the OS system</p>
</div>
<div id="attachment_1690" class="wp-caption alignright" style="width: 377px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmset2.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmset2-367x333.png" alt="" title="guest_os" width="367" height="333" class="size-medium wp-image-1690" /></a>
<p class="wp-caption-text">Fig. 8  Selecting guest operating system</p>
</div>
<div class="space"></div>
<ol>
<li value="3"> Click &#8220;Next&#8221; and for the operating system, click Microsoft Windows (XP Professional) as shown in Fig. 8.</li>
<li value="4">On the next page, enter virtual machine name &#8211; use any name (without the .vmdk extension) and select location of the new machine (same location where the vmdk file resides). If you get a warning message, click Continue.</li>
<li value="5">At the disk capacity page (Fig. 9), keep the default and click Next.</li>
<li value="6">Another Next and Finish.</li>
</ol>
<div id="attachment_1696" class="wp-caption alignleft" style="width: 377px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmset3.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmset3-367x333.png" alt="" title="disk_capacity" width="367" height="333" class="size-medium wp-image-1696" /></a>
<p class="wp-caption-text">Fig. 9 Specify disk capacity</p>
</div>
<div id="attachment_1697" class="wp-caption alignright" style="width: 427px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmset6.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmset6-417x333.png" alt="" title="remove_disk" width="417" height="333" class="size-medium wp-image-1697" /></a>
<p class="wp-caption-text">Fig. 10 Remove and Add virtual disks</p>
</div>
<div class="space"></div>
<p>At this point we shall see a new tab created in the main VMware window. </p>
<ol>
<li> On the left, click &#8220;Edit Virtual machine settings&#8221;.</li>
<li>Highlight the Hard Disk (IDE) 40 GB and click Remove at the bottom (Fig. 10).</li>
<li>Click Add, choose Hard Disk, Next and choose &#8220;Use existing virtual disk&#8221;. Browse for our c .vmdk file and confirm selection by clicking Finish and OK.</li>
</ol>
<p>Now, we have a modified virtual machine that can boot from the image of our original Windows c: partition.</p>
<p>In the next several steps, we will adjust settings of our new machine. </p>
<ol>
<li>Click &#8220;Edit virtual machine settings&#8221;.</li>
<li>Increase virtual memory to about 1,000 MB and set network adapter according to Fig. 11.</li>
<li>In Options tab, set the Share Folders as shown in Fig. 12. </li>
</ol>
<p>Now, let&#8217;s power on the machine. It should boot into the former system partition. New virtual machine will go through an automated installation of several drivers and will also issue a warning that our new XP system has to be activated. </p>
<div class="space"></div>
<div class="note">
<div class="noteclassic">Yes, you will need the original code from the XP package. Activation has to be done within 3 days and can be accomplished by sending proper credentials through the web (from virtual machine).</div>
</div>
<div class="space"></div>
<div id="attachment_1714" class="wp-caption alignright" style="width: 510px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmset4.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmset4-500x229.png" alt="" title="memory_nat" width="500" height="229" class="size-medium wp-image-1714" /></a>
<p class="wp-caption-text">Fig. 11 Setting memory and network adapter</p>
</div>
<div id="attachment_1716" class="wp-caption alignright" style="width: 510px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmset5.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vmset5-500x270.png" alt="" title="folders" width="500" height="270" class="size-medium wp-image-1716" /></a>
<p class="wp-caption-text">Fig. 12 Set shared folders</p>
</div>
<p>Now, it is time to connect additional disk images, i.e., .vmdk images of our other computer partitions created earlier. </p>
<ol>
<li>In the Virtual Machine Settings/Hardware, click Add at the bottom (similar to Fig. 10) and choose Hard Disk (IDE) option.</li>
<li>Browse for the corresponding .vmdk image file and confirm by OK</li>
<li>Repeat the same for each drive (Fig. 13)</li>
</ol>
<p>As a result, &#8220;original&#8221; disks (C, D, E, and F) are now part of our new virtual machine with all settings, programs, desktop icons, e-mails, &#8230; are back. While we continue working with the new Windows 7 system, we can get back into our previous &#8220;computer&#8221; at any time and transfer missed settings, links, bookmarks, icons to the new system.<br />
Unfortunately, things often do not go as one expects and disk drives may be switched (D: may be mapped as E:), real physical partition (F share) will not connect properly, or we have no access to the internet from the virtual machine. It is time to read the following section of troubleshooting.</p>
<div class="space"></div>
<div id="attachment_1718" class="wp-caption alignright" style="width: 333px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vm_settings1.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/vm_settings1.png" alt="" title="vm_settings1" width="323" height="291" class="size-full wp-image-1718" /></a>
<p class="wp-caption-text">Fig. 13 Adding other virtual disks</p>
</div>
<h3>Troubleshooting:</h3>
<p>Disk drive letter:<br />
After adding single .vmdk disk images, resulting order of drives may differ (e.g., E, D instead of D, E). Since windows registry and links are originating from the c: partition, many desktop icons and programs will be blank or not working. We need to change the assignment of drive letters to correct this situation.</p>
<ol>
<li>From within the virtual machine, go to Start, Run and type diskmgmt.msc into the blank field.</li>
<li>Disk management window will open (Fig. 14) that will allow us to change the drive letter.</li>
<li>Click (highlight) the mislabeled disk (say, D in this example would read E), right-mouse-click and select Change Drive Letter and Paths.</li>
<li>New window will open (Fig. 15) where we could change the drive letter as indicated.</li>
</ol>
<div class="note">
<div class="notewarning">Make sure that unique letter is assigned to each partition. Computer cannot have the same letter pointing to two different partitions. If that would be the case, change the letter of other drives to end up with unique drive identifiers.</div>
</div>
<div class="my_blog">
<table>
<tr>
<td>
<div id="attachment_1720" class="wp-caption alignleft" style="width: 449px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/disk-drive1.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/disk-drive1-439x333.png" alt="" title="disk" width="439" height="333" class="size-medium wp-image-1720" /></a>
<p class="wp-caption-text">Fig. 14 Identify disk that needs new letter</p>
</div>
</td>
<td>
<div id="attachment_1721" class="wp-caption alignleft" style="width: 332px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/disk-drive2.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/disk-drive2-322x333.png" alt="" title="disk2letter" width="322" height="333" class="size-medium wp-image-1721" /></a>
<p class="wp-caption-text">Fig. 15 Change disk letter</p>
</div>
</td>
</tr>
</table>
</div>
<div class="space"></div>
<h6>Map the share drive:</h6>
<p>Earlier, we have mapped the data disk (real physical partition) to our new virtual machine (Fig. 12).</p>
<div class="my_blog">
<table>
<tr>
<td>
<div id="attachment_1748" class="wp-caption alignleft" style="width: 241px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/mapping1a.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/mapping1a.png" alt="" title="mapping drive" width="231" height="173" class="size-full wp-image-1748" /></a>
<p class="wp-caption-text">Fig. 16 Mapped drive in the Windows Explorer</p>
</div>
</td>
<td>
<div id="attachment_1749" class="wp-caption alignleft" style="width: 265px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/mapping1b.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/mapping1b.png" alt="" title="mapping1b" width="255" height="141" class="size-full wp-image-1749" /></a>
<p class="wp-caption-text">Fig. 17 Drive remapped to My Computer</p>
</div>
</td>
</tr>
</table>
</div>
<div class="space"></div>
<p>Mapped drive actually shows up in the &#8220;My network Places&#8221; under the &#8220;VMware Shared Folders&#8221; menu (Fig. 16). While we can use this path and browse the local mapped drive, if any icons or links in the new VM point to this drive, they would be broken. To correct that, we need to re-map this drive as the original data drive in My Computer (e.g., F: as in Fig. 17). </p>
<ol>
<li>In Windows Explorer, go to Tools -> Map Network Drive. </li>
<li>Choose any unused letter in the Drive: pull down menu (e.g., S:)</li>
<li>In the Folder: field browse to the folder that we want to re-map (F:) as shown in Fig. 16.</li>
<li>Check the &#8220;Reconnect at logon&#8221; box and click Finish.</li>
</ol>
<p>Our VM shared drive (F:) will be mapped as a network file to My computer (Fig. 18). Even though it is mapped under letter S:, computer sees it as the original F: drive.</p>
<div class="my_blog">
<table>
<tr>
<td>
<div id="attachment_1753" class="wp-caption alignmiddle" style="width: 457px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/mapping2png.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/mapping2png.png" alt="" title="mapping2" width="447" height="329" class="size-full wp-image-1753" /></a>
<p class="wp-caption-text">Fig. 18 Mapping network drive to My computer</p>
</div>
</td>
</tr>
</table>
</div>
<div class="space"></div>
<h6>Internet connection:</h6>
<p>Network connection is a hit and miss scenario when running VMware Workstation under Windows 7. The initial setup is shown in Fig. 11. Make sure that &#8220;<a href="http://en.wikipedia.org/wiki/NAT">NAT</a>:&#8221; is selected and &#8220;Connect at power on&#8221; is checked. This is basic and supposedly the easiest choice. Additional setting to check:</p>
<ul>
<li>In the VMware application, go to Edit -> Virtual Network Editor.</li>
<li>Make sure that VMnet8 is associated with NAT and connected (Fig. 19). Note the VMnet0 Bridged setting that we try use later.</li>
<li>In Windows 7, click on Start and in the search field type &#8220;network and sharing center&#8221;.</li>
<li>Overview of the local network settings will appear (Fig. 20). We should see the VMnet8 adapter installed with &#8220;No Internet access&#8221; above it (that is OK).</li>
</ul>
<div class="my_blog">
<table>
<tr>
<td>
<div id="attachment_1762" class="wp-caption alignleft" style="width: 405px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/network1.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/network1-395x333.png" alt="" title="network1" width="395" height="333" class="size-medium wp-image-1762" /></a>
<p class="wp-caption-text">Fig. 19 Virtual Network Editor in VMware Workstation</p>
</div>
</td>
<td>
<div id="attachment_1760" class="wp-caption alignleft" style="width: 460px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/network3.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/network3-500x161.png" alt="" title="network3" width="450" height="161" class="size-medium wp-image-1760" /></a>
<p class="wp-caption-text">Fig. 20 Win7 Network settings</p>
</div>
</td>
</tr>
</table>
</div>
<p>By choosing &#8220;NAT&#8221;, we let the router assign IP address to our virtual machine through the <a href="http://en.wikipedia.org/wiki/DHCP">DHCP</a> protocol. For a communication between computers (including the virtual ones) to happen, network adapters (so called NICs) have to be present (typically they are part of computer motherboard accessible through ethernet ports). The Plug and Play code in Windows handles all the work of installing drivers for those adapters.<br />
Settings in the virtual machine (XP Pro) are shown in Fig. 21-22.</p>
<div class="my_blog">
<table>
<tr>
<td>
<div id="attachment_1770" class="wp-caption alignleft" style="width: 500px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/networkxp1.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/networkxp1-500x69.png" alt="" title="networkxp1" width="490" height="69" class="size-medium wp-image-1770" /></a>
<p class="wp-caption-text">Fig. 21 Network settings in Win XP (virtual)</p>
</div>
</td>
<td>
<div id="attachment_1771" class="wp-caption alignleft" style="width: 371px"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/networkxp2.png" rel="shadowbox[sbpost-1576];player=img;"><img src="http://www.marcelpatek.com/blog/wp-content/uploads/2012/04/networkxp2.png" alt="" title="networkxp2" width="361" height="263" class="size-full wp-image-1771" /></a>
<p class="wp-caption-text">Fig. 22 Details for Local Area Connection</p>
</div>
</td>
</tr>
</table>
</div>
<p>Click My Computer -> My Network Places -> Network Connections to review what networks are setup and available (Fig. 21). Device name should read something like &#8220;VMware AMD adapter&#8221;. In my case, I have two adapters installed for testing purposes (not necessary). Right-mouse click on &#8220;Local Area Connection&#8221; and select Properties. We should see connection modules shown in Fig. 22.</p>
<div class="note">
<div class="noteclassic">Make sure that same protocols are set in Virtual Network Adapter (Fig. 19) and Virtual Machine Settings (Fig. 11). The latter is also accessible via a little icon (looks like two monitors) at the bottom-right of the VMware Workstation application.</div>
</div>
<div class="space"></div>
<p>&nbsp;</p>
<div class="separator"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2012/04/15/retiring-xp-to-vmware-virtual-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Browsers &amp; Color Management II &#8211; the Code</title>
		<link>http://www.marcelpatek.com/blog/2011/12/23/cm-code/</link>
		<comments>http://www.marcelpatek.com/blog/2011/12/23/cm-code/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 15:15:10 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Color management]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=1343</guid>
		<description><![CDATA[This post follows on the Browsers &#38; Color Management I &#8211; Sending Color Patches in through the Web Browser with more details on the code used to drive images through the browser window. As one might have expected, three components were needed: html, css, and some sort of JavaScript. For the latter, I picked jQuery [...]]]></description>
				<content:encoded><![CDATA[<p>This post follows on the <a href="http://www.marcelpatek.com/blog/2011/11/27/cm-patches/">Browsers &amp; Color Management I &#8211; Sending Color Patches in through the Web Browser</a> with more details on the code used to drive images through the browser window. As one might have expected, three components were needed: html, css, and some sort of JavaScript. For the latter, I picked jQuery library (jquery-1.7.min.js) which is well suited for this task.</p>
<h2></h2>
<h2><strong>About the code:</strong></h2>
<p>jQuery code used in this project is essentially a slideshow script that works on the client side. That explains why we do not need any active connection to the Internet. It will run in our browser providing that JavaScript is enabled. Since it turns images into a slideshow, it can be used for many other purposes, e.g., to display photos on our personal web site. jQuery is <a title="Free and open source software" href="http://en.wikipedia.org/wiki/Free_and_open_source_software">free, open source software</a>, <a title="Dual-licensing" href="http://en.wikipedia.org/wiki/Dual-licensing">dual-licensed</a> under the <a title="MIT License" href="http://en.wikipedia.org/wiki/MIT_License">MIT License</a> or the <a title="GNU General Public License" href="http://en.wikipedia.org/wiki/GNU_General_Public_License#Version_2">GNU General Public License, Version 2</a> and it is included in the &#8220;js&#8221; folder inside the zip file.</p>
<div class="space"></div>
<p>If you have not done so before, download it here:</p>
<div class="space"></div>
<p><a href="http://www.marcelpatek.com/blog/wp-content/plugins/download-monitor/download.php?id=patches1_0_1.zip"> Patches1.0.1.zip v 1.01 </a>  <img style="margin: 0px 10px -5px 10px" src="http://www.marcelpatek.com/blog/wp-content/downloads/zip.gif" width="20" height="20" alt="Patches1.0.1.zip" />  |   Complete set of files. Fixed a minor error in the index increment and displaying full set of images.  &#8211;  [downloaded 119 times]</p>
<div class="space"></div>
<div class="note">
<div class="noteclassic">The code below is just a sample of the whole script with associated files, shown only to outline the structure and logic of the script.</div>
</div>
<div class="space"></div>
<div class="space"></div>
<p><span id="more-1343"></span></p>
<div class="separator"></div>
<div class="space"></div>
<p id="part1" style="padding-left: 30px;"><span style="color: #ff00ff;">manual_patches.js [part 1]</span></p>
<div class="space"></div>
<p>The script starts with declaration of several variables. These are mostly arrays that are used to store different sets of images. Function &#8220;mainimage()&#8221; (line 9) is the heart of the script. It takes index &#8220;nr&#8221; and displays the next image in &#8220;array0&#8243;. Interestingly, there are three calls to the white patch, all in order to provide a stage at which a measuring device can read the white point. During the &#8220;onclick&#8221; event at the &#8220;Next&#8221; button, the first white patch will hide (line 5, [<a href="#part3">part 3</a>], id=&#8221;white&#8221;). Next, mainimage() function will fire up by fading out another instance of the white patch (class=&#8221;img1&#8243;) and the index will advance to &#8220;0&#8243;. This happens at line 10 with the &#8220;complete&#8221; callback function that is fired once the fadeOut event is complete. Only then, the next image in array fades in (second image). Index gets incremented by the event function (lines 4, 17 in the [<a href="#part3">part 3</a>]) and its value will be displayed in the Patch field which is &lt;p&gt; element of the html document with id attribute of &#8220;count&#8221; (&lt;p id=&#8221;count&#8221;&gt; &lt;/p&gt;).</p>
<pre class="brush: jscript; title: ; notranslate">
// Declare global variables
var index = -1; // accounting for the three white patches
var array0 = [];
var array1 = [];
var array1a = [];
var spaces = [&quot;untagged&quot;, &quot;srgb&quot;, &quot;argb&quot;, &quot;prophoto&quot;];

// Main slideshow function
function mainimage(nr) {
      // when run, move from the first image to the next one
     $(&quot;div.mainimg ul li:eq(0) div img&quot;).fadeOut({&quot;duration&quot;:100, complete:function() {
         $(this).attr(&quot;src&quot;,array0[nr]).fadeIn(100); //display image from the array based on the index and src attribute
         nr = index; //this will set the index of the currently selected image
	$('#count p').html('Patch: '+ (index+1) + ''); // display image sequence number
         };
</pre>
<div class="space"></div>
<div class="separator"></div>
<div class="space"></div>
<p id="part2" style="padding-left: 30px;"><span style="color: #ff00ff;">manual_patches.js [part 2]</span></p>
<div class="space"></div>
<p>Next goes a general wrapper function() used for several events and settings. At the beginning, default settings are defined, such as, default color space (untagged), array0 that contains src attribute of all images, default count of images and its screen output for &#8220;Total images: &#8220;. Script then follows by generating CSS buttons which have the &#8220;<em>onclick</em>&#8221; event attached to each of them.</p>
<div class="space"></div>
<p>The key part of the wrapper function is the selection of color spaces (line 20). It involves the standard &#8220;click()&#8221; function that sets the color space variable and css styling upon the click event. There are four selection calls that have very similar structure. Once the color space variable is set, the main array0 is generated by calling the function &#8220;makearray()&#8221; at line 48. At the same time, radio button for the set selection is cleared to have no default state (line 39).</p>
<div class="space"></div>
<p>Now, about the &#8220;makearray()&#8221; function. It looks at the src path of each image in #photos  html tag and alters the hard-coded path by substituting the default path with the current space variable set above upon the click event (e.g., line 35). This is done with help of the callback function (index, attr). In the next step, an array of image src tags is created using the &#8220;each&#8221; method. Actually, two arrays are created; one with the full set of images (array1) and another one with the limited set of images (array1a). Which array to use depends on the radio button selection (line 66). Conditional statement and two methods of copying arrays are used. Finally, the total image count is updated by reading the array0 length.</p>
<div class="space"></div>
<pre class="brush: jscript; title: ; notranslate">
$(function(){
// Set defaults
 		 curr_space = spaces[0]; // untagged images are set as default
		 makearray(); //run function defined at line 48
		 array0 = array1a.slice(); // plain copy of array1a
		 totalimages = 12;
		 $('#total p').html('Total images: '+ totalimages + '');

//Prepare radio and CSS buttons
	$(&quot;#patch-area&quot;).append('&lt;a id=&quot;next&quot; onclick=&quot;next();&quot; href=&quot;#&quot;&gt;Next&lt;/a&gt;');
	$(&quot;#patch-area&quot;).append('&lt;a id=&quot;reset&quot; onclick=&quot;reset();&quot; href=&quot;#&quot;&gt;Reset&lt;/a&gt;');
	$(&quot;#patch-area&quot;).append('&lt;a id=&quot;previous&quot; onclick=&quot;previous();&quot; href=&quot;#&quot;&gt;Previous&lt;/a&gt;');

           $('input').click(function () {
           $('input:not(:checked)').parent().removeClass(&quot;selected&quot;); // box selection styling
           $('input:checked').parent().addClass(&quot;selected&quot;);
              });

//-----------------------&gt; select color space
$(&quot;#untagged&quot;).click(function(){
		if ($(this).text() == &quot;Untagged - No CM&quot;) 	{
		$(this).text(&quot;Untagged - No CM&quot;);
		$('#selection a').css('background','#000F7D');
		$('#untagged').css('background','#ac0000');
		 curr_space = spaces[0];	// Set space for this option
		 makearray(); // make the array - see below
		 			}
		});

$(&quot;#srgb&quot;).click(function(){
		if ($(this).text() == &quot;sRGB&quot;) {
		$(this).text(&quot;sRGB&quot;);
		$('#selection a').css('background','#000F7D');
		$('#srgb').css('background','#ac0000');
		curr_space = spaces[1]; // Set space for this option
		array0 = []; // Clear all arrays
		array1 =[];
		array1a = [];
		$('#source2').prop('checked', false); // Clear selection of the set (radio buttons)
		makearray();
				 	}
		});

//............ similar for other color spaces
// -----------------------------&gt; end of space selection
//-------------------------------&gt; function to prepare arrays based on space

function makearray() 	{
	$('img').attr('src',function(index,attr){ // Create correct path to images based on the selected color space
        return attr.replace(/srgb|argb|prophoto|untagged/,curr_space);
   		     });

	$('#photos img').each(function() { // take all images from #photos in index.html
    	array1.push($(this).attr('src')); // and push their src attribute into array1
			});

	$('#photos img').filter('.keep').each(function() { // take some images from #photos (gray and primaries)
    	array1a.push($(this).attr('src')); // and push their src attribute into an array1a
			});

//-----------------------------&gt; Select which set of images to run

     $(&quot;input[name='set']&quot;).live('click', function(){
 	 var radio_value = $(this).val(); // Get the button value after it is clicked

  	 if(radio_value == 'short') {
   	 	array0 = array1a.slice(); } // Just gray and primaries
   	 else 	{
   	 	array0 = []; //Empty Array0 and assign it again in the next step
   	 	array0 = array1; // Full set of patches
   		};

 	totalimages = array0.length; //  Update Array0 size and print it to the screen
 	$('#total p').html('Total images: '+ totalimages + '');
				});

					          }
});
</pre>
<div class="space"></div>
<div class="separator"></div>
<div class="space"></div>
<p id="part3" style="padding-left: 30px;"><span style="color: #ff00ff;">manual_patches.js [part 3]</span></p>
<div class="space"></div>
<p>The scripts ends with section of &#8220;events&#8221;, specifically with assignment of events to buttons  NEXT, PREVIOUS, and RESET. These assignments consist of index increment (decrement), text styling (hide), and trigger of the main slideshow (mainimage(index)) at the line 8. Reset to the original state is executed by the &#8220;window.location.reload(true)&#8221; statement.</p>
<div class="space"></div>
<pre class="brush: jscript; title: ; notranslate">
// Events
function next() {
        if (index &lt; array0.length) {
            index++;
            $('#white').hide(); // Hide the white patch
            $('#container ol li').hide(); //Hide instruction area
            $('#third').hide(); // Hide the instruction header
            mainimage(index); //start the slideshow
           }
        else {
        	window.location.reload(true); // reset to beginning
        	 }
       };

function previous() {
        if (index &lt; array0.length &amp; index &gt; 0) {
            index--;
            mainimage(index);
           }
        else {
        	window.location.reload(true); // reset to beginning
        	 }
       };

function reset() {
        	window.location.reload(true); // reset to beginning
        	};

</pre>
<div class="separator"></div>
<div class="space"></div>
<p id="index" style="padding-left: 30px;"><span style="color: #ff00ff;">index.html, only part</span></p>
<div class="space"></div>
<p>The main part of XHTML mark-up is outlined below. The body tag opens with a typical block level element &lt;div&gt; with <em>id</em> attribute of &#8220;container&#8221;. Navigation mark-up follows next wrapped in another &lt;div&gt; tag with<em> id</em> &#8220;selection&#8221;. Those are color space buttons, counters, radio buttons and their description. Patch area starts at line 28 with <em>div</em> element encapsulating the first white patch (lines 28-29). This patch is not part of the animation and serves the purpose of calibrating the measuring device. Another instance of the white patch is defined in another <em>div</em> element with class &#8220;mainimg&#8221; (lines 31-35). This is the first image that fades out when the animation starts.</p>
<p>Next is the complete list of available images wrapped in<em> div</em> element with <em>id</em> &#8220;photos&#8221;. Each image either has class &#8220;keep&#8221; associated with it or has no class at all. In the former case, the &#8220;keep&#8221; class &#8220;marks&#8221; the image for inclusion in the &#8220;shorter&#8221; list of gray ramp and primaries. Sub-directory &#8220;untagged&#8221; is the default part of <em>src</em> path. It is this part that gets replaced by the chosen color space variable (on &#8220;click&#8221; event) through the jQuery script. If you wish to provide your own set of images, it is the place where they would be entered.</p>
<div class="space"></div>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;container&quot;&gt;
   &lt;div id=&quot;selection&quot;&gt;
    &lt;a id=&quot;untagged&quot; href=&quot;#&quot;&gt;Untagged - No CM&lt;/a&gt;
    &lt;a id=&quot;srgb&quot; href=&quot;#&quot;&gt;sRGB&lt;/a&gt;
    &lt;a id=&quot;argb&quot; href=&quot;#&quot;&gt;Adobe98 RGB&lt;/a&gt;
    &lt;a id=&quot;prophoto&quot; href=&quot;#&quot;&gt;Pro Photo&lt;/a&gt;

   &lt;div id=&quot;total&quot;&gt;Total Images:&lt;/div&gt;
   &lt;div id=&quot;count&quot;&gt;Patch: white&lt;/div&gt;

&lt;ul id=&quot;radio&quot;&gt;
&lt;li&gt;&lt;input id=&quot;source1&quot; type=&quot;radio&quot; name=&quot;set&quot; value=&quot;all&quot; class='ctrl'&gt;&lt;/input&gt;
&lt;label for=&quot;source1&quot;&gt;All available patches&lt;/label&gt;
&lt;/li&gt;
&lt;li&gt;&lt;input id=&quot;source2&quot; type=&quot;radio&quot; name=&quot;set&quot; checked=&quot;checked&quot; value=&quot;short&quot;&gt;&lt;/input&gt; &lt;!-- Default state is &quot;checked&quot;--&gt;
&lt;label for=&quot;source2&quot;&gt;Gray ramp and Primaries&lt;/label&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt; &lt;!-- close selection --&gt;

&lt;div id=&quot;first&quot;&gt;&lt;a href=&quot;#&quot;&gt;[2]&lt;span&gt;
Choose and click which set of patches you wish to run.&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id=&quot;second&quot;&gt;&lt;a href=&quot;#&quot;&gt;[1]&lt;span&gt;
Always click &quot;Reset&quot; first. Then click the desired tab above to select patches with a specific
embedded color profile.&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;

&lt;h2&gt;RGB patches&lt;/h2&gt;
&lt;div id=&quot;patch-area&quot;&gt;
   &lt;div id=&quot;white&quot;&gt;&lt;img src=&quot;images/white.jpg&quot; alt=&quot;white&quot; /&gt; &lt;!-- show the white patch for instrument calibration --&gt;&lt;/div&gt;

&lt;div class=&quot;mainimg&quot;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;div&gt;&lt;img alt=&quot;n-255&quot; src=&quot;images/untagged/n-255.jpg&quot; /&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;div id=&quot;photos&quot;&gt;&lt;!-- Customize the patches below. Keep the syntax. --&gt;
&lt;img src=&quot;images/untagged/n-255.jpg&quot; alt=&quot;n-255&quot; /&gt;
&lt;img src=&quot;images/untagged/n-223.jpg&quot; alt=&quot;n-223&quot; /&gt;
................... and so on for the all patches ..............
&lt;img src=&quot;images/untagged/b-0.jpg&quot; alt=&quot;b-0&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;!-- closing patch-area--&gt;
</pre>
<div class="space"></div>
<p>Again, all discussed files including html file and css styling sheet are included in the zipped file through the download.</p>
<div class="space"></div>
<div class="separator"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2011/12/23/cm-code/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Browsers &amp; Color Management I &#8211; Sending Color Patches through the Web Browser</title>
		<link>http://www.marcelpatek.com/blog/2011/11/27/cm-patches/</link>
		<comments>http://www.marcelpatek.com/blog/2011/11/27/cm-patches/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 01:18:28 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Color management]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=1163</guid>
		<description><![CDATA[While writing my previous posts on color management and web browsers [1, 2], I realized that instead of guessing as to whether a browser understands how to manage colors, a few measurements of color patches would go a long way. Questions, such as, what will happen with untagged images in Chrome 11 or is it [...]]]></description>
				<content:encoded><![CDATA[<p>While writing my previous posts on color management and web browsers [<a href="http://www.marcelpatek.com/blog/2011/11/02/setting-the-full-color-management-in-firefox/">1</a>, <a href="http://www.marcelpatek.com/blog/2011/11/19/enabling-color-management-in-google-chrome/">2</a>], I realized that instead of guessing as to whether a browser understands how to manage colors, a few measurements of color patches would go a long way. Questions, such as, what will happen with untagged images in Chrome 11 or is it safe to use sRGB profile for photos displayed on a wide-gamut monitor would then be easier to answer. By all means, these questions are not trivial and would deserve an in-depth study of the browser documentation and perhaps many hours spent on Google. Unfortunately, with many browsers one would still be unclear on the exact way by which are the (un)tagged images processed.</p>
<div class="space"></div>
<p>To address browser color capabilities in the most straightforward way, we would just send images of RGB primaries through the browser and record their colorimetric values. In order to do that, we would need a set of images that are either untagged (no color space information is associated with them) or images that carry color space information in the form of icc/icm profile. After the measurement is done, a quick comparison with known CIE 1931 chromaticity coordinates of RGB primaries of standard color spaces (sRGB, Adobe98 RGB, Pro Photo RGB) would reveal any color processing done by the browser. To measure the radiometric output, we can use the same device that we use to calibrate our display.</p>
<div class="space"></div>
<p>To make measurement of colors from within a browser easier, I provide jQuery script that displays different color patches and allows measurement in a semi-manual manner. The script runs in any browser that has JavaScript enabled. Included are gray and RGB ramps in four different variants; <span style="text-decoration: underline;">untagged</span> and <span style="text-decoration: underline;">tagged</span> with sRGB, Adobe98 RGB, and ProPhoto RGB icc profiles. After measuring these patches directly from the browser, we can both judge its color management capabilities and also obtain display characteristics, such as, display <em>gamma</em>, color temperature and <em>gamma</em> values for each RGB channel. On that later (link).</p>
<div class="space"></div>
<h1 style="padding-left: 60px;"><span style="font-size: medium;">The Upshot of the Script:</span></h1>
<ul>
<li>Inter-browser compatibility (IE, Chrome, Firefox, Safari, Opera, &#8230;)</li>
<li>No installation (all necessary files are included)</li>
<li>No need to be connected to the Internet</li>
<li>Simple navigation (NEXT, PREVIOUS, RESET)</li>
<li>Customizable (supply your own images)</li>
<li>Free</li>
</ul>
<div class="space"></div>
<p><span id="more-1163"></span></p>
<div class="space"></div>
<div class="separator"></div>
<h2><strong>How to prepare the script:<br />
</strong></h2>
<p style="padding-left: 60px;"><strong><span style="color: #ff0000;">To begin, first download the necessary files (the latest version):</span></strong></p>
<p style="padding-left: 30px;"><a href="http://www.marcelpatek.com/blog/wp-content/plugins/download-monitor/download.php?id=patches1_0_1.zip"> Patches1.0.1.zip v 1.01 </a>  <img style="margin: 0px 10px -5px 10px" src="http://www.marcelpatek.com/blog/wp-content/downloads/zip.gif" width="20" height="20" alt="Patches1.0.1.zip" />  |   Complete set of files. Fixed a minor error in the index increment and displaying full set of images.  &#8211;  [downloaded 119 times]</p>
<p style="padding-left: 30px;">
<div class="space"></div>
</p>
<ol>
<li>Unzip the zip file into a folder (it self-extracts into folder &#8220;patches&#8221;) and place the folder structure anywhere on your computer (e.g. in c:/ ).</li>
<li>Double-click on the index.html file in the main folder. Alternatively, drag the index.html file to the browser window.</li>
<li>Depending on the Security policy settings of your computer,  you will want to confirm (OK, Agree, &#8230;) the message saying something about the JavaScript, Active-X to be allowed.</li>
<li>The following page will appear in the browser window.</li>
</ol>
<p><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/12/main_structure.png" rel="shadowbox[sbpost-1163];player=img;"><img class="aligncenter size-full" title="Step 1" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/12/main_structure.png" alt="" width="672" height="642" /></a></p>
<div class="separator"></div>
<h2><strong>How to run the patch animation:</strong></h2>
<ol>
<li>To make sure that everything is in the initial state, press RESET.</li>
<li>If you wish to run Untagged series first, just check which set to run (All or Gray &amp; Primaries) <strong><span style="color: #ff0000;">[2]</span></strong> and proceed by clicking  NEXT.<strong><span style="color: #ff0000;"><br />
</span></strong></li>
<li>For other color spaces, choose the color profile (icc profile) associated with the image set by clicking the corresponding red tab at the top <strong><span style="color: #ff0000;">[1]</span></strong> (Untagged is the default).</li>
<li>Select the set of images to run (All or Gray &amp; Primaries) <strong><span style="color: #ff0000;">[2]</span></strong>. &#8220;Gray ramp and Primaries&#8221; has 12 images (default); 7 gray ramps, 3 RGB patches and the black and white patches. &#8220;All available patches&#8221; include the gray ramp from the above, 7 patches each of the red, green, and blue ramps and the black and white patches  (total of 36).</li>
<li>Read steps in the note<strong><span style="color: #ff0000;"> [3]</span></strong> to calibrate the measuring device and acquire reading of the white patch.</li>
<li>Use the NEXT, PREVIOUS buttons to advance or step back.  At the end of the cycle, script resets into the default state.</li>
</ol>
<div class="note">
<div class="notetip">If something goes wrong, press RESET.  </div>
</div>
<div class="space"></div>
<div class="separator"></div>
<h2><strong>How to measure patches:</strong></h2>
<p>Unfortunately, there are limited options when it comes to manual measurements off the screen that are not driven by a specific display calibration package. The good news is there are still a few free software applications. These include <a href="http://www.argyllcms.com/" target="_blank">Argyll CMS</a> and homecinema-fr colormeter at <a href="http://www.homecinema-fr.com/colorimetre-hcfr/hcfr-colormeter/" target="_blank">HCFR</a>. On the commercial side, I prefer using the <a href="http://www.babelcolor.com/#CTandA" target="_blank">BabelColor CT&amp;A</a>.</p>
<p>I described setup and use of all of the mentioned applications on my <a href="http://www.marcelpatek.com/" target="_blank">Techpages</a>, specifically at: <a href="http://www.marcelpatek.com/argyll.php" target="_blank">Argyll CMS &#8211; examples of use</a>,  <a href="http://www.homecinema-fr.com/colorimetre-hcfr/hcfr-colormeter/" target="_blank">HCFR Colorimetere</a>, and <a href="http://www.marcelpatek.com/cta.php#wp" target="_blank">BabelColor CT&amp;A</a>.</p>
<div class="space"></div>
<p>I will go into measurements and results in more details later. At this point, I will continue with <a href="http://www.marcelpatek.com/blog/2011/12/23/cm-code">discussion of the code used in this project</a>.</p>
<div class="space"></div>
<div class="separator"></div>
<div class="space"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2011/11/27/cm-patches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling color management in Google Chrome</title>
		<link>http://www.marcelpatek.com/blog/2011/11/19/enabling-color-management-in-google-chrome/</link>
		<comments>http://www.marcelpatek.com/blog/2011/11/19/enabling-color-management-in-google-chrome/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 23:04:31 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[color profile]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=1093</guid>
		<description><![CDATA[In my previous post, I provided a step-by-step guide to enable full color management in the Mozilla Firefox browser. While Firefox handles colors in a very respectful way, there are other browsers that cannot be setup (yet) to effectively manage colors (IE, Opera). For some time, Google Chrome was not capable of managing colors also [...]]]></description>
				<content:encoded><![CDATA[<p>In <a href="http://www.marcelpatek.com/blog/2011/11/02/setting-the-full-color-management-in-firefox/#more-885">my previous post</a>, I provided a step-by-step guide to enable full color management in the Mozilla Firefox browser. While Firefox handles colors in a very respectful way, there are other browsers that cannot be setup (yet) to effectively manage colors (IE, Opera). For some time, Google Chrome was not capable of managing colors also or its setup was just undocumented. However, while there are several pages on the Internet describing how to enable color management in Chrome, results are often unreliable (read more below).</p>
<div class="note">
<div class="noteclassic">In general, the first part of troubleshooting annoying color shifts is checking that our monitor is <a href="http://www.marcelpatek.com/monitor.html">calibrated and profiled</a>.</div>
</div>
<p>This post will show modification in a simple start-up option that enables management of colors in the Chrome browser (I am intentionally avoiding the term &#8220;color management&#8221; for the reasons explained below).</p>
<p><span id="more-1093"></span></p>
<p>When enabled, then regardless if the image is or it is not tagged with icc profile, its color interpretation will default to the computer system color space (sRGB under Windows OS) and resulting RGB values are then sent straight to the monitor. If monitor icc profile is assigned in the &#8220;Default monitor profile&#8221; section, colors will be ultimately converted to sRGB color space.</p>
<p>In short, for calibrated and profiled or any decent monitor, results for tagged and untagged images will be just fine. However, troubles may arise when using a wide-gamut monitor.</p>
<p>The setup described below will ensure that most images from the Web will be faithfully displayed on your monitor, especially on wide-gamut monitors. It is also important to note that Chrome is not color managing images in the strict sense. Instead, if enabled, it treats all images as if they were in sRGB color space. The net result is that regardless of the monitor gamut, images are displayed in the web-safe sRGB color space.</p>
<div class="note">
<div class="notewarning">Note: Unfortunately, &#8220;color management&#8221; switch does not work on Windows 7 systems (32 bit, 64 bit). Still confirmed in Chrome 18.</div>
</div>
<p style="padding-left: 30px;"><span style="font-size: medium;"><strong>Here is how to proceed (in Google Chrome browser and Win XP):</strong></span></p>
<ol>
<li>
<pre>Right-mouse click the Chrome icon and select Properties.</pre>
</li>
<li>
<pre>Add --enable-monitor-profile at the end of the path in the Target field. Use double quotes as seen in the screenshot. <a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/chrome_CM.png" rel="shadowbox[sbpost-1093];player=img;"><img class="aligncenter size-full" title="Step 1" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/chrome_CM.png" alt="" width="367" height="509" /></a></pre>
</li>
<li>
<pre>Click the OK button and restart Chrome.</pre>
</li>
</ol>
<pre></pre>
<p>That&#8217;s it. Chrome should now display images in the &#8220;web save&#8221; mode.</p>
<div class="note">
<div class="notetip">For users of multiple monitors or monitors with different gamut, read more !!</div>
</div>
<p>Unfortunately, until recently, I was not able to get the Chrome manage colors (over-saturation mostly) on my tagged images. First, I must say that I am running two monitors off the XP-SP3 computer. Moreover (complicating aspect), one of my monitors is a wide-gamut display. Both displays are calibrated and profiled and behave very good when editing photos in Photoshop on either one of them. Looking deeper into color problem in Chrome, I noticed that there is no monitor profile explicitly entered when enabling the color management (in contrast to Firefox). That leads to a question what profile is used by Chrome? It turns out that there is no profile used, but instead RGB values embedded in the image are assigned the monitor color space and then are converted to sRGB color space. However, for this transformation to happen, one has to set the default monitor profile by clicking &#8220;Set As Default&#8221; as shown in the picture below. This is not immediately intuitive, but it is important when viewing images on the wide-gamut monitor. On a standard monitor, differences are negligible.</p>
<p><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/xp_dproperties.png" rel="shadowbox[sbpost-1093];player=img;"><img class="alignleft size-full" title="Step 2" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/xp_dproperties.png" alt="" width="404" height="455" /></a><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/xp_cm.png" rel="shadowbox[sbpost-1093];player=img;"><img class="alignright size-full" title="Step 3" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/xp_cm.png" alt="" width="404" height="492" /></a></p>
<div class="space"></div>
<p>In situation where two monitors of different gamuts are run, I suggest to set the Default profile (above) to the wide-gamut display.</p>
<div class="note">
<div class="notewarning">Assigning sRGB as the Default monitor space under Windows (XP-SP3) causes the wide-gamut monitor to display any image (tagged or untagged) as sRGB converted image (good and safe). However, on a regular monitor, colors get desaturated in reds and greens. Assigning icc/icm monitor profile as the Default space results in conversion into (or assignment of) sRGB space on the very monitor which profile was assigned as Default. On other monitor(s), native RGB primaries are used to display the image.</div>
</div>
<p>In summary, for users of two or more monitors from which at least one is wide-gamut display, set the &#8220;Default monitor profile&#8221; in Windows to the wide-gamut monitor profile and have the Chrome to display images on that same wide-gamut monitor.</p>
<div class="separator"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2011/11/19/enabling-color-management-in-google-chrome/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Full color management in Firefox &#8211; settings</title>
		<link>http://www.marcelpatek.com/blog/2011/11/02/setting-the-full-color-management-in-firefox/</link>
		<comments>http://www.marcelpatek.com/blog/2011/11/02/setting-the-full-color-management-in-firefox/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 21:44:56 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=885</guid>
		<description><![CDATA[Every day, hundreds of thousands of photos are uploaded to the web. There are many web surfers, photography amateurs, pros and photo agencies browsing for the best pictures. Nothings gets more frustrating then seeing an image that took several hours of editing and rigorous color management discipline, only to realize that colors got shifted and [...]]]></description>
				<content:encoded><![CDATA[<p>Every day, hundreds of thousands of photos are uploaded to the web. There are many web surfers, photography amateurs, pros and photo agencies browsing for the best pictures. Nothings gets more frustrating then seeing an image that took several hours of editing and rigorous color management discipline, only to realize that colors got shifted and that the whole visual experience is compromised. Main culprit is often wrong setup of the web browser or use of browser that cannot be setup to effectively manage colors (IE, Opera). </p>
<div class="note">
<div class="noteclassic">In general, the first part of troubleshooting color shifts is checking that our monitor is <a href="http://www.marcelpatek.com/monitor.html">calibrated and profiled</a>.</div>
</div>
<p>This post will guide you through the powerful options in Firefox that enable color management of images that are tagged with icc profile. If the image is not tagged with icc profile, its color interpretation will default to the computer system color space, which in most cases is close to sRGB<img class="centerinfo tool_tip" src="http://www.marcelpatek.com/blog/wp-content/themes/Carta/images/question_mark_icon.gif" alt="info" width="14" height="14" tooltip="Typical color space for web images."/> and and then converted to the monitor RGB. If the image is tagged with icc profile and if there is no monitor profile available, monitor RGB values are assumed and the monitor default profile is used for conversion. For calibrated and profiled or any decent monitor, results for tagged and untagged (but edited on standard sRGB gamut monitor) images will be just fine. However, troubles will most probably arise on a wide-gamut monitor.</p>
<p><span id="more-885"></span></p>
<p>Setup described below will ensure that most images from the Web will be faithfully displayed on your monitor, especially on wide-gamut monitors.</p>
<p style="padding-left: 30px;"><span style="font-size: medium;"><strong>Here is how to proceed (in Mozilla Firefox browser):</strong></span></p>
<ol>
<li>
<pre>Type "<span style="color: #000000;"><span style="background-color: #ffffff;">about:config</span></span>" in the browser address bar (no quotes).  <a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_1.png" rel="shadowbox[sbpost-885];player=img;"><img class="aligncenter size-full wp-image-886" title="Step 1" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_1.png" alt="" width="200" height="34" /></a></pre>
</li>
<li>
<pre>Click the "<span style="color: #000000;"><span style="background-color: #ffffff;">OK, I'll be careful</span></span>" button in the warning message that appears.<a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_2.png" rel="shadowbox[sbpost-885];player=img;"><img class="aligncenter size-full wp-image-887" title="Step 2" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_2.png" alt="" width="637" height="195" /></a></pre>
</li>
<li>
<pre>Type "<span style="background-color: #ffffff;">gfx</span>" to the Filter field.</pre>
</li>
<li>
<pre><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_3.png" rel="shadowbox[sbpost-885];player=img;"><img class="aligncenter size-full wp-image-888" title="Step 3" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_3.png" alt="" width="197" height="108" /></a>Double-click the "<span style="color: #000000;"><span style="background-color: #ffffff;">gfx.color_management.display_profile</span></span>" line and enter path to your monitor profile.</pre>
</li>
</ol>
<div class="note">
<div class="notetip">If you do not know or do not have your monitor profile, just leave the default value. System will assume monitor RGB color space.</div>
</div>
<ol>
<li>
<pre>Double-click the "gfx.color_management.mode" line and enter "1" (means Full Color Management) in the box that opens up (click the image below to zoom in).<span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif; font-size: medium;"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_41.png" rel="shadowbox[sbpost-885];player=img;"><img class="aligncenter size-full wp-image-927" title="Step 4" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_41.png" alt="" width="600" height="106" /></a></span></pre>
</li>
<li>
<pre>Quit and restart Firefox.</pre>
</li>
</ol>
<pre> </pre>
<p>That&#8217;s it. Firefox should now display all images with full color management in action.</p>
<p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif; font-size: medium;"><br /> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2011/11/02/setting-the-full-color-management-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detect iPad and iPhone in web browsers</title>
		<link>http://www.marcelpatek.com/blog/2011/10/09/code-to-recognize-ipad/</link>
		<comments>http://www.marcelpatek.com/blog/2011/10/09/code-to-recognize-ipad/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 18:32:45 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=673</guid>
		<description><![CDATA[In this short post, I will share a web page redirection code for users of iPad, iPhone or ipod who have no access to Adobe Flash media. In the first week of November 2011, Adobe announced that it will cease developing its Flash Player plug-in for mobile browsers. The next most affected devices(besides the iPad, [...]]]></description>
				<content:encoded><![CDATA[<p>In this short post, I will share a web page redirection code for users of iPad, iPhone or ipod who have no access to Adobe Flash media.</p>
<div class="note">
<div class="noteclassic">In the first week of November 2011, Adobe announced that it will cease developing its Flash Player plug-in for mobile browsers. The next most affected devices(besides the iPad, iPod, iPhone) are those based on Android OS.</div>
</div>
<p>Below is simple javascript that needs to be inserted into the top section of your web page (between the and tags) to re-direct those users to an alternative page.</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;!--ipad redirect--&gt;
&lt;script language=javascript&gt;
if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1)
|| (navigator.userAgent.indexOf('iPad') != -1)) {
document.location = &quot;http://www.yourdomain.com/directory/index1.html&quot;;
}
&lt;/script&gt;
</pre>
<p>In this example, /directory/ is optional (in case that your site or iPad friedly version of your site resides in another directory) and index1.html is an alternative index.html that does not contain any Flash code. Index1.html is essentially a copy of the index.html where the Flash part is replaced with JQuery or html5 code to display the original slides or movie. It is where the visitor will be re-directed to.</p>
<p><span id="more-673"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2011/10/09/code-to-recognize-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making of this site</title>
		<link>http://www.marcelpatek.com/blog/2011/09/11/post-2/</link>
		<comments>http://www.marcelpatek.com/blog/2011/09/11/post-2/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 21:01:03 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=8</guid>
		<description><![CDATA[Sometime in June 2011, I finally realized that I need to make a new home for all my photos, margin notes, web links, and code that I have created over the years.  Repeatedly, I found myself jotting down notes for image sizes, Lightroom settings, Photoshop configuration, camera settings, flash presets, &#8230; Overall, too many things [...]]]></description>
				<content:encoded><![CDATA[<p>Sometime in June 2011, I finally realized that I need to make a new home for all my photos, margin notes, web links, and code that I have created over the years.  Repeatedly, I found myself jotting down notes for image sizes, Lightroom settings, Photoshop configuration, camera settings, flash presets, &#8230; Overall, too many things to remember. I also became unhappy with color management settings in the Adobe Flash, which rarely worked for me and which rendered my images too saturated on wide gamut monitors.</p>
<p>In the late July, a plan was born &#8211; build a site for the photos and other content that would keep them in one place with confidence in the original color quality.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2011/09/11/post-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
