<?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>Peter Mac And Associates&#187; Uncategorized</title>
	<atom:link href="http://www.petermac.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.petermac.com</link>
	<description>Australian freelance programmer and website design</description>
	<lastBuildDate>Tue, 24 Aug 2010 07:28:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Scaling images in batch mode</title>
		<link>http://www.petermac.com/scaling-images-in-batch-mode/</link>
		<comments>http://www.petermac.com/scaling-images-in-batch-mode/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 07:23:15 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=502</guid>
		<description><![CDATA[I have lots of folders with images uploaded from digital cameras. Average image size is 3MB which is way too large for uploading to web based image sites. What I need to do is to rescale the images but doing them one at a time is a pain so I wrote a little script to [...]]]></description>
			<content:encoded><![CDATA[<p>I have lots of folders with images uploaded from digital cameras. Average image size is 3MB which is way too large for uploading to web based image sites. What I need to do is to rescale the images but doing them one at a time is a pain so I wrote a little script to do them one folder at a time.</p>
<p>The script makes use of a program called &#8216;convert&#8217;. This is part of the ImageMagick suite of tools.</p>
<p>Install ImageMagick</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> imagemagick</div></div>
<p>Once installed try to verify the location of the convert program</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">which</span> convert<br />
convert is <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>convert</div></div>
<p>The way the script works is to create a new folder called &#8216;resized&#8217; under the folder you want to process. It then places rescaled versions of the images it finds in the source folder.</p>
<p>The scaling is performed by passing a width x height parameter to the convert program. The question is how do you know what value to provide without screwing up the ratio of your image. What I do is open a sample image in Gimp. Go to the &#8216;Image|Scale&#8217; menu option. I pick a value for the width, hit tab and it provides you with the correct value for the height. This is fine if all your images are of the same size. You&#8217;ll have to put in a bit of work if they are different sizes.</p>
<p>Here&#8217;s the script..it&#8217;s really simple as you can see, but I had an itch and I had to scratch it.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/bash</span><br />
<br />
<span style="color: #007800;">convert_command</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>convert<br />
<span style="color: #666666; font-style: italic;">#get the folder name to be procesed</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">2</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
<span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Error in $0 - Invalid number of arguments.&quot;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Syntax: $0 &lt;folder name&gt; &lt;new size&gt;&quot;</span> <br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Example $0 ./images 1024x680&quot;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #007800;">folder</span>=<span style="color: #007800;">$1</span><br />
<span style="color: #007800;">newsize</span>=<span style="color: #007800;">$2</span><br />
<span style="color: #007800;">resized</span>=<span style="color: #ff0000;">&quot;resized&quot;</span><br />
<span style="color: #007800;">resized_dir</span>=<span style="color: #ff0000;">&quot;$1/<span style="color: #007800;">$resized</span>&quot;</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Resized images will be placed into the folder <span style="color: #007800;">$resized</span>&quot;</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$resized_dir</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
<span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$resized_dir</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$folder</span><br />
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> . <span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$file</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Processing <span style="color: #007800;">$file</span>...&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;convert <span style="color: #660033;">-resize</span> <span style="color: #007800;">$newsize</span> <span style="color: #007800;">$file</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$resized</span>/<span style="color: #007800;">$file</span>&quot;</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #000000; font-weight: bold;">done</span></div></div>
<p>Save the script as image_resize.sh. Do a chmod a+x so you can execute it. Then create a sample folder with a few images copied just for testing. Run it as follows:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<span style="color: #000000; font-weight: bold;">/</span>image_resize.sh path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>images 1024x680</div></div>
<p>That&#8217;s all folks!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/scaling-images-in-batch-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Public Key</title>
		<link>http://www.petermac.com/public-key/</link>
		<comments>http://www.petermac.com/public-key/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 02:23:59 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petermac.com/2008/10/15/public-key/</guid>
		<description><![CDATA[&#8212;&#8211;BEGIN PGP PUBLIC KEY BLOCK&#8212;&#8211; Version: GnuPG v1.4.9 (MingW32) mQGiBEj1SQoRBACbRUMtyYFvFa81V7cnzbYJzSfk5MDuUdV0Wo+ckxKKRfW4Qf30 +ORIJeqzirJp9tOd8/uoPVnxNOK4LBKw47W+lHHLUYNMy2qByy7zVBXfg9EXuIrU edebiwM92yODj/VoAxTjI1p5Mmr5fhFSSEo8yh7GTqg8g0j4jWPR+eZxywCgi78d CZ6WmIS+tpNvEqrV/DwQUd0D/R9tyFMuwVKKOcyPxpekJ5RmKk8DDJ7cx6z0s6wM kpx5qpL2QKhVp/3s7t9M40FT3ZmT2ERjJwZzncM8JMxDOK/vS8CRGlTd/JJIzWNj 8SOo55HCq1gJP8U01P1wU1AK9/7n+RcENOGvHEPvKfWweY8HuE8OwHkPGxkqT4og 1TNgA/97226C/NTf7MmOmV5y3yo5k5VUzGRjPpyvZIxIxnQJR4viquNEJfnW9BQT kRw4J7qQePvcbYrvDWxHlJJzlIzQxbBUqVry4K79ByudQA8QaQAT+XJIMjjppgHz rKWB6YVTqsSlfjASM9RqjfDCMZpefpjlq2hvJ2WzyLnYGyEJ+rRuUGV0ZXIgTWFj IEdpb2xsYWZoZWFyZ2EgKEtleSBmb3IgbWFpbCBmcm9tIHBldGVyQHBldGVybWFj LmNvbSAtIFBldGVyIE1hYyBBbmQgQXNzb2NpYXRlcykgPHBldGVyQHBldGVybWFj LmNvbT6IZgQTEQIAJgUCSPVJCgIbIwUJCWYBgAYLCQgHAwIEFQIIAwQWAgMBAh4B AheAAAoJEJlpD3yHCMV4/qYAn0WbPZejFQGgFi3g5IT2Q0D8u++xAJsGmFMdEwPm zFi4mAEAbhfO+tuUr7kCDQRI9UkKEAgAhf491b6MaNOCp1qo9hjvX1NLQ1sORkI9 suP7PceRZfXuqc92GMXw8lYds9cPddtOBPpBZCaezxvRZHfERwiSWEVjEdwXyC5z y8ys8L4jxaPS8YS3SnEjkg+1DCLRb5fry+jiSaFeC2YklFFopSxWiSJQow9+jIPF hfvE4ZswP3EBx54SYC92sZgqfq/DcDcqlOp7gGAxHhxP+rdt4ow4aEzhdzyzNVpb C26BwRWH6T1JtsBSiy0PoaxV2eVl3Fb93aHPVldtdk5p6Pqm03KAbowurFfLshK9 jyPuOyaM8cUSN+RXSgi846mXT0EhY6J4Ofb0rClm8maXwtSHpk8wBwADBQf/b4i6 oDa5K69S2tyERpxAPhSBPdUnYT0oxlZvj75Wp1SfBkmUy8O+1jONIE1+OhLslxke WdFMmDrH8AiRU0q19bGEsKDqUWt58UV7GL26+QZbQWjhz7fWzI6ljftgshmXQozI 3725Y2AVQR3U4BaFNiFrJQECPYLB/yypf8OCsZjspERb+d4J7CXfk5mVkFFAOj7N 5UQv0u+dMVJAP3OCVdEibjXc/c4qPPxLUioAqN8MbixM1OzZDOH55K/oJdRoGyIG mfWU1lToNDCSi7BSqXjPGC+DMDjFc4QfnBFJfV0301GvLshuw+b/r8qJNfxkYkk4 zK/sgbPlXPL032aM4ohPBBgRAgAPBQJI9UkKAhsMBQkJZgGAAAoJEJlpD3yHCMV4 JQMAnA21n/10YG9hXHrUEel1HTFcU+opAJ9KlShcMzJoLI5VVIqfJTa8y/GE+Q== =L39p &#8212;&#8211;END PGP PUBLIC KEY BLOCK&#8212;&#8211; Click here to download this as key as a file]]></description>
			<content:encoded><![CDATA[<p>&#8212;&#8211;BEGIN PGP PUBLIC KEY BLOCK&#8212;&#8211;<br />
Version: GnuPG v1.4.9 (MingW32)</p>
<p>mQGiBEj1SQoRBACbRUMtyY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vE4ZswP3EBx54SYC92sZgqfq/DcDcqlOp7gGAxHhxP+rdt4ow4aEzhdzyzNVpb<br />
C26BwRWH6T1JtsBSiy0PoaxV2eVl3Fb93aHPVldtdk5p6Pqm03KAbowurFfLshK9<br />
jyPuOyaM8cUSN+RXSgi846mXT0EhY6J4Ofb0rClm8maXwtSHpk8wBwADBQf/b4i6<br />
oDa5K69S2tyERpxAPhSBPdUnYT0oxlZvj75Wp1SfBkmUy8O+1jONIE1+OhLslxke<br />
WdFMmDrH8AiRU0q19bGEsKDqUWt58UV7GL26+QZbQWjhz7fWzI6ljftgshmXQozI<br />
3725Y2AVQR3U4BaFNiFrJQECPYLB/yypf8OCsZjspERb+d4J7CXfk5mVkFFAOj7N<br />
5UQv0u+dMVJAP3OCVdEibjXc/c4qPPxLUioAqN8MbixM1OzZDOH55K/oJdRoGyIG<br />
mfWU1lToNDCSi7BSqXjPGC+DMDjFc4QfnBFJfV0301GvLshuw+b/r8qJNfxkYkk4<br />
zK/sgbPlXPL032aM4ohPBBgRAgAPBQJI9UkKAhsMBQkJZgGAAAoJEJlpD3yHCMV4<br />
JQMAnA21n/10YG9hXHrUEel1HTFcU+opAJ9KlShcMzJoLI5VVIqfJTa8y/GE+Q==<br />
=L39p<br />
&#8212;&#8211;END PGP PUBLIC KEY BLOCK&#8212;&#8211;</p>
<p><a href="http://www.petermac.com/wp-content/uploads/2008/11/petermac.com.pub.asc">Click here to download this as key as a file</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/public-key/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Purrfect Java Solutions</title>
		<link>http://www.petermac.com/purrfect-java-solutions/</link>
		<comments>http://www.petermac.com/purrfect-java-solutions/#comments</comments>
		<pubDate>Sun, 05 Aug 2007 04:17:32 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=24</guid>
		<description><![CDATA[Meet &#8220;Java&#8221;, a new addition to the PeterMac team. Although only 9 weeks old, she shows great focus in object oriented design (she chases any object that moves). She&#8217;s got an excellent grasp of string manipulation technniques and we have to agree that her display of experience in the J2SE (Sleeping and Eating) area is beyond [...]]]></description>
			<content:encoded><![CDATA[<p>Meet &#8220;Java&#8221;, a new addition to the PeterMac team.</p>
<p><img height="132" alt="java at 9 weeks" src="http://www.petermac.com/wp-content/uploads/2007/08/java_20070805_sm.png" width="214" /></p>
<p>Although only 9 weeks old, she shows great focus in object oriented design (she chases any object that moves). She&#8217;s got an excellent grasp of string manipulation technniques and we have to agree that her display of experience in the J2SE (Sleeping and Eating) area is beyond expectations for one so young.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/purrfect-java-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minister for misCommunication</title>
		<link>http://www.petermac.com/minister-for-miscommunication/</link>
		<comments>http://www.petermac.com/minister-for-miscommunication/#comments</comments>
		<pubDate>Tue, 22 Aug 2006 22:21:27 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=9</guid>
		<description><![CDATA[A recent brain-fart by the Australian Minister for Communications, Helen Coonan, has exemplefied why Australia remains a relative technology backwater. She said that she expects people ought to be happy with existing Internet speeds. &#8220;Well they ought to be in Sydney, Melbourne, Adelaide, Brisbane, certainly and Perth,&#8221; she said. &#8220;They should be reasonably happy with [...]]]></description>
			<content:encoded><![CDATA[<p class="western" style="margin-bottom: 0cm">A recent brain-fart by the Australian Minister for Communications, Helen Coonan, has exemplefied why Australia remains a relative technology backwater.  She said that she expects people ought to be happy with existing  Internet speeds.</p>
<p class="western">&#8220;Well they ought to be in Sydney, Melbourne, Adelaide, Brisbane, certainly and Perth,&#8221; she said.</p>
<p class="western">&#8220;They should be reasonably happy with their speed of broadband, if they have ADSL 2 Plus.</p>
<p class="western">&#8220;There are nine providers that already provide these speeds.&#8221;</p>
<p class="western">This outburst happened as a result of an announcement by Telstra (the 51% government owned body responsible for maintaining the telecomms infrastructure) that it was pulling out of a <a href="http://whirlpool.net.au/article.cfm/1656">proposed fibre optic upgrade to existing networks.</a></p>
<p class="western" style="margin-bottom: 0cm">Indeed there is access to ADSL 2+ in these cities but no thanks to Government support. The roll-out has been excruciatingly slow and is only available in higher population density areas. It (the ADSL2 network)has been taken on by a consortium of private companies with the previous threat of the Telstra upgrade having the potential to render their effort futile.</p>
<p class="western" style="margin-bottom: 0cm">For a Minister of Communications to make such a generalised and uninformed comment smacks of a level of ignorance that can only come from some-one whos&#8217; tenure in the role is transient. Be warned, your communications minister does not have the best interests of Australian Internet users at heart.</p>
<p class="western" style="margin-bottom: 0cm"><a href="http://www.oecd.org/document/39/0,2340,en_2825_495656_36459431_1_1_1_1,00.html">Statistics from the OECD</a> show Australia in 18<sup>th</sup> place in terms of broadband take-up. Although this is not a reflection of Internet speeds, it is a reflection on the perceived cost/benefit available to Australian consumers. Get your act together Minister!</p>
<p class="western" style="margin-bottom: 0cm">For more information check out <a href="http://www.abc.net.au/news/newsitems/200608/s1710074.htm">this article</a> by the Australian Broadcasting Corporation</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/minister-for-miscommunication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
