<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>imagemagick &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/imagemagick/</link>
	<description>Feed of posts on WordPress.com tagged "imagemagick"</description>
	<pubDate>Sat, 06 Sep 2008 23:59:47 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Скрипт для подготовки фотографий для публикации в походных условиях.]]></title>
<link>http://znoxx.wordpress.com/?p=248</link>
<pubDate>Wed, 03 Sep 2008 18:28:37 +0000</pubDate>
<dc:creator>znoxx</dc:creator>
<guid>http://znoxx.wordpress.com/?p=248</guid>
<description><![CDATA[Во время CC08 меня здорово выручал коротенький скрипт дл]]></description>
<content:encoded><![CDATA[<p>Во время CC08 меня здорово выручал коротенький скрипт для масштабирования фотографий для публикации в инете. Для работы требуется пакет ImageMagick (доступен в стандартном репозитарии)</p>
<p>Краткое описание:</p>
<p>Перенесите фотографии (*.jpg) компьютер в отдельную директорию. Перейдите в нее, запустите скрипт. Будет создана поддиректория publishing_ready, в которую будут помещены конвертированные файлы.<br />
<code><br />
#!/bin/bash<br />
mkdir publishing_ready<br />
for filename in *.jpg ; do convert $filename -resize 50% ./publishing_ready/$filename ; done<br />
</code><br />
Вообще, ImageMagick называют консольным "фотошопом". Помимо resize можно накладывать watermarks, подтягивать цвета, конвертировать из одного формата в другой и так далее.<br />
Ссылка на <a href="http://www.imagemagick.org">сайт imagemagick</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA["On the Fly Text" using imagemagick]]></title>
<link>http://azysworld.wordpress.com/?p=5</link>
<pubDate>Sun, 24 Aug 2008 17:30:08 +0000</pubDate>
<dc:creator>azy777</dc:creator>
<guid>http://azysworld.wordpress.com/?p=5</guid>
<description><![CDATA[For those of you who donno about imagemagick, It is an online image editing tool ( For resizing, cro]]></description>
<content:encoded><![CDATA[<p>For those of you who donno about imagemagick, It is an online image editing tool ( For resizing, cropping etc ). you can more info <a href="http://www.imagemagick.org/script/index.php">here</a>.</p>
<p>In my last project, I had to use php and imagemagick for creating "On the fly" Images ( Text from db to be converted to pngs using a stored font in the server).  I had no idea how. You get all the info about the commands used in imagemagick <a href="http://www.imagemagick.org/Usage/text/">here </a> , but not exactly how to go about.</p>
<p>So, for three grueling days of R&#38;D, i was finally able to figure it out.</p>
<p class="MsoNormal">
<p class="MsoNormal">Example :</p>
<p class="MsoNormal">“convert -background blue -fill white -font AfterTe3.pfb -size 150x<span> </span>label:'Test' Test.gif”</p>
<p class="MsoNormal">This will create an image test.gif. To display the image “on the fly”, you will have to use the following technique.</p>
<p class="MsoNormal">Create a file called onthefly.php.</p>
<p class="MsoNormal">This is where you write the function to display the images “on the fly”. Put in the following code:</p>
<p class="MsoNormal">
<p class="MsoNormal">function mysystem($command, $hide=true) {</p>
<p class="MsoNormal"><span> </span><span> </span>if (!($p=popen("($command)2&#62;&#38;1","r"))) return 126;</p>
<p class="MsoNormal"><span> </span><span> </span>while (!feof($p)) {</p>
<p class="MsoNormal"><span> </span><span> </span>$l=fgets($p,1000);</p>
<p class="MsoNormal"><span> </span><span> </span>if ($hide) print $l;</p>
<p class="MsoNormal"><span> </span><span> </span>} return pclose($p);</p>
<p class="MsoNormal"><span> </span>}</p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal">function ImageOnTheFly($text,$bgcolor,$fillcolor,$font,</p>
<p class="MsoNormal">$pointsize,$size,$filename=null){</p>
<p class="MsoNormal">
<p class="MsoNormal">$text = html_entity_decode(stripslashes($text));</p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal">$command = "convert -background 'rgb($bgcolor)'</p>
<p class="MsoNormal">-fill 'rgb($fillcolor)' -font ".$font."</p>
<p class="MsoNormal">-pointsize ".$pointsize." -size ".$size."<span> </span>label:'".$text."' png:-";</p>
<p class="MsoNormal">
<p class="MsoNormal">header("Content-type: image/png");</p>
<p class="MsoNormal">mysystem($command);</p>
<p class="MsoNormal">
<p class="MsoNormal">}</p>
<p class="MsoNormal">
<p class="MsoNormal">ImageOnTheFly($_GET['text'],$_GET['bgcolor'],</p>
<p class="MsoNormal">$_GET['fillcolor'],$_GET['font'],$_GET['pointsize'],$_GET['size']);</p>
<p class="MsoNormal">
<p class="MsoNormal">Now, you will pass all information ( text, color etc ) to this function.</p>
<p class="MsoNormal">
<p class="MsoNormal">Next open your main file ( where yuou want the image to appear ) and call onthefly.php in img src tag. For example</p>
<p class="MsoNormal">
<p class="MsoNormal">&#60;img src=" onthefly.php?text=Test&#38;'bgcolor'=255,255,255&#38;</p>
<p class="MsoNormal">'fillcolor'=255,0,255&#38;font=Arial.ttf&#38;pointsize=25&#38;size=200x" /&#62;</p>
<p class="MsoNormal">Make sure you give the absolute path to the font file ( in ImageOnTheFly function )</p>
<p class="MsoNormal">Run the page and Viola!!!... you’ve<span> </span>got your image “On the fly”!!!.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Making Timelapse Videos]]></title>
<link>http://schnoov.wordpress.com/?p=150</link>
<pubDate>Sun, 03 Aug 2008 21:20:16 +0000</pubDate>
<dc:creator>Justin</dc:creator>
<guid>http://schnoov.wordpress.com/?p=150</guid>
<description><![CDATA[I thought it might be helpful to document how exactly I made the timelapse of the Going to the Sun R]]></description>
<content:encoded><![CDATA[<p>I thought it might be helpful to document how exactly I made the timelapse of the Going to the Sun Road, so here goes.  I made it on my laptop, which runs Ubuntu Hardy Heron but any Linux distro will do.  I needed the <strong>gprename</strong>, <strong>imagemagick</strong>, and <strong>ffmpeg</strong> packages installed.  I'm going to assume you know how to take a series of images with your camera, and not cover that at all.</p>
<p><!--more--></p>
<p>So I have a series of 795 images that I want to make into a timelapse, and they're in sequential order with filenames like <em>IMG_2294.JPG</em>.  That's a problem for ffmpeg, because it expects the count to start at 1.  So we're going to want to rename all the images.  I used gprename, which is a Gnome program for renaming sets of files.  Now my images start out at img_001.jpg, which is what I want.</p>
<p>Next, the files from my camera were too big (speaking of resolution here, not file size) - you're not going to be posting a 2496x1664 video on YouTube.  Since it looks awful if you let ffmpeg squish the images down, we'll first resize them all to a more sane resolution, say 640x480.  Imagemagick comes in handy here - we'll use a little Bash scripting magic to do it all at once.</p>
<p>I made two directories, one for the original images (timelapse1) and one for the resized ones (timelapse2).  Then, I ran this and let the computer work for a few minutes.  Note that I executed the command from within the timelapse1 directory, otherwise the paths will need to be adjusted.</p>
<p><strong>$ for i in *.jpg; do convert -filter sinc -resize 640x480 $i ../timelapse2/$i; done</strong></p>
<p>Now we've got a series of appropriately sized images ready to make into a video.  Time for ffmpeg to do it's magic.  Since I was planning to upload to YouTube/Google Video, I chose Flash Video for the final format since it produces relatively small files (good for uploading).</p>
<p><strong>$ ffmpeg -s 640x480 -r 3 -i img_%03d.jpg -b 1000k timelapse.flv</strong></p>
<p>The key things to understand are the -r and the -b flags.  The position of the framerate (-r flag) in the command is important, if you put the command <em>after </em>the input file(s) it will apply to the output video and not do what you want.  I took my images at 5 second intervals (.2 fps), and sped it up to 3fps so the video didn't take forever.  Experiment with some low values to see how it turns out.  The bitrate (-b) flag controls the quality of the movie produced, you can experiment with that as well, but in the end you want low values (say 1-5) for Q (quality) when it's encoding the movie, or you'll get motion artifacts that look ugly.</p>
<p>That's it!  Enjoy your timelapse video.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Using ImageMagick to convert a series of images to animated GIF]]></title>
<link>http://atchieu.wordpress.com/?p=68</link>
<pubDate>Thu, 24 Jul 2008 17:58:08 +0000</pubDate>
<dc:creator>atchieu</dc:creator>
<guid>http://atchieu.wordpress.com/?p=68</guid>
<description><![CDATA[I use this a lot for research. I have a series of images in a postscript type format (e.g. EPS or PD]]></description>
<content:encoded><![CDATA[<p>I use this a lot for research. I have a series of images in a postscript type format (e.g. EPS or PDF) and then I want to turn the time series of data into an animation. For this i use <a href="http://www.imagemagick.org/script/index.php" target="_blank">ImageMagick</a> because it is a really nice command line tool for Unix operating systems to do batch type operations. You can even pipe it to C code! (Make sure you have it installed because it is not usually distributed with a bare Linux OS)</p>
<p>To do a simple conversion of images to an animated GIF we invoke the following</p>
<blockquote><p>&#62;convert -verbose -delay 20 -loop 0 -density 200 *.pdf output.gif</p></blockquote>
<p>and we get a nice GIF file. This takes the files named *.pdf in the order that they are listed and makes a GIF out of them with a 20 hundreths of a second delay between each frame. The -loop 0 flag makes it loop indefinitely. You can put 3 in there to loop 3 times etc. The -density 200 flag specifies a DPI of 200 for the image. This is only really used when converting postscript images.</p>
[caption id="attachment_70" align="aligncenter" width="205" caption="Animation of flow over a cylinder (vorticity) made from MATLAB + ImageMagick."]<a href="http://atchieu.files.wordpress.com/2008/07/animation1.gif"><img class="size-medium wp-image-70" src="http://atchieu.wordpress.com/files/2008/07/animation1.gif?w=205" alt="Animation of flow over a cylinder (vorticity) made from MATLAB + ImageMagick." width="205" height="112" /></a>[/caption]
]]></content:encoded>
</item>
<item>
<title><![CDATA[JMagick開發高品質縮圖程式 (on Windows)]]></title>
<link>http://javanote.wordpress.com/?p=46</link>
<pubDate>Mon, 14 Jul 2008 17:11:12 +0000</pubDate>
<dc:creator>pai911</dc:creator>
<guid>http://javanote.wordpress.com/?p=46</guid>
<description><![CDATA[上一篇Blog中說明了如何設定Glassfish的環境, 讓你的Web applicaiton可以使用JMagick]]></description>
<content:encoded><![CDATA[<p>上一篇Blog中說明了如何設定Glassfish的環境, 讓你的Web applicaiton可以使用JMagick(ImageMagick的JNI Library)來產生高品質的縮圖, 這篇要說明的是如何使用JMagick來撰寫縮圖程式. 下面是一個開發縮圖Utility Class的範例.</p>
<ul>
<li>首先, 程式中要Import相關的class</li>
</ul>
<blockquote><p>import java.awt.Dimension;<br />
import magick.ImageInfo;<br />
import magick.MagickException;<br />
import magick.MagickImage;</p></blockquote>
<ul>
<li>負責縮圖的方法很簡單</li>
</ul>
<blockquote>
<p style="padding-left:30px;"><span style="color:#800000;">    public static void resizeImageTo(String original, String resized, double maxDimension) throws MagickException {<br />
        ImageInfo info = new ImageInfo(original);</span></p>
<p style="padding-left:30px;"><span style="color:#800000;">        /*設定縮圖品質*/<br />
        info.setQuality(100); </span></p>
<p style="padding-left:30px;"><span style="color:#800000;">        /*計算縮圖的寬高*/<br />
        MagickImage image = new MagickImage(info);<br />
        Dimension dimension = image.getDimension();</span></p>
<p style="padding-left:30px;"><span style="color:#800000;">        double widthRatio = dimension.getWidth() / maxDimension;<br />
        double heightRatio = dimension.getHeight() / maxDimension;<br />
        double scaleRatio = Math.max(widthRatio, heightRatio);<br />
        int newWidth = (int) (dimension.getWidth() / scaleRatio);<br />
        int newHeight = (int) (dimension.getHeight() / scaleRatio);</span></p>
<p style="padding-left:30px;"><span style="color:#800000;">        /*以計算後的寬高縮圖*/<br />
<strong>        MagickImage smaller = image.scaleImage(newWidth, newHeight);</strong></span></p>
<p style="padding-left:30px;"><span style="color:#800000;">        /*將縮圖存到新的路徑*/<br />
</span><span style="color:#800000;"><strong>        smaller.setFileName(resized);<br />
        smaller.writeImage(info);</strong><br />
    }</span></p></blockquote>
<p style="padding-left:90px;"><strong>參數說明:</strong></p>
<blockquote>
<p style="padding-left:90px;">String original: 原圖的路徑字串</p>
<p style="padding-left:90px;">String resized: 縮圖後要存的路徑位址</p>
<p style="padding-left:90px;">double maxDimension: 用來設定最大的寬高的像素值, 無論寬或高都不會超過這個數值.</p>
</blockquote>
<ul>
<li>若是希望縮圖後不要寫到磁碟, 而是要輸出成Byte Array做其他用途, 請參考下面的程式碼即可</li>
</ul>
<blockquote>
<p style="padding-left:30px;"><span style="color:#800000;">    public static byte[] getResizedImageBytes(String original, double maxDimension) throws MagickException {<br />
        ImageInfo info = new ImageInfo(original);<br />
        info.setQuality(100);<br />
        MagickImage image = new MagickImage(info);<br />
        Dimension dimension = image.getDimension();</span></p>
<p style="padding-left:30px;"><span style="color:#800000;">        double widthRatio = dimension.getWidth() / maxDimension;<br />
        double heightRatio = dimension.getHeight() / maxDimension;<br />
        double scaleRatio = Math.max(widthRatio, heightRatio);</span></p>
<p style="padding-left:30px;"><span style="color:#800000;">        int newWidth = (int) (dimension.getWidth() / scaleRatio);<br />
        int newHeight = (int) (dimension.getHeight() / scaleRatio);<br />
        MagickImage smaller = image.scaleImage(newWidth, newHeight);<br />
<strong>       return smaller.imageToBlob(info);</strong><br />
    }</span></p></blockquote>
<p>程式邏輯沒甚麼變化, 主要差異在最後一行而已, 很easy吧</p>
<p>今天就到這邊了~睡覺去啦!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[在Glassfish V2中使用JMagick]]></title>
<link>http://javanote.wordpress.com/?p=18</link>
<pubDate>Wed, 09 Jul 2008 16:12:11 +0000</pubDate>
<dc:creator>pai911</dc:creator>
<guid>http://javanote.wordpress.com/?p=18</guid>
<description><![CDATA[曾經使用Java來產生縮圖的人都知道JDK提供的API並不能產生品質很高的縮圖. ]]></description>
<content:encoded><![CDATA[<p>曾經使用Java來產生縮圖的人都知道JDK提供的API並不能產生品質很高的縮圖. 因此許多人會採用第三方Library--<a href="http://www.imagemagick.org">ImageMagick</a>. 由於這個Library不是用Java撰寫的, 因此必須使用JNI來和這個Library溝通. 當然已經有人幫我們將JNI的程式寫完了, 也就是所謂的 <a href="http://www.jmagick.org/download.html">JMagick</a>.  要在Glassfish中使用JMagick, 可以按照下面步驟來做:</p>
<p><strong>1. 下載安裝ImageMagick程式</strong></p>
<p style="padding-left:30px;">請到<a href="http://downloads.jmagick.org/6.3.9/">這裡</a>下載 ImageMagic 6.3.9程式 (事實上目前最新的ImageMagick是6.4.2, 但是並非JMagick開發對應的版本, 所以還是直接從JMagick 網站放置的最新版本較好) </p>
<p style="padding-left:30px;">列表中有兩種版本--Q8和Q16. </p>
<ul>
<li> ImageMagick-6.3.9-0-Q8-windows-dll.exe</li>
<li> ImageMagick-6.3.9-0-Q16-windows-dll.exe</li>
</ul>
<p style="padding-left:30px;">按照<a href="http://www.imagemagick.org/script/binary-releases.php#windows">官方</a>說法, "Q16 version permits you to read or write 16-bit images without losing precision but requires twice as much resources as the Q8 version", 也就是說Q16可以不失真地處理16-bit的圖片, 但會用較多的資源, 官方建議使用Q16版本.</p>
<p style="padding-left:30px;">安裝很簡單, 只要一步一步往下點即可, 預設的安裝目錄為C:\Program Files\ImageMagick-6.3.9-Q16, 安裝程式預設也會將此目錄設定到PATH環境變數中 (<span style="color:#ff0000;">沒有設定此環境變數的話, JMagick就無法使用這個library喔</span>).</p>
<p><strong>2. 安裝JMagick</strong></p>
<p style="padding-left:30px;">請到<a href="http://downloads.jmagick.org/6.3.9/">這裡</a>下載目前JMagick最新的版本, 請根據你安裝的ImageMagic版本, 來下載相對應的 JMagick</p>
<p style="padding-left:30px;">在我們的例子中, 下載jmagick-win-6.3.9-Q16.zip</p>
<p style="padding-left:30px;">下載後, 解壓縮之後會有兩個檔案,</p>
<ul>
<li>將<strong>Jmagick.jar</strong> 加入你Web專案的library裡.</li>
<li>將<strong>jmagick.dll</strong> 放到你自己指定的資料夾中, 如D:\development\library\jmagick-win-6.3.9-Q16.</li>
</ul>
<p><strong>3. 將jmagick.dll 的資料夾路徑設定到Glassfish當中</strong></p>
<p style="padding-left:30px;">把瀏覽器移至Web管理介面(<a href="http://localhost:4848/">http://localhost:4848/</a>)</p>
<p style="padding-left:30px;">從左邊的樹狀選單選擇 <strong>"Application Server"</strong></p>
<p style="padding-left:30px;">右邊則是選擇 <strong>"JVM Settings" / "Path Settings"</strong> .</p>
<p style="padding-left:30px;">在"<span style="color:#ff0000;"><strong>Native Library Path Prefix</strong></span>" 的欄位中填入你放置jmagick.dll的資料夾(e.g. D:\development\library\jmagick-win-6.3.9-Q16)</p>
<p style="padding-left:30px;">最後按Save按鈕(要重開Glassfish才會生效喔). 如下圖所示</p>
<div class="mceTemp mceIEcenter" style="padding-left:30px;">
<dl class="wp_caption aligncenter">
<dt class="wp_caption_dt"><a href="http://javanote.files.wordpress.com/2008/07/native_library.jpg"><img class="size-thumbnail wp-image-31 " src="http://javanote.wordpress.com/files/2008/07/native_library.jpg?w=128" alt="" width="128" height="79" /></a></dt>
<dd class="wp_caption_dd">在Glassfish中設定native library path</dd>
</dl>
</div>
<p style="padding-left:30px;"> </p>
<p style="padding-left:30px;"> 最後可能有人會問, 那到底要如何使用Jmagick的API來處理圖片呢? 可以直接參考這個<a href="http://jmagick.wiki.sourceforge.net/Using+JMagick">官方wiki</a> 來撰寫Java code,開發之前記得把jmagick.jar加入你使用的IDE裡頭即可!</p>
<p style="padding-left:30px;">今天就這邊, 有空的話, 會再把我寫的code放上來給大家參考嘍!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Out of order]]></title>
<link>http://panospace.wordpress.com/?p=161</link>
<pubDate>Fri, 20 Jun 2008 19:39:16 +0000</pubDate>
<dc:creator>Yuval Levy</dc:creator>
<guid>http://panospace.wordpress.com/?p=161</guid>
<description><![CDATA[I try to automate as much of my process as I can - time is too short to do manually what a computer ]]></description>
<content:encoded><![CDATA[<p><a href="http://panospace.wordpress.com/files/2008/03/_mg_4946.jpg"><img class="alignleft size-thumbnail wp-image-81" src="http://panospace.wordpress.com/files/2008/03/_mg_4946.jpg?w=96" alt="" width="96" height="96" /></a>I try to automate as much of my process as I can - <strong>time is too short to do manually what a computer can do automagically</strong>. One of my favorite tools for such automated processing is <a href="http://www.imagemagick.org/script/index.php" target="_blank">ImageMagick</a>. It runs on a <a href="http://www.freebsd.org/" target="_blank">FreeBSD</a> server in the closet. I drop my stitched panoramas via the network at one end and at the other end I get a whole bunch of output formats. When I need a new type of output, I just update my scripts and run them all over my archive of images.</p>
<p>I regularly update the server. The FreeBSD <a href="http://www.freebsd.org/ports/index.html" target="_blank">ports collection</a> is one of the best things I've ever seen for system upgrade and maintenance, I have been a happy user for years. The nature of the system is such that sometimes a package will break despite the robustness of the ports system as a whole. When it does, careful analysis is required. <strong>Is this a problem of my specific system configuration or a bug with a software package or library? </strong>And if it is a problem of a software package or of a library, which one is it?</p>
<p><strong>After the last upgrade to ImageMagick 6.4.1.8 my engine broke down.</strong> Before filing a bug report with ImageMagick I <a href="http://www.imagemagick.org/pipermail/magick-users/2008-June/021410.html" target="_blank">looked for confirmation</a> from other ImageMagick users on the Magick users <a href="http://www.imagemagick.org/script/mailing-list.php" target="_blank">mailing list</a>. Is it a problem with my specific system, or with ImageMagick? I don't know yet.</p>
<p>I was surprised to say the least by this <a href="http://studio.imagemagick.org/pipermail/magick-users/2008-June/021414.html" target="_blank">reply</a> asking me to <strong>file a bug report on a web based forum</strong>. Web based forums don't even work as proper mailing list replacement (can't read/reply offline). Now they are supposed to replace a bug tracker?</p>
<p>Compare <a href="http://www.imagemagick.org/discourse-server/viewforum.php?f=3&#38;sid=48e9c5511d4ab68ac21a58a7776a8f9a" target="_blank">it</a> with dedicated bug trackers like the <strong>SourceForge bug tracker</strong> (not the best one) that we use for <a href="http://sourceforge.net/tracker/?group_id=77506&#38;atid=550441" target="_blank">hugin</a>; <strong>Bugzilla </strong>used amongst other by the <a href="https://bugzilla.mozilla.org/" target="_blank">Mozilla</a> foundation and <a href="http://bugzilla.gnome.org/" target="_blank">Gnome</a>; <strong>trac </strong>used amongst others by <a href="http://trac.wordpress.org/report" target="_blank">Wordpress</a> and <a href="http://trac.wxwidgets.org/" target="_blank">wxWidgets</a>.</p>
<p>Can a web based forum keep track of the status of a bug? assign it? prioritize it? find duplicates? close a bug?</p>
<p><strong>17 pages, 814 topics (bugs?)!</strong> that looks like a lot of noise to me. Purge! A bug tracker should only list relevant information, and if there are 17 pages of open bugs against a package the size of ImageMagick, something is badly broken. Web based forums smell stale.</p>
<p>I wish I had the time and resources to confirm if the problem with manipulating TIFFs in ImageMagick is specific to my box or a bug in the code, and to file a bug report if necessary. Unfortunately I currently lack the time and resources. <strong>I found a workaround for my specific situation: <a href="http://www.graphicsmagick.org/" target="_blank">GraphicsMagick</a>. </strong>In my glue script, it worked as a drop in replacement for ImageMagick. And it has a <a href="http://sourceforge.net/tracker/?group_id=73485&#38;atid=537937" target="_blank">bugtracker</a> where I can file bug reports without the nuisances of a web based forum. I will get back to ImageMagick when I have the time to make my system work again with it.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Escalar imágenes rápidamente]]></title>
<link>http://andalinux.wordpress.com/?p=31</link>
<pubDate>Thu, 12 Jun 2008 10:00:26 +0000</pubDate>
<dc:creator>jasvazquez</dc:creator>
<guid>http://andalinux.wordpress.com/?p=31</guid>
<description><![CDATA[Aunque cualquier programa te permite fácilmente cambiar el tamaño de una imagen, en ocasiones o no]]></description>
<content:encoded><![CDATA[<p><img class="alignright" style="border:0 none;float:right;margin-left:15px;margin-right:15px;" src="http://img246.imageshack.us/img246/5577/escalarimagenvn3.png" alt="" width="123" height="150" />Aunque cualquier programa te permite fácilmente cambiar el tamaño de una imagen, en ocasiones o no podemos instalarlo o simplemente nuestro equipo va a reventar por los pocos recursos con los que cuenta.</p>
<p>Es en estas ocasiones cuando tirar de la <em>terminal</em> puede ser una forma rápida, sencilla y eficiente de <em>redimensionar</em> las imágenes.</p>
<p>En esta ocasión trataremos el comando <em><a href="http://www.imagemagick.org/script/mogrify.php" target="_blank">mogrify</a></em> incluido en el paquete <em>ImageMagick</em> y que me ha permitido en el Centro TIC en el que trabajo bajar rápidamente la calidad de las fotos de excursiones para poder publicarlas en la web del <em>Instituto</em>.</p>
<p><!--more--></p>
<p>Para poder utilizarlo debes contar con el paquete <em>ImageMagick </em>instalado en tu equipo por lo que deberás hacer uso de Synaptic o bien lanzar desde la terminal el comando</p>
<blockquote><p>sudo apt-get install imagemagick</p></blockquote>
<p>Una vez instalado, para cambiar la <em>resolución</em> a 640x480 y bajar la calidad al 20% de todas las imágenes alojadas en el directorio /tmp/fotos, he lanzado la siguiente instrucción (el * es para que trate todas las fotos del directorio /tmp/fotos aunque se pueden hacer "chulerías" como sólo procesar los jpg cambiándolo por /tmp/fotos/*.jpg)</p>
<blockquote><p>mogrify -size 640 -quality 20 /tmp/fotos/*</p></blockquote>
<p>Existen muchas otras opciones que pueden ser consultadas en la web del proyecto; si veo interés podría ir colocando nuevas "chuletas" que os hagan un poco más fácil su uso ;)</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Some Problems I faced while configuring rails and ruby-gems in ubuntu]]></title>
<link>http://moustafaemara.wordpress.com/?p=16</link>
<pubDate>Tue, 10 Jun 2008 00:58:26 +0000</pubDate>
<dc:creator>moustafaemara</dc:creator>
<guid>http://moustafaemara.wordpress.com/?p=16</guid>
<description><![CDATA[Facing problems while configuring anything in linux is a normal thing .. may be its boring and tirin]]></description>
<content:encoded><![CDATA[<p>Facing problems while configuring anything in linux is a normal thing .. may be its boring and tiring .. but its really interesting when you solve them..</p>
<p>As a linux  starter i face some problems while configuring ruby on rails environment for linux .. Here they are</p>
<p>Note : Sure before any thing you need to get ruby and rails installed</p>
<ul>
<li><em><strong>sudo apt-get install ruby</strong></em></li>
<li><em><strong>sudo apt-get install rubygems</strong></em></li>
<li><strong><em>gem install rails --include-dependencies</em></strong></li>
</ul>
<p>1.<strong>Problem :Any Gem that lets you choose between mswin32 and ruby ( and of course you choose ruby ) is installed </strong></p>
<ul>
<li><em>Solution : Simply this happens because these gems require compilation so just give them the tool</em>
<ul>
<li><strong> sudo apt-get install g++ </strong>( Now you are done and can work )</li>
</ul>
</li>
</ul>
<p>2.  <strong>Problem : While Installing A gem it tells you this: Could not create Makefile due to        some necessary libraries and/or headers.  Check the mkmf.log file for more<br />
details.  You may need configuration options. </strong></p>
<ul>
<li><em>Solution : This Happens because the  ruby1.8-dev  required library is not installed so simply </em>
<ul>
<li><em><strong>sudo apt-get install ruby1.8-dev </strong>Done</em></li>
</ul>
</li>
</ul>
<p><em> </em>3. <strong>Problem : Always installing rmagick gem is a problem but i think its solution in linux is more simple than windows </strong></p>
<ul>
<li><em>Solution : 3 Steps ( Download imagicmagick , The Lib Magick library , Then the Gem )</em><em><br />
</em></p>
<ul>
<li><em><strong>sudo apt-get install imagemagick </strong></em></li>
<li><em><strong>sudo apt-get install libmagick9-dev </strong></em></li>
<li><em><strong>gem install rmagick </strong></em></li>
</ul>
</li>
</ul>
<p>4. <strong>Problem : The great Problem of the file ( /tmp/mysql.sock ) which makes you not able to use rake db:migrate or any other access to the mysql databases</strong></p>
<ul>
<li><em>Solution : This Problem arises as the mysql.sock file location and a name has changed during newer versions to be installed in this silly location ( /var/run/mysqld</em>/mysqld.sock) . Really Boring... So now we have to make a symbolic link and also change the name so do this
<ul>
<li><em><strong>ln -s /var/run/mysqld/mysqld.sock  /tmp/mysql.sock </strong></em></li>
</ul>
</li>
</ul>
<p><strong>These Problems were very annoying and tiring for me and i hope it helps </strong></p>
<p><em></em></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[PDF cover thumbnails for attached files]]></title>
<link>http://chirale.wordpress.com/?p=71</link>
<pubDate>Fri, 06 Jun 2008 15:08:36 +0000</pubDate>
<dc:creator>chirale</dc:creator>
<guid>http://chirale.wordpress.com/?p=71</guid>
<description><![CDATA[Tested on:

Drupal 5.x
Content Templates module
ImageMagick 6.3.7
GhostScript 8.15.3

Using ImageMag]]></description>
<content:encoded><![CDATA[<p>Tested on:</p>
<ul>
<li>Drupal 5.x</li>
<li>Content Templates module</li>
<li>ImageMagick 6.3.7</li>
<li>GhostScript 8.15.3</li>
</ul>
<p>Using ImageMagick + GhostScript you can convert the first page of a PDF into a thumbnail image linking to file. You can cut and paste this function on your theme main script: you have to manually create the thumb directory and grant write permission by scripts. Check also the path to ImageMagick convert command.</p>
<pre style="font-size:11px;"><code>
function pdf_thumb_attachments(){
 $allowed_mime = array("application/pdf");
	foreach($files as $file){
	if(in_array(strtolower($file-&#62;filemime),$allowed_mime) &#38;&#38; strstr(strtolower($file-&#62;description),"classifica")){
		$title = $file-&#62;description;
		if(substr($title,-4)==".pdf"){
			# create link title from file name (Transliteration module suggested)
			$title = str_replace("_"," ",substr($title,0,strlen($title)-4));
		}
		$img = "";
		$local_src_path = getcwd() . "/" . $file-&#62;filepath;
		$destfilename = substr($file-&#62;filename,0,strlen($file-&#62;filename)-4) . ".gif";
		# YOUR-FILES-DIRECTORY/pdfgen will hosts the generated thumbnails
		$local_dest_path = getcwd() . "/" . file_directory_path() . "/pdfgen/" . $destfilename;
		$imageurl = base_path() . file_directory_path() . "/pdfgen/" . $destfilename;
		/* create thumbnail on node reading if file doesn't exist */
		if(!file_exists($local_dest_path)){
			# choose the first page of the PDF, scale to 90x90px and convert to GIF
			$exec = '/usr/bin/convert -scale 90x90 "'.$local_src_path.'"[0] "'.$local_dest_path . '"';
			shell_exec($exec);
			/* delete this line if you cannot read the generated file
			$exec = "chmod 777 ".$local_src_path;
			shell_exec($exec);
			//*/
		}
		$img = '&#60;img src="'.$imageurl.'" alt="'.$title.'" /&#62;';
		$output .= "&#60;li&#62;". l($img." ".$title,$file-&#62;filepath, $attributes = array("title"=&#62;$title), $query = NULL, $fragment = NULL, $absolute = TRUE, $html = TRUE) . "&#60;/li&#62;";
	}
	}
 if(!empty($output)){
	$output = '&#60;div class="my-attachments"&#62;&#60;ul&#62;' . $output . "&#60;/ul&#62;&#60;/div&#62;";
 }
 return $output;
}
</code></pre>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Wolkig und stürmisch]]></title>
<link>http://servuzmaxguat.wordpress.com/?p=131</link>
<pubDate>Fri, 30 May 2008 22:22:37 +0000</pubDate>
<dc:creator>servuzmaxguat</dc:creator>
<guid>http://servuzmaxguat.wordpress.com/?p=131</guid>
<description><![CDATA[In meim Tag Surfer hagelt es heute Erlebnisse von Leuten, die an Installationen, Software und Komput]]></description>
<content:encoded><![CDATA[<p>In meim Tag Surfer hagelt es heute Erlebnisse von Leuten, die an Installationen, Software und Komputern verzweifeln.</p>
<p>Kann ich bestätigen: ich habe heute sagenhafte vier Stunden gebraucht, um zwölf Bilder kleinzurechnen.</p>
<p>Grund war das Missverhalten der Microsoft Bild und Fax Anzeige die beim bilder drehen Bilder nicht so dreht, dass sie auch gedreht sind. Danke Microsoft. Und Photoshop, das dieses Verhalten von Microsoft nicht korrigieren mag. Und ImageMagick, das zwar das Drehen von microsoft übernimmt, dafür aber manche Bilder nicht mag und deswegen wortlos stehen bleibt.</p>
<p>Und überhaupt, war heute alles irgendwie instabil.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Installation Instructions for ImageMagick Pre-requisites, ImageMagic, RMagic and Attachment_Fu]]></title>
<link>http://webflakes.wordpress.com/?p=24</link>
<pubDate>Fri, 30 May 2008 06:59:09 +0000</pubDate>
<dc:creator>abloomconcept</dc:creator>
<guid>http://webflakes.wordpress.com/?p=24</guid>
<description><![CDATA[This installation applies to the following platform:
OS: Mac OS X 10.3.9, hence the version installe]]></description>
<content:encoded><![CDATA[<p>This installation applies to the following platform:</p>
<p>OS: Mac OS X 10.3.9, hence the version installed for ImageMagick = 6.2.6 and rmagic = 1.15.14</p>
<p>Rails: 1.2.3</p>
<p>Installation Directory =&#62; /usr/local</p>
<p><strong>ImageMagic Pre-requisites</strong></p>
<p>1) Install GNU LibTool<br />
LibTool is required to install the various RMagick delegate libraries as shared libraries. Check to see if<a href="ftp://ftp.remotesensing.org/libtiff/"></a> you have GNU LibTool, usually installed in /usr/local/bin/libtool. If it's not there, do this (do check out the latest version from www.gnu.org/software/libtool ):</p>
<p><a href="http://www.gnu.org/software/libtool/">http://www.gnu.org/software/libtool/</a></p>
<p>a) downloaded latest version (2.2.4) to desktop and unzip<br />
b) move folder libtool-2.2.4 from desktop to /usr/local<br />
c) $ cd /usr/local/libtool-2.2.4<br />
d) $ ./configure<br />
e) $ make<br />
f) $ sudo make install</p>
<p>2) JPEG Library<br />
This is one of the delegate libraries recommended in the RMagick Install Guide. I thought I'll need it (get the latest library from www.ijg.org):</p>
<p>a) download JPEG from here and unzip on desktop:<br />
<a href="http://rmagick.rubyforge.org/install-faq.html#imprereq">http://rmagick.rubyforge.org/install-faq.html#imprereq</a><br />
b) move folder jpeg-6b from desktop to /usr/local<br />
c) $ cd /usr/local/jpeg-6b<br />
d) Create symbolic link:<br />
$ ln -s /usr/local/bin/libtool ./libtool<br />
e) $./configure --enable-shared<br />
f) $ make<br />
g) $ sudo make install</p>
<p>3) PNG LIbrary<br />
Get this too if you think you'd be playing with PNGs (home: libpng.sourceforge.net):</p>
<p>a) Download 1.2.29 from here and unzip on desktop:<br />
<a href="http://sourceforge.net/project/showfiles.php?group_id=5624">http://sourceforge.net/project/showfiles.php?group_id=5624</a><br />
b) move folder libpng-1.2.29 from desktop to /usr/local<br />
c) $ cd /usr/local/libpng-1.2.29<br />
d) $./configure --enable-shared<br />
e) $ make<br />
f) sudo make install</p>
<p>4) FreeType &#38; Ghostscript<br />
It turns out RMagick needs both FreeType and Ghostscript to install properly. (Source: freetype.sourceforge.net, www.cs.wisc.edu/~ghost)</p>
<p>FreeType<br />
a) Download FreeType from here and unzip on desktop:<br />
<a href="http://freetype.sourceforge.net/download.html#stable">http://freetype.sourceforge.net/download.html#stable</a><br />
b) move folder freetype-2.3.5 from desktop to /usr/local<br />
c) $ cd /usr/local/libpng-1.2.29<br />
d) $./configure --enable-shared<br />
e) $ make<br />
f) sudo make install</p>
<p>GhostScript<br />
a) Download ghostscript 8.62 from here and unzip on desktop:<br />
<a href="http://pages.cs.wisc.edu/~ghost/doc/GPL/gpl862.htm">http://pages.cs.wisc.edu/~ghost/doc/GPL/gpl862.htm</a><br />
b) move folder ghostscript-8.62 from desktop to /usr/local<br />
c) $ cd /usr/local/ghostscript-8.62<br />
d) $./configure --enable-shared<br />
e) $ make<br />
f) sudo make install</p>
<p>5) Ghostscript Fonts<br />
a) download Ghostscript fonts (8.11)from here and unzip on desktop:<br />
<a href="http://rmagick.rubyforge.org/install-faq.html#imprereq">http://rmagick.rubyforge.org/install-faq.html#imprereq</a><br />
b) move folder fonts from desktop to /usr/local/share</p>
<p>6) Tiff Library<br />
a) Download tiff 3.8.2 from here and unzip on desktop:<br />
<a href="ftp://ftp.remotesensing.org/libtiff/">ftp://ftp.remotesensing.org/libtiff/</a><br />
b) move folder tiff 3.8.2 from desktop to /usr/local<br />
c) $ cd /usr/local/tiff-3.8.2<br />
d) $./configure --enable-shared<br />
e) $ make<br />
f) sudo make install</p>
<p><strong>Install ImageMagick</strong><br />
7) ImageMagick<br />
a) Installed version 6.2.6 because that's the latest version that works with OS X 10.3.9<br />
<a href="ftp://ftp.remotesensing.org/libtiff/">http://www.imagemagick.org</a><br />
<a href="ftp://ftp.remotesensing.org/libtiff/"></a><a href="ftp://ftp.imagemag&#60;/a&#62;ick.org/pub/ImageMagick/ImageMagick-6.2.6.tar.gz">ftp://ftp.imagemag</a>ick.org/pub/ImageMagick/ImageMagick-6.2.6.tar.gz<br />
b) move folder ImageMagick-6.2.6 from desktop to /usr/local<br />
c) $ cd /usr/local/ImageMagick-6.2.6<br />
d) $./configure (see configuration file below before proceeding to next step)<br />
e) $ make<br />
f) sudo make install</p>
<p>After you run ./configure, this is the setting. Make sure Jpeg, Png, Tiff are all set to YES.<br />
ImageMagick is configured as follows. Please verify that this configuration<br />
matches your expectations.</p>
<p><a href="http://webflakes.files.wordpress.com/2008/05/temp1.jpg"><img class="aligncenter size-full wp-image-26" src="http://webflakes.wordpress.com/files/2008/05/temp1.jpg" alt="" width="500" height="635" /></a></p>
<p>8) Check that ImageMagick works<br />
$ /usr/local/bin/convert logo: logo.gif<br />
$ convert logo: image.jpg<br />
You shouldn't get any error when running the above command.</p>
<p>9) <strong>install rmagick gem</strong><br />
<a href="http://rmagick.rubyforge.org/index.html">http://rmagick.rubyforge.org/index.html</a><br />
$ sudo gem install rmagick -v 1.15.14<br />
This version works with imagemagick 6.2.6</p>
<p>Do this to check that RMagick is installed properly:<br />
$ irb -rubygems -r RMagick<br />
irb(main):001:0&#62; puts Magick::Long_version<br />
This is RMagick 1.15.7 ($Date: 2007/06/09 16:45:25 $) Copyright (C) 2007 by Timothy P. Hunter<br />
Built with ImageMagick 6.3.4 06/13/07 Q8 http://www.imagemagick.org<br />
Built for ruby 1.8.5 (2007-03-13 patchlevel 35) [x86_64-linux]<br />
Web page: http://rmagick.rubyforge.org<br />
Email: rmagick@rubyforge.org<br />
=&#62; nil</p>
<p>10) Need more help? RMagick FAQ:<br />
<a href="http://rmagick.rubyforge.org/install-faq.html">http://rmagick.rubyforge.org/install-faq.html</a></p>
<p>11) <strong>Install Attachment_fu</strong></p>
<p>a) go to your apps directory and run the following command. The plugin will be installed into vendor/plugins<strong></strong><br />
ruby script/plugin install http://svn.techno-weenie.net/projects/plugins/attachment_fu/</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Projector Setup]]></title>
<link>http://structuredsand.wordpress.com/?p=22</link>
<pubDate>Tue, 27 May 2008 03:32:34 +0000</pubDate>
<dc:creator>silencer22</dc:creator>
<guid>http://structuredsand.wordpress.com/?p=22</guid>
<description><![CDATA[Libraries to be installed

OpenGL
OpenCV v4 Beta
Microsoft DirectX 9.0 SDK Update (Decemeber 2004)
I]]></description>
<content:encoded><![CDATA[<p><strong>Libraries to be installed</strong></p>
<ul>
<li>OpenGL</li>
<li>OpenCV v4 Beta</li>
<li>Microsoft DirectX 9.0 SDK Update (Decemeber 2004)</li>
<li>ImageMagick 5.4.8</li>
</ul>
<p><strong>Tools &#62; Options &#62; Directories &#62; Show directories for</strong></p>
<p>Excecutable files</p>
<ul>
<li>C:\ImageMagick-5.4.8\VisualMagick\bin</li>
<li>C:\Program Files\OpenCV\bin</li>
<li>C:\Program Files\Intel\OpenCV\bin</li>
</ul>
<p>Include files</p>
<ul>
<li>C:\DXSDK\INCLUDE</li>
<li>C:\Program Files\Intel\OpenCV\Otherlibs\Highgui</li>
<li>C:\Program Files\Intel\OpenCV\cvaux\include</li>
<li>C:\Program Files\Intel\plsuite\include</li>
<li>E:\wq\projector-code\projector (has to appear b4 the magick)</li>
<li>C:\imagemagick-5.4.8\Magick++\lib</li>
<li>C:\imagemagick-5.4.8\</li>
</ul>
<p>Library files</p>
<ul>
<li>C:\DXSDK\LIB</li>
<li>C:\Program Files\Intel\OpenCV\lib</li>
<li>C:\Program Files\Intel\plsuite\lib\msvc</li>
<li>C:\imagemagick-5.4.8\Visualmagick\lib</li>
<li>C:\imagemagick-5.4.8\magick</li>
<li>E:\wq\proj library</li>
</ul>
<p><strong>Project Settings &#62; Link &#62; Object/Library modules:</strong></p>
<p>kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib</p>
<p>ipl.lib cv.lib CORE_RL_magick_.lib CORE_RL_Magick++_.lib vfw32.lib highgui.lib opengl32.lib glut32.lib glu32.lib</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[ImageMagick dan PerlMagick - Can't load problem]]></title>
<link>http://carasetting.wordpress.com/?p=3</link>
<pubDate>Thu, 15 May 2008 15:11:59 +0000</pubDate>
<dc:creator>carasetting</dc:creator>
<guid>http://carasetting.wordpress.com/?p=3</guid>
<description><![CDATA[Note dari 2007 :
Hari saya melakukan install ImageMagick dan PerlMagick.
Ada masalah pada dependency]]></description>
<content:encoded><![CDATA[<p>Note dari 2007 :</p>
<p>Hari saya melakukan install ImageMagick dan PerlMagick.<br />
Ada masalah pada dependency filenya. Jika file perl yang berisi image processing dengan imagemagick dipanggil, akan keluar error seperti ini :</p>
<p>Can't load '/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/Image/Magick/Magick.so' for module Image::Magick:libMagick.so.9: cannot open shared object file: No such file or directory at<br />
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230. at imagemagick.pl line 5<br />
Compilation failed in require at imagemagick.pl line 5.<br />
BEGIN failed--compilation aborted at imagemagick.pl line 5</p>
<p>Akhirnya saya menemukan penyelesaian untuk masalah tersebut disalah satu forum IT :<br />
1) Show dependencies of the non-functional module:<br />
ldd /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/Image/Magick/Magick.so<br />
2)Add Sym-link<br />
ln -s /usr/local/lib/libMagick.so.10 /usr/lib<br />
3) creates the necessary links and cache to the most recent shared libraries<br />
ldconfig /usr/local/lib</p>
<p>Masalah lain terjadi ketika file perl dicompile, muncul error message :  "composite: no decode delegate for this image format src.jpg". Hal ini disebabkan .jpg belum disupport. Oleh karena itu perlu dilakukan install libjpeg-devel.<br />
Pilih salah satu source libjpeg-devel dari http://rpmfind.net/linux/rpm2html/search.php?query=libjpeg-devel<br />
Kemudian lakukan rpm -ivh, setelah itu .configure, make, dan make install source imagemagick kembali.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Javascript and ImageMagick sitting in a tree...]]></title>
<link>http://sxoop.wordpress.com/?p=144</link>
<pubDate>Tue, 13 May 2008 23:59:53 +0000</pubDate>
<dc:creator>sxoop</dc:creator>
<guid>http://sxoop.wordpress.com/?p=144</guid>
<description><![CDATA[I&#8217;m really excited about an upcoming feature in Pixenate. Pixenate is extensible, that is, if ]]></description>
<content:encoded><![CDATA[<p>I'm really excited about an upcoming feature in Pixenate. Pixenate is extensible, that is, if there isn't a tool that pixenate already does, you can add it yourself by writing a Pixenate plugin. Want to know what a Pixenate plugin is? Simple. It's a piece of code which operates on the photo. Here's the Enhance plugin...</p>
<pre>
use strict;
use Sxoop::PXN8 ':all';
sub enhance
{
  my ($image) = @_;
  $image-&#62;Enhance();
  return $image;
}
AddOperation('enhance', \&#38;enhance);
1;
</pre>
<p>Pretty simple huh? Once you know a little Perl and a little <a href="http://imagemagick.org/script/perl-magick.php">ImageMagick</a>, writing Pixenate plugins is a breeze. This feature has been present since day one and many of our customers have written their own plugins.<br />
I was thinking for a long time that it would be nice to be able to write plugins in Javascript since - you know - that's what many Pixenate developers dabble in anyway. Well [drum roll] ... now you can...</p>
<pre>
function enhance(){
   var image = PXN8.ImageMagick.start();
   image.Method("Enhance");
   PXN8.ImageMagick.end(image);
}
</pre>
<p>Pretty neat huh? There's a more detailed discussion of this in the <a href="http://pixenate.com/pixenate/docs/API-Reference.html#ImageMagickBridgefunctions">Pixenate API Reference</a>. Basically what we've done is exposed all of the Image Manipulation methods available in ImageMagick (sorry no Write() method - allowing client code call this directly would be amazingly stupid). We're still testing this out but we hope to release it in the next update of Pixenate which should be due in the next few days.<br />
What's interesting about PXN8.ImageMagick is that it is a <a href="http://en.wikipedia.org/wiki/Mock_object">Mock Object</a>. When you invoke ...</p>
<pre>
    image.Method("Enhance");
</pre>
<p>... in javascript, nothing happens to the image, in fact nothing happens until you invoke ...</p>
<pre>
    PXN8.ImageMagick.end(image);
</pre>
<p>... All calls to <em>Method</em> simply store the method name and object id in an internal array. That array (of object ids and methods) is eventually submitted to the server when the <em>PXN8.ImageMagick.end()</em> function is invoked.<br />
I began working on this a couple of days ago. Initially there was no API, just JSON. I had to think carefully about the data representation in JSON first - how do I represent something like the following perl code in JSON?</p>
<pre>
my $shadow = new Image::Magick();
$shadow-&#62;Set(size =&#62; "500x333");
$shadow-&#62;Read("xc:black");
$image-&#62;Composite(image =&#62; $shadow, compose=&#62;"Over");
</pre>
<p>There's a lot going on in the above code, new objects being created, methods being called, and parameters being passed . To complicate things further, some of those parameters are themselves objects. The solution I came up with was this...</p>
<pre>
[
 [ "shadow", "Set", {size: "500x333"} ],
 [ "shadow", "Read", "xc:black" ],
 [ "image", "Composite", {image: {handle: "shadow"}, compose: "Over"}]
]
</pre>
<p>As you can see it's an array where every element is a statement. Each statement is itself an array consisting of 3 elements, an object id, method name, and (optional) parameters.<br />
A couple of points of interest...</p>
<ul>
<li>If a symbol (e.g. "shadow") doesn't already exist then a new Image::Magick object is created and assigned to that symbol/variable. </li>
<li>I used the <em>{handle: "symbolName"}</em> notation to indicate parameters which where themselves Image::Magick objects (see for example the <a href="http://imagemagick.org/script/perl-magick.php#manipulate">Composite</a> method).</li>
</ul>
<p>Once I'd settled on a JSON (data) representation, wrapping a procedural interface (api) around it was a no-brainer. JSON is good but ...</p>
<pre>
var shadow = new PXN8.ImageMagick();
shadow.Method("Set",{size: "500x333"});
shadow.Method("Read","xc:black");
image.Method("Composite",{image: shadow, compose: "Over"});
</pre>
<p>... is just so much easier to read and maintain, and it maps pretty well to what the Perl code would have looked like on the server (had it been implemented as a pure server-side plugin).</p>
<p>A couple of caveats: Right now, the javascript API doesn't support ImageMagick's <em>Get</em> method so you'll still need to write Perl code if you want to do some complex stuff. However, it's surprising just how much you can do with the Javascript API, you can see a demonstration which creates a <a href="http://pixenate.com/pixenate/docs/example-imagemagick2.html">polaroid photo effect here</a>.<br />
The code is still in early stages so I need to do more testing before (if?) I roll this into the next release.<br />
The <em>really</em> neat thing is that the client-side <a href="http://pixenate.com/pixenate/javascript/pxn8_imagemagick.js">PXN8.ImageMagick code</a> is really small (most of that source file is a comment which gets rolled into the API reference document using Markdown - the subject of another post in waiting). Everything just fell out from the JSON representation - nailing down what your data looks like on the wire really pays off when you start writing a procedural interface.<br />
Right now I'm giddy at the idea of being able to create new Pixenate plugins in Javascript. The more I play with Javascript, the more I'm convinced it is (as Steve Yegge calls it) the <a href="http://steve-yegge.blogspot.com/2007/02/next-big-language.html">Next big language</a>. It's just so elegant, expressive and flexible - so unlike Java.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Generation of high quality bitmap fonts]]></title>
<link>http://3dmon.wordpress.com/?p=59</link>
<pubDate>Sat, 10 May 2008 07:35:55 +0000</pubDate>
<dc:creator>Dr. Goulu</dc:creator>
<guid>http://3dmon.wordpress.com/?p=59</guid>
<description><![CDATA[here is how to quickly and automatically generate bitmap fonts with an alpha channel, providing a pe]]></description>
<content:encoded><![CDATA[<p style="text-align:left;">here is how to quickly and automatically generate bitmap fonts with an alpha channel, providing a perfect anti-aliasing on any background. Any vector font can be used and combined with an infinity of graphic effects.<a href="http://3dmon.wordpress.com/files/2008/05/test.jpg"><img class="alignnone size-full wp-image-57 aligncenter" src="http://3dmon.wordpress.com/files/2008/05/test.jpg" alt="" width="480" height="288" /></a></p>
<p style="text-align:left;">The software that does 99% of the job is <a href="http://www.imagemagick.org/" target="_blank">ImageMagick</a>, a free, open-source image processing tool that I consider as a "GUI-less Photoshop" : as powerful as Adobe's product, ImageMagick is used only from another program, or even from the shell. Install it urgently.</p>
<p style="text-align:left;">Below is the small batch file that creates a few files containing words including the font.png with the "font" text used in the image above :</p>
<p><code>@echo off<br />
rem Function:	Create transparent background, aliased texts from a list of words<br />
rem Author:	Philippe Guglielmetti<br />
rem Requires:	ImageMagick v.6 or later (www.imagemagick.org)<br />
set texts=OK Abort Cancel font "This is Great !"<br />
set params=-background none -font Bauhaus-93 -pointsize 72 -density 300 -fill blue -blur 0x5<br />
for %%a in (%texts%) do convert.exe  %params% label:%%a %%a.png<br />
set texts=<br />
set params=</code></p>
<p>"params" define the font to create:</p>
<ul>
<li>-background none is mandatory to draw the font on a transparent background (alpha channel)</li>
<li>-font Bauhaus-93 defines the vector font to use (its name is sometimes not the same as the one displayed in Windows "Fonts" folder...)</li>
<li>-pointsize 72 -density 300 specifies the font should be 72pt high on a 300dpi device. The bitmap size will therefore be larger on screen, but it can be printed or used as a texture in a 3D game or a Demoniak3D demo with a perfect quality.</li>
<li>
<p style="text-align:center;"><img class="alignright alignnone size-full wp-image-58" style="float:right;margin:3px;" src="http://3dmon.wordpress.com/files/2008/05/zoomo.png" alt="" width="320" height="200" /></p>
<p>-fill blue -blur 0x5 are two basic effects : the symbol is filled with blue, and its contour (1 pixel of black by default) is slightly blured on 5 pixels. This creates semi-transparent pixels at the symbols borders, which enables a perfect superimposition whatever the background color, as shown on the zoom right:</p>
<p style="text-align:center;">
</li>
</ul>
<p>To superimpose the text on a background texture for a quality check, another ImageMagick is called:</p>
<p><code>composite.exe -tile back.png -compose Dst_Over font.png test.jpg</code></p>
<p>Once the test passed, we can generate all the chars of the font. When only a few symbols are required, we could re-use the batch file above, definining for exemple</p>
<p><code>set texts=0 1 2 3 4 5 6 7 8 9<br />
</code></p>
<p>This can be cumbersome for a complete font, and for application programming reasons it might be useful to name the files by the ASCII code of each char. As this is not possible to code in Windows batch language, we have to code it in a real language such as LUA:</p>
<p><code>params="-background none -font Bauhaus-93 -pointsize 72 -density 300 -fill white -blur 0x5 "<br />
for i=32,167 do<br />
os.execute("convert.exe "..params.."label:"..string.char(i).." "..i..".png")<br />
end</code></p>
<p>These 4 lines automatically generate 130 files of nice symbols ready to be loaded as textures in your game. Note that these files total about 10 Mb au total, more than ImageMagick. It might therefore be worth to consider including ImageMagick in your product and use it at insall time to generate the required fonts instead of creating a heavy distribution</p>
<p>Now, if the fonts above are a bit rough for you, have a look at  <a href="http://www.imagemagick.org/Usage/fonts/" target="_blank">this page</a> which will give you some idea of the possible effects, and explore <a href="http://www.imagemagick.org/Usage/" target="_blank">this one</a> for the full picture.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Génération de polices bitmap de haute qualité]]></title>
<link>http://3dmon.wordpress.com/?p=56</link>
<pubDate>Sat, 10 May 2008 07:11:29 +0000</pubDate>
<dc:creator>Dr. Goulu</dc:creator>
<guid>http://3dmon.wordpress.com/?p=56</guid>
<description><![CDATA[Voici comment générer rapidement et automatiquement des polices de caractères bitmap avec canal a]]></description>
<content:encoded><![CDATA[<p style="text-align:left;">Voici comment générer rapidement et automatiquement des polices de caractères bitmap avec canal alpha, donnant un anti-aliasing parfait quel que soit la texture de fond utilisée. Toutes les polices vectorielles peuvent être utilisées et combinées avec une infinité d'effets graphiques.<a href="http://3dmon.wordpress.com/files/2008/05/test.jpg"><img class="alignnone size-full wp-image-57 aligncenter" src="http://3dmon.wordpress.com/files/2008/05/test.jpg" alt="" width="480" height="288" /></a></p>
<p style="text-align:left;">Le logiciel réalisant 99% du travail est <a href="http://www.imagemagick.org/" target="_blank">ImageMagick</a>, un programme de traitement d’images open-source gratuit que je considère comme un "Photoshop sans GUI" : aussi puissant que l'outil d'Adobe, ImageMagick s'utilise uniquement depuis un autre programme, voire simplement la ligne de commande du shell. A installer d'urgence.</p>
<p style="text-align:left;">Voici par exemple le petit fichier batch qui crée quelques fichiers contenant des mots, dont le fichier font.png contenant le mot "font" de l'image ci-dessus :</p>
<p><code>@echo off<br />
rem Function:	Create transparent background, aliased texts from a list of words<br />
rem Author:	Philippe Guglielmetti<br />
rem Requires:	ImageMagick v.6 or later (www.imagemagick.org)<br />
set texts=OK Abort Cancel font "This is Great !"<br />
set params=-background none -font Bauhaus-93 -pointsize 72 -density 300 -fill blue -blur 0x5<br />
for %%a in (%texts%) do convert.exe  %params% label:%%a %%a.png<br />
set texts=<br />
set params=</code></p>
<p>Les "params" définissent la police à réaliser:</p>
<ul>
<li>-background none est essentiel pour dessiner la police sur un fond transparent (canal alpha)</li>
<li>-font Bauhaus-93 définit la police vectorielle à utiliser (dont le nom n'est parfois pas identique à celui apparaissant dans le dossier "Fonts" de Windows...)</li>
<li>-pointsize 72 -density 300 spécifient que la police doit faire 72pt de haut à 300dpi. La taille du bitmap sera donc supérieure à l'écran, mais il pourra être imprimé ou utilisé comme texture dans un jeu 3D ou une démo Demoniak3D avec un résultat d'excellente qualité</li>
<li>
<p style="text-align:center;"><img class="alignright alignnone size-full wp-image-58" style="float:right;margin:3px;" src="http://3dmon.wordpress.com/files/2008/05/zoomo.png" alt="" width="320" height="200" /></p>
<p>-fill blue -blur 0x5 sont deux petits effets de base : on remplit le caractère en bleu, et on adoucit le tracé de la lettre, qui est d'un pixel de noir par défaut. Ceci crée des pixels semi-transparents au bord des caractères, ce qui permet une découpe parfaite des caractères quel que soit le fond, comme on le voit sur le zoom ci-contre:<br />
<a href="http://3dmon.files.wordpress.com/2008/05/zoomo.png"></a></p>
<p style="text-align:center;">
</li>
</ul>
<p>Pour placer la police sur la texture de fond afin de vérifier sa qualité, on utilise un autre module d'ImageMagick;</p>
<p><code>composite.exe -tile back.png -compose Dst_Over font.png test.jpg</code></p>
<p>Une fois ce test réalisé, on peut s'attaquer à la génération de tous les caractères de la police. Si seuls quelques caractères sont nécessaires, on peut utiliser le batch ci-dessus en définissant par exemple</p>
<p><code>set texts=0 1 2 3 4 5 6 7 8 9<br />
</code></p>
<p>Mais ceci est fastidieux pour une police complète, et pour des raisons de programmation de l'application finale, il peut être utile de nommer les fichiers d'après le code ASCII de chaque caractère. Comme cette fonctionnalité n'est pas disponible dans le langage de commande Windows, il faut programmer ceci dans un langage évolué. Par exemple en LUA:</p>
<p><code>params="-background none -font Bauhaus-93 -pointsize 72 -density 300 -fill white -blur 0x5 "<br />
for i=32,167 do<br />
os.execute("convert.exe "..params.."label:"..string.char(i).." "..i..".png")<br />
end</code></p>
<p>Ces 2 lignes génèrent automatiquement 130 fichiers de belles lettres prêtes à être utilisées comme textures dans votre jeu. A noter que ces fichiers pèsent déjà 10 Mb au total, soit plus que l'exécutable d'ImageMagick : il peut donc être intéressant d'inclure ImageMagick à votre produit et de l'utiliser pour créer les polices nécessaires lors de l'installation plutôt que d'alourdir votre distribution...</p>
<p>Enfin, si vous trouvez les polices ci-dessus un peu trop carrées, visitez <a href="http://www.imagemagick.org/Usage/fonts/" target="_blank">cette page</a> qui vous donnera une petite idée des effets possibles, et explorez <a href="http://www.imagemagick.org/Usage/" target="_blank">celle-ci</a> pour une vision plus complète.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Create a PDF from an image]]></title>
<link>http://xrunhprof.wordpress.com/?p=327</link>
<pubDate>Wed, 23 Apr 2008 16:42:31 +0000</pubDate>
<dc:creator>xrunhprof</dc:creator>
<guid>http://xrunhprof.wordpress.com/?p=327</guid>
<description><![CDATA[Until now I was using the Page Scaling feature of acrobat reader to print PDF file with pages of ran]]></description>
<content:encoded><![CDATA[<p>Until now I was using the <cite>Page Scaling</cite> feature of <cite>acrobat reader</cite> to print PDF file with pages of random size. I'am creating such PDF with Imagemagick:<br />
<code>convert myimage.png myimage.pdf</code><br />
The drawbacks of this dirty methods are:</p>
<ul>
<li>All pages are extend to fit the full page, which is not always what you wants</li>
<li>You may want to print from a tool which does not have the <cite>Page Scaling</cite> feature.</li>
</ul>
<p>There is a solution in the <a href="http://www.imagemagick.org/script/command-line-options.php">Imagemagick documentation</a>:<br />
<code>convert -units PixelsPerInch -density 150x150 myimage.png mypdf.pdf</code></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Forging wallpapers ...]]></title>
<link>http://icebreaker.wordpress.com/?p=161</link>
<pubDate>Sat, 12 Apr 2008 22:16:55 +0000</pubDate>
<dc:creator>icebreaker</dc:creator>
<guid>http://icebreaker.wordpress.com/?p=161</guid>
<description><![CDATA[Recently I bought a nice 19&#8242; wide LCD monitor with an 1440&#215;900 resolution, so I quickly s]]></description>
<content:encoded><![CDATA[<p>Recently I bought a nice 19' wide LCD monitor with an 1440x900 resolution, so I quickly setup <strong>Twinview</strong> between my laptop running at 1280x800 and obviously moved down the first screen by 100 pixels, to achieve the same effect as "Extend my ..." Wind0ze.</p>
<p>Everything was fine, until I wanted to set a wallpaper, and it hurt my eyes ... duhh, it was horible ... stretched between the two screens. yuck!</p>
<p>The wallpapers designed for dual monitors assume that both have the same height, which obviously wasn't my case ... so the only viable solution was to create my own wallpaper by arranging two images in GIMP.</p>
<p>I like to have the same wallpaper on both screens, so that wasn't a problem, but it was rather annoying after trying 2-3 wallpapers.</p>
<p>Instead I thought of the nice utility package called "ImageMagick" ... Yay! and wrote a nice little bash script to generate the desired wallpaper from two images given as input.</p>
<p>Here is the contents of the script:</p>
<p><em>#!/bin/bash</em></p>
<p><em>if [ $# -ne 3 ] ; then<br />
echo "Usage: $0 image1.png image2.png outimage.png"<br />
exit 13<br />
fi</em></p>
<p><em>convert -size <strong>2720x900</strong> xc:<strong>black</strong> "$1" -geometry <strong>+0+100</strong> -composite "$2" -geometry <strong>+1280+0</strong> -composite "$3"</em></p>
<p><em>echo "Done ..."<br />
exit 1</em></p>
<p>I named it "mkwlp" , made it executable (chmod u+x mkwlp) then copied it into /usr/bin for convenience ...</p>
<p>This can be customized for other resolutions, etc and it's fairly straight forward so i won't go into this.</p>
<p>(I highlighted the customizable parts for convenience)</p>
<p>Voilà!!!</p>
<p>Here are a few wallpapers i "forged" with this little script :) Enjoy! (click to see the bigger version)</p>
<p><a href="http://icebreaker.wordpress.com/files/2008/04/rihanna_wall1.png"><img class="alignnone size-medium wp-image-162" src="http://icebreaker.wordpress.com/files/2008/04/rihanna_wall1.png?w=400" alt="" width="400" height="132" /></a></p>
<p><a href="http://icebreaker.wordpress.com/files/2008/04/rihanna_wall2.png"><img class="alignnone size-medium wp-image-163" src="http://icebreaker.wordpress.com/files/2008/04/rihanna_wall2.png?w=400" alt="" width="400" height="132" /></a></p>
<p><a href="http://icebreaker.wordpress.com/files/2008/04/arielle_wall1.png"><img class="alignnone size-medium wp-image-168" src="http://icebreaker.wordpress.com/files/2008/04/arielle_wall1.png?w=400" alt="" width="400" height="132" /></a></p>
<p><a href="http://icebreaker.wordpress.com/files/2008/04/rihanna_wall3.png"><img class="alignnone size-medium wp-image-164" src="http://icebreaker.wordpress.com/files/2008/04/rihanna_wall3.png?w=400" alt="" width="400" height="132" /></a></p>
<p><a href="http://icebreaker.wordpress.com/files/2008/04/swanepoel_wall1.png"><img class="alignnone size-medium wp-image-165" src="http://icebreaker.wordpress.com/files/2008/04/swanepoel_wall1.png?w=400" alt="" width="400" height="132" /></a></p>
<p><a href="http://icebreaker.wordpress.com/files/2008/04/elisha_wall1.png"><img class="alignnone size-medium wp-image-166" src="http://icebreaker.wordpress.com/files/2008/04/elisha_wall1.png?w=400" alt="" width="400" height="132" /></a></p>
<p><a href="http://icebreaker.wordpress.com/files/2008/04/angelina_wall1.png"><img class="alignnone size-medium wp-image-167" src="http://icebreaker.wordpress.com/files/2008/04/angelina_wall1.png?w=400" alt="" width="400" height="132" /></a></p>
<p>Oh, I almost forgot to tell that <a title="Click to visit!" href="http://www.ewallpapers.eu" target="_blank">EWallpapers.eu</a> is my number #1 landing place when I'm looking for high resolution wide screen wallpapers ( but not only! ) and also <a title="Click to visit!" href="http://www.hollywooddesktop.com/" target="_blank">Hollywood Desktop</a>.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Google Maps/Ontario Weather Radar Mash Up...]]></title>
<link>http://kiergsmith.wordpress.com/?p=3</link>
<pubDate>Tue, 08 Apr 2008 04:43:39 +0000</pubDate>
<dc:creator>locksmith</dc:creator>
<guid>http://kiergsmith.wordpress.com/?p=3</guid>
<description><![CDATA[Note - Links have been removed because of updates&#8230;
So after much humming and hawing, I&#8217;v]]></description>
<content:encoded><![CDATA[<p><em>Note - Links have been removed because of updates...</em></p>
<p>So after much humming and hawing, I've finally sat down to complete my first Google Maps mashup.  I had the idea a while back to drop the Environment Canada weather radar on top of Google maps to give my weather viewing some context.  And a while back I cranked up a script to grab the radar image for my local transmitter (near Exeter, ON) and put it into ForecastFox Enhanced.</p>
<p>As it turned out, getting access to the Google Maps API and setting up a base map page was incredibly easy.  A quick look into the Google Maps documentation and they even provided me with sample code to set up my first page.  Then into the specifics of setting up overlays on Google Maps, and I'd be all set.  Or so I thought.</p>
<p><!--more-->I was using the GGroundOverlay object in GM (Google Maps) to drop my first test image on a map, and it worked great.  So I thought I'd add a few more images to test out the local radar overlaps.  It did not work.  In fact, after much Javascript tweaking and re-ordering, I came to the following conclusion: GGroundOverlay is set up to work with ONE image only.  Creating a second overlay either was completely invisible, or it broke the GM Javascript.</p>
<p>At this point, I decided to take a break from the web side, and look at how to handle the radar images.  Give myself a break, as it were.  So I made sure I had up to date copies of ImageMagick on my machine and my test server, and broke out the graphics editor hat.  For those of you who have not used ImageMagick before, it is an incredibly powerful command line image editor.  I would hazard a guess that 50% of workflow on Photoshop could be done in Imagemagick.  Simply put, it rocks.  In the case I forsaw, I would retrieve the radar images from the Enviroment Canada weather site, trim them down and remove extraneous colours and details.  And thats just about the process that occurred.</p>
<p>The biggest trick with IM (ImageMagick) is to attempt to do the whole job on one command line.  This prevents having to save temp image files, which will cost time lost in disk access and possible in quality of the image.  That said, IM can only handle so many steps before it gets lost.  The second complication, one I brought upon myself, is that radar images are in fact circular, so I only wanted to display the circular data area.</p>
<p>This led to probably my most frustrating time of the whole project.  Simply put, I built an image the same size as the whole radar image from the web, cut out a circle where I wanted it, and filled the circle with the radar image.  This gave me a black image, with a circular image centered over the radar site.  Judicious cropping and colour removal, final application of transparency, and I had a .GIF to use for GM.  As a side note, Enviroment Canada's decision to make the radar image a 256 colour .GIF image and basically defining 1 pixel = 1 km made my job very easy.</p>
<p>This is where the only major flaw kept cropping up.  When drawing the circle, IM kept antialiasing the edge to make it look nice, but when I removed colours, the nasty shades of grey defining the edge of the circle stayed around.  I think I spent around three hours digging through the IM website until I finally tripped across the reference to the <em>+antialias</em> command.   With this enabled, no grey edging, and the radar circles came out perfectly.</p>
<p>For those interested, here's the IM command line as it ended up.  It generates a 400 pixel square image with a active 400 pixel circle visible in the middle, set at 25% opacity using PNG alpha channel transparency.</p>
<blockquote><p>convert +antialias -size 580x480 xc:black -tile radar.gif -draw 'circle 240,239 240,39' -fill black -opaque white -opaque \#999966 -opaque \#333366 -crop 401x401+140+139 -transparent black -matte -channel A -evaluate divide 1.25 output.png</p></blockquote>
<p>Not to fetch the images.  Lucky for me, Environment Canada builds the radar pages from a generated stream of  data.  Be researching the actual call signs of the transmitters in Wikipedia, and careful examination of the radar website, I developed a script that would <em>wget</em> the webpages, parse them with regex's and then <em>wget</em> the radar images.  A bit of research later, and some brushing up on BASH scripting, I now had a script easily configurable to get two or twenty images from the web.  I then blended the IM script into it, and set it to copy the finished image products to my servers web share.</p>
<p>This led me back to how to display more than one image at a time in GM.  About a month ago, I downloaded Google Earth on my Win partition again, and was rediscovering the fun of that app.  Along with starting to upload photos to Panoramio, I discovered the XML structure used in Google Earth KML files.  They supported multi-overlays with no problems, so I thought I'd build a Google Earth KML for the radar as a proof-of-type.</p>
<p>While researching the KML structure, I found the Google Maps Blog, and found that since the summer of 2007, GM supports some KML functions.  If the KML (or KMZ; a zipped KML) is web accessible, you can type it into the GM search function, and it will display the KML over Google Maps.  Here was all the tools I needed to finalize my Radar-over-Google Maps mashup.</p>
<p>My first KML in fact was a simple point declaration of all the Weather Radar transmitters in Ontario, verified and checked between Google Maps, Natural Resources of Canada topo maps and Environment Canada's own website.</p>
<p><span style="text-decoration:line-through;"><a title="Ontario Weather Radars" href="http://maps.google.ca/" target="_blank">Ontario Weather Radar Sites in Google Maps</a></span></p>
<p>Using these verified locations, I build a spreadsheet that calculated the accurate Latitude/Longitude for a 400 km box around these stations, and used it to define the four sides of the display box for each weather radar image.</p>
<p>Combining this information with my previous KML file, I now had an accurate weather radar overlay displayable in Google Earth or in Google maps.</p>
<p><span style="text-decoration:line-through;">Ontario Weather Radar KMZ</span></p>
<p><span style="text-decoration:line-through;"><a title="Ontario Weather Radar" href="http://maps.google.ca/" target="_blank">Ontario Weather Radar in Google Maps</a></span></p>
<p>Watch this space!  There will be improvement and development forthcoming.</p>
<p>kgs</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Redimensionando fotos pelo terminal com o ImageMagick]]></title>
<link>http://jonathasonline.wordpress.com/?p=39</link>
<pubDate>Sat, 29 Mar 2008 20:59:29 +0000</pubDate>
<dc:creator>Jonathas Rodrigues</dc:creator>
<guid>http://jonathasonline.wordpress.com/?p=39</guid>
<description><![CDATA[Aqui vai uma dica rápida.
Situação:
&nbsp;&nbsp;&nbsp;&nbsp;Você acabou de chegar da festa de um]]></description>
<content:encoded><![CDATA[<p>Aqui vai uma dica rápida.</p>
<p><b>Situação:</b><br />
&#160;&#160;&#160;&#160;Você acabou de chegar da festa de um amigo, com a câmera lotada de fotos, mas as fotos estão com resolução de 2000 e pouco por 1000 e pouco, e mais de 3MB de tamanho. Você gostaria de redimensioná-las pra 1024x768, ou qualquer outro tamanho menor, pra poder ficar melhor pra mandá-las por e-mail pra outros amigos.<br />
&#160;&#160;&#160;&#160;Como a câmera está lotada de fotos, você teria que abrir o GIMP, por exemplo, e ir abrindo foto por foto, e redimensionando. Concorda que isso é muito trabalhoso?</p>
<p>&#160;&#160;&#160;&#160;Existe uma forma de redimensionar as fotos pelo terminal, usando o programa imagemagick.</p>
<p>&#160;&#160;&#160;&#160;Se não estiver instalado no seu PC, faça a instalação do mesmo, com o comando<br />
<b> # aptitude install imagemagick</b></p>
<p>&#160;&#160;&#160;&#160;Agora, é só, pelo terminal, ir até o diretório onde você copiou as fotos, no seu HD, e dar o comando<br />
<b>$ convert -resize 1024x768 nomedafoto.jpg fotoredimensionada.jpg </b></p>
<p>&#160;&#160;&#160;&#160;Para fazer isso com todas as fotos de uma vez só, é só ir intercalando os comandos, usando ponto e vírgula "<b>;</b>"</p>
<p>&#160;&#160;&#160;&#160;O comando acima, iria ficar, por exemplo:<br />
<b>$ convert -resize 1024x768 nomedafoto00.jpg fotoredimensionada00.jpg;convert -resize 1024x768 nomedafoto01.jpg fotoredimensionada01.jpg</b> (e etc.)</p>
<p>&#160;&#160;&#160;&#160;No <a href="http://www.imagemagick.org/" target="_blank">site do ImageMagick</a>, você pode encontrar mais informações sobre o uso do programa.</p>
<p>Até a próxima.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[ImageMagick piezīmes]]></title>
<link>http://blackhalt.wordpress.com/?p=349</link>
<pubDate>Tue, 18 Mar 2008 11:33:42 +0000</pubDate>
<dc:creator>BlackHalt</dc:creator>
<guid>http://blackhalt.wordpress.com/?p=349</guid>
<description><![CDATA[ ImageMagick ir tāda laba bilžu veidošanas, apstrādes programma bez GUI (nav un viss). Mašina z]]></description>
<content:encoded><![CDATA[<p><img src="http://blackhalt.wordpress.com/files/2008/03/imagemagick-logo.png" alt="ImageMagick logo" align="left" hspace="10" /><a href="http://www.imagemagick.org/" title="Convert, Edit, and Compose Images"> ImageMagick</a> ir tāda laba bilžu veidošanas, apstrādes programma bez GUI (nav un viss). Mašina zverj! Prasītos gan tur kaut kāds GUI, citādi konsolē jādrukā pagari kodi.</p>
<p>Es pirmo reiz tā ilgāk papētīju šo programmu. Dažas koda piezīmes. Lai nav atkal jāmeklē. Var pierakstīt uz lapiņas. Šī ir publiskā lapiņa.</p>
<p>Zemāk kods samazina bildes. Uztaisa PNG thumbnails 200 px platumā. Augstums tiek rēķināts proporcionāli platumam. Tā viņi dara, ja nav norādīta augstuma vērtība. Gatavās bildes iekopē thumbnails direktorijā. Lielās bildes netiek sabojātas, thumbnails direktorijai jābūt iepriekš izveidotai. Viss notiek working direktorijā, tas ir direktorijā, kur tu pašlaik ar konsoli atrodies, piemēram, /home/bh. Nu un tālāk tik maģija. Ir arī tāds -auto-orient, -quality un kas tik vēl.</p>
<p><code>mogrify -path thumbnails -thumbnail 200x *.png</code></p>
<p>Tas pats, tikai thumbnails bildes tiek uzģenerētas JPG formātā.</p>
<p><code>mogrify -format jpg -path thumbnails -thumbnail 200x *.png</code></p>
<p>Vienas bildes samazināšana par 50%.</p>
<p><code>convert a.png -resize 50% a.png</code></p>
<p>Šis te ImageMagick kods man atgādina manu ņemšanos ar PHP + GD.<br />
Ko tas dara? Izmanto baltu fonu, melnus georgia fonta 12 izmēra burtus, 320 px platu bildi. Bildes augstums atkarīgs no teksta garuma. Teksts, kas neieet norādītajā platumā un jaunrindes tiek pārnestas uz jaunu bildes rindu, līniju. Uzzīmē borderu, rāmīti 2 px (pieskaita klāt), ielasa teksts.txt faila saturu, ko izmantos, lai uzdrukātu uz bildes tekstu. Izveido bildi caption-1.png<br />
teksts.txt failā iepriekš jālikvidē pēdējās rindas jaunrinde, citādi izveidos papildus rindiņu, līniju.</p>
<p><code>convert -background white -fill black \<br />
-font georgia.ttf -pointsize 12 -size 320x \<br />
-bordercolor white -border 2 \<br />
caption:@teksts.txt caption-1.png</code></p>
<p><img src="http://blackhalt.wordpress.com/files/2008/03/caption-1.png" alt="ImageMagick teksts" /></p>
<p>Līdzīgi. Tikai burtu lielums 16. Skumju krāsa, jeb kāda tur krāsa.</p>
<p><code>convert -background white -fill blue \<br />
-font georgia.ttf -pointsize 16 -size 320x \<br />
-bordercolor white -border 2 \<br />
caption:@teksts.txt caption-2.png</code></p>
<p><img src="http://blackhalt.wordpress.com/files/2008/03/caption-2.png" alt="ImageMagick teksts" /></p>
<p>Mazliet advancētākas krāsas. Ielasa lv.txt failu, kas ir UTF-8 kodējumā.</p>
<p><code>convert -background snow -fill '#f00' \<br />
-font georgia.ttf -pointsize 14 -size 320x \<br />
-bordercolor snow -border 2 \<br />
caption:@lv.txt caption-3.png</code></p>
<p><img src="http://blackhalt.wordpress.com/files/2008/03/caption-3.png" alt="ImageMagick teksts" /></p>
<p>Līdzīgi. Izmanto caurspīdīgu fonu.</p>
<p><code>convert -background none -fill indigo \<br />
-font georgia.ttf -pointsize 16 -size 320x \<br />
-bordercolor none -border 2 \<br />
caption:@lv.txt caption-4.png</code></p>
<p><img src="http://blackhalt.wordpress.com/files/2008/03/caption-4.png" alt="ImageMagick caurspīdīgs fons" /></p>
<p>Mācāmies debesspuses angļu valodā (southeast). Drukājam parakstu uz bildes.</p>
<p><code>convert a.png -font georgia.ttf -pointsize 28 -gravity southeast \<br />
-stroke '#000C' -strokewidth 2 -annotate +10+0 'BlackHalt' \<br />
-stroke none -fill white -annotate +10+0 'BlackHalt' \<br />
a.png</code></p>
<p><img src="http://blackhalt.wordpress.com/files/2008/03/a.png" alt="ImageMagick paraksts" /></p>
<p>Kaut kāds teksta, burtu caurspīdīgums. Krāsas caurspīdīgumu nosaka tas ceturtais krāsas cipars.</p>
<p><code>convert b.png -font georgia.ttf -pointsize 72 -gravity southeast \<br />
-stroke '#0003' -fill '#0001' -strokewidth 2 -annotate +10+0 'BlackHalt' \<br />
-stroke none -fill '#fff8' -annotate +10+0 'BlackHalt' \<br />
b.png</code></p>
<p><img src="http://blackhalt.wordpress.com/files/2008/03/b.png" alt="ImageMagick krāsas caurspīdīgums" /></p>
<p>Ja, kodos wordpress apostofu partaisa par nezinko (‘′’), to nezinko jārepleiso pret apostrofu :/</p>
<p>Ja radīsies interesanti kodi, tad te ierakstīšu vēl. Varbūt.</p>
<p>http://en.wikipedia.org/wiki/ImageMagick<br />
http://www.imagemagick.org/Usage/<br />
http://www.imagemagick.org/script/command-line-options.php<br />
http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi<br />
ImageMagick Tricks - Web Image Effects From The Command Line And PHP (2006).pdf<br />
un es.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Installazione di Ruby on Rails in Leopard]]></title>
<link>http://gabrieletassoni.wordpress.com/?p=66</link>
<pubDate>Sun, 02 Mar 2008 13:59:47 +0000</pubDate>
<dc:creator>Gabriele Tassoni</dc:creator>
<guid>http://gabrieletassoni.wordpress.com/?p=66</guid>
<description><![CDATA[Con l&#8217;uscita di Leopard, Apple ufficializza il supporto a RoR, inserendolo direttamente nell]]></description>
<content:encoded><![CDATA[<p>Con l'uscita di <a href="http://www.apple.com/macosx/">Leopard</a>, <a href="http://www.apple.com/">Apple</a> ufficializza il supporto a RoR, inserendolo direttamente nell'installazione base del proprio OS.<br />
Per avere una installazione un po' più completa, basta aggiungere MySQL, vediamo come rendere la nostra Leopard Box, una perfetta piattaforma per lo sviluppo in RoR.</p>
<p><strong>N.B.</strong> Si suppone installato il pacchetto Xcode, installabile dal DVD di Leopard!</p>
<h2>Verifica dell'installazione di Ruby e Rails</h2>
<p>Per verificare se effettivamente ruby e rails sono installati, basta lanciare questo comando:</p>
<pre>
ruby -v; rails -v
</pre>
<p>Che nel mio caso restituisce:</p>
<pre>
ruby 1.8.6 (2007-06-07 patchlevel 36) [universal-darwin9.0]
Rails 1.2.3
</pre>
<p>... 1.2.3? ... vecchiotto... la stabile è ora la 2.0.2... vabbè, rimediamo, intanto aggiorniamo il sistema gem e poi lanciamo un aggiornamento di tutte le gemme presenti già nel sistema, l'aggiornamento di rails però non installa la nuova gemma, tipica delle installazioni di rails v2, chiamata activeresources, installeremo anche quella:</p>
<pre>
sudo gem update --system
sudo gem update
sudo gem install activeresource
</pre>
<p>Hmmmm! Manca una gemma che può rendersi molto utile durante lo sviluppo di applicazioni: rmagick! Che però dipende da imagemagick, vediamo come installare entrambi.</p>
<h2>Installazione di MacPorts</h2>
<p><a href="http://www.macports.org/">MacPorts</a> è un grande repository di software Linux portati a Mac, è una risorsa molto potente, in quanto rende disponibile in maniera semplice (e piuttosto familiare per un utente Debian/Ubuntu, anche se concettualmente è più simile al sistema <a href="http://www.gentoo.org/">Gentoo</a>) un vastissimo parco di programmi utili, come ad esempio nmap... quale amministratore di rete potrebbe farne a meno? ^_^<br />
Bene, dopo il pistolotto iniziale, installiamo macports scaricando il dmg per Leopard e lanciando la solita installazione... (Ci mette un bel po', non preoccupatevi, macports si sta compilando per il vostro sistema...).<br />
Per rendere più semplice la navigazione e la scelta dei pacchetti, si può installare anche <a href="http://porticus.alittledrop.com/index.html">porticus</a>, una specie di package manager... una GUI per l'accesso al repository di macports.<br />
Ah! non dimenticate di dire a bash dove trovare l'eseguibile di port, pena il dover continuamente dare il percorso completo da riga di comando (I'm so lazy...), quindi aggiungete queste righe al file <strong>.bash_profile</strong></p>
<pre>
export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
</pre>
<p>E chiudete (<strong>Command+q</strong>) e riaprite il terminale!</p>
<h2>Installazione di Rmagick</h2>
<p>Semplice... usate porticus o più velocemente copiate e incollate questi comandi nel terminale:</p>
<pre>
sudo port install tiff -macosx
sudo port install ImageMagick
sudo gem install rmagick
</pre>
<p>Anche qui, port non fa altro che rendere abbastanza trasparente la compilazione del pacchetto, preoccupandosi delle fasi preliminari di configurazione della sorgente, questo però implica che l'installazione sia un po' lunga, in quanto deve compilare anche tutte le dipendenze mancanti nel sistema per quel determinato pacchetto.</p>
<h2>Installazione di MySQL</h2>
<p>Alla data di questo howto è finalmente disponibile un <a href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg">package DMG</a> ufficiale per Leopard (Mac OS X 10.5), io ho scelto la versione per x86_64, d'altronde questo OS è a tutti gli effetti un OS a 64bit, no? Una volta finito il download, viene montato automaticamente il dmg, presentandoci due pkg (uno è il DB vero e proprio, l'altro è l'aggiunta alle applicazioni in startup automatico) e un prefPane, installiamoli tutti.<br />
MySQL viene installato in <strong>/usr/local/mysql</strong>, la socket è in /tmp/mysql.sock e lo startup item in <strong>/usr/local/MySQLCOM</strong>.</p>
<p><a href="http://blog.tomatocheese.com/archives/2007/11/1/migrating_mysql_to_mac_os_x_leopard/">L'avvio automatico</a> è affidato a launchctl, perciò, basta creare un file chiamato /Library/LaunchDaemons/com.mysql.mysqld.plist:</p>
<pre>
&#60;?xml version="1.0" encoding="UTF-8"?&#62;
&#60;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"&#62;
&#60;plist version="1.0"&#62;
&#60;dict&#62;
	&#60;key&#62;KeepAlive&#60;/key&#62;
	&#60;true/&#62;
	&#60;key&#62;Label&#60;/key&#62;
	&#60;string&#62;com.mysql.mysqld&#60;/string&#62;
	&#60;key&#62;Program&#60;/key&#62;
	&#60;string&#62;/usr/local/mysql/bin/mysqld_safe&#60;/string&#62;
	&#60;key&#62;RunAtLoad&#60;/key&#62;
	&#60;true/&#62;
&#60;/dict&#62;
&#60;/plist&#62;
</pre>
<p>Proviamolo lanciando questo comando: <strong>sudo launchctl load /Library/LaunchDaemons/com.mysql.mysqld.plist</strong></p>
<p>Ora dovrebbe funzionare, priviamo a riavviare per vedere se parte in automatico!</p>
<p><a href="http://www.sosullivan.net/using-mysql-on-a-leopard-105-mac">Sean O'Sullivan</a> consiglia di creare, per comodità, un alias nel file delle risorse della shell, quindi aggiungete queste righe al file <strong>.bash_profile</strong> (e poi riavviate il terminale):</p>
<pre>
alias start_mysql="sudo /usr/local/MySQLCOM/MySQLCOM start"
alias stop_mysql="sudo /usr/local/MySQLCOM/MySQLCOM stop"
alias restart_mysql="sudo /usr/local/MySQLCOM/MySQLCOM/MySQLCOM restart"
</pre>
<p>Come noterete, lanciando il comando <em>mysql</em>, la shell non lo trova, va aggiunto al file delle risorse della shell, in modo che sappia dove trovarlo, questo si può fare con questo comando da, aggiungere al file <strong>.bash_profile</strong> (e poi riavviate il terminale):</p>
<pre>
alias mysql="/usr/local/mysql/bin/mysql"
alias mysqladmin="/usr/local/mysql/bin/mysqladmin"
</pre>
<p>Ed ora installiamo la gemma:</p>
<pre>
sudo su -
ARCHFLAGS='-arch x86_64' gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
install_name_tool -change /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib /usr/local/mysql/lib/libmysqlclient.15.dylib /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle
</pre>
<p><strong>Annotazione personale</strong>... Hmmmmm! A chi mi dice che GNU/Linux è difficile, farò leggere questo paragrafo... O__O Da utente sia MAC che <a href="http://www.ubuntu.com">Ubuntu</a>, posso dirvi che nella mia derivata <a href="http://www.debian.org">Debian</a> preferita, bastava aprire il gestore di pacchetti, cercare mysql server e installarlo... 3 click... 3 diavolo di click... O_O</p>
<p>And... <strong>That's all folks!</strong> ^_^</p>
]]></content:encoded>
</item>

</channel>
</rss>
