<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns='http://www.w3.org/2005/Atom'>

	<id>http://kaiteki-rich.com/modules/pip_php/</id>
	<updated>2009-01-08T07:28:27+0900</updated>
	<title type='text'>副業金持ち生活 - 副業PHP最新RSS</title>
	<link rel='alternate' type='text/html' href='http://kaiteki-rich.com/'></link>
	<link rel='self' type='application/atom+xml' href='http://kaiteki-rich.com/modules/pip_php/index.php?page=xml&amp;style=atom&amp;pipe_id='></link>
	<author><name>ネットで稼ぐサラリーマン内職</name></author>
	<generator>XOOPS - d3pipes</generator>

	
	<entry>
		<id>http://www.phppro.jp/qa/1768</id>
		<published>2009-01-06T19:32:16+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>セッションを破棄する方法</title>
		<content type='html'>以下のようにセッションを破棄しようとしましたが、 
セッションが残ったままになっているようです。 
 
セッションを正しく破棄する方法を教えてください。 
 
   $_SESSION[&amp;quot;loginflag&amp;quot;]&amp;nbsp;=&amp;nbsp;&amp;quot;&amp;quot;;  
  &amp;nbsp;  
  if&amp;nbsp;(!isset($_SESSION[&amp;quot;loginflag&amp;quot;]))&amp;nbsp;{  
  &amp;nbsp;&amp;nbsp;print&amp;nbsp;&amp;quot;セッション無し&amp;quot;;&amp;nbsp;//こちらを通りたい  
  }else{  
  &amp;nbsp;&amp;nbsp;print&amp;nbsp;&amp;quot;セッション有り&amp;quot;;&amp;nbsp;//こちらを通ってしまいます  
  }    
よろしくお願いします。</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/qa/1768'></link>
			</entry>
	
	<entry>
		<id>http://www.phppro.jp/news/597</id>
		<published>2009-01-06T15:16:19+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>PHPプロ！Weekly PEAR リリース @ 09/01/06号</title>
		<content type='html'>PHPプロ！Weekly PEARリリースでは、前週からの１週間にリリースされたPEARパッケージを、毎週まとめてご紹介します。
本記事では、12月30日から01月06日までの間にリリースされたパッケージ一覧を掲載しています。</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/news/597/rss'></link>
			</entry>
	
	<entry>
		<id>http://www.phppro.jp/qa/1767</id>
		<published>2009-01-06T14:08:32+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>画像データＤＢ格納メリット</title>
		<content type='html'>こんにちは、 
ＰＨＰ５、ＭＹＳＱＬの環境で 
画像データの取り扱いの部分を勉強中なのですが、 
そのなかで、 
画像の格納方法に 
ＤＢにバイナリデータを保存する方法と 
特定フォルダに格納する方法と 
二通りあると思われるのですが、 
 
それぞれ、どうゆうメリットがあるのだろうか？と 
思いまして、メリットや、こうゆうサイトに使えるような 
情報などありましたらお願い致します。 
 
個人的には、下記のような感じたのですが、 
記述コードは、画像名や幅などＤＢで管理すれば 
あまり難しさに差がないように感じましたが。。 
 
ＳＢに格納の場合、セキュリティが向上するが 
データから画像として構築する分、処理に負荷がかかる 
 
フォルダ格納の場合、セキュリティが低下するが 
負荷が少ない</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/qa/1767'></link>
			</entry>
	
	<entry>
		<id>http://blog.asial.co.jp/510</id>
		<published>2009-01-05T19:34:22+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category>Tech</category>
		<title type='text'>続・Macを買ったらすぐインストールするアプリケーション</title>
		<content type='html'> 明けましておめでとうございます。熊谷です。あっという間に過ぎ去ったお正月休み、皆さんはいかがお過ごしでしょうか。今日から仕事始めの方が多いのではないのでしょうか。&lt;br /&gt;
&lt;br /&gt;
もう昨年のことになってしまいますが、またMacユーザに戻りました。MacBook Airで懲りたはずなんですが、やはりその魅力に負けてしまいアルミのMacBookを購入してしまいました。そんなことで、今回は私がMacを買ったらすぐインストールするアプリケーションを紹介します。&lt;a href=&quot;http://blog.asial.co.jp/350&quot;&gt;以前にも同じようなこと&lt;/a&gt;をやっていますが、ほぼ1年前のことになるので、そこでは触れなかった（もしくは新たな）アプリケーションを紹介します。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://mozilla.jp/thunderbird/&quot;&gt;Thunderbird&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;/read_file.php?id=631&amp;mode=1&quot; rel=&quot;lightbox&quot; class=&quot;link-lightbox&quot;&gt;&lt;img src=&quot;http://blog.asial.co.jp/read_file.php?id=631&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
以前はOSX標準のMail.appを使用していたのですが、使い難いというかやはり使い慣れたメーラーが一番ということでこれに戻ってきました。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.adobe.com/jp/products/photoshoplightroom/&quot;&gt;Adobe Photoshop Lightroom&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;/read_file.php?id=635&amp;mode=1&quot; rel=&quot;lightbox&quot; class=&quot;link-lightbox&quot;&gt;&lt;img src=&quot;http://blog.asial.co.jp/read_file.php?id=635&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
写真管理ソフトとでもいいましょうか。最近写真はrawで撮るようにしているのでその現像はこれを使用しています。また、&lt;a href=&quot;http://regex.info/blog/lightroom-goodies/flickr&quot;&gt;Flickrにアップロードするプラグイン&lt;/a&gt;があるのでそれとの組み合わせがとても使いやすいです。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.justsystems.com/jp/products/atokmac/&quot;&gt;ATOK 2008&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;/read_file.php?id=634&amp;mode=1&quot; rel=&quot;lightbox&quot; class=&quot;link-lightbox&quot;&gt;&lt;img src=&quot;http://blog.asial.co.jp/read_file.php?id=634&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
日本語入力はやはりこれでしょう。定番中の定番ですね。早くWindows版にあるATOKダイレクトAPIが実装されないかなと思ってます。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://yatsu.info/articles/2008/02/29/inputhiliter-2-0%E3%82%92%E5%85%AC%E9%96%8B&quot;&gt;InputHilitter&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;/read_file.php?id=632&amp;mode=1&quot; rel=&quot;lightbox&quot; class=&quot;link-lightbox&quot;&gt;&lt;img src=&quot;http://blog.asial.co.jp/read_file.php?id=632&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Windowsのときは当たり前だった日本語入力時に変換中の文字列を色付けしてくれるものです。「ことえり」や「ATOK」で変換しているとその文字列に下線が引かれるだけで、場合によっては文節の区切りがわかりにくくなります。これをインストールするとWindowsの時と同じように文字列に背景色がつくのでわかりやすくなります。ただ、その仕組み上Cocoaアプリケーションにしか効きません。でも、これがあるとないとでは、視認性が全然違います。必須。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://code.google.com/p/macvim/&quot;&gt;MacVim&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;/read_file.php?id=633&amp;mode=1&quot; rel=&quot;lightbox&quot; class=&quot;link-lightbox&quot;&gt;&lt;img src=&quot;http://blog.asial.co.jp/read_file.php?id=633&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
以前はターミナル（iTerm）上でvimを使用していたので今回も同じようにと思っていたのですが、GUIをCocoaにしてさらにMac用に機能を付け加えているMacVimを知り、使用してみたところなかなかいい感じ。何よりもCocoaでGUIが作られているというのが素晴らしいです。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://cruzapp.com/&quot;&gt;Cruz&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;/read_file.php?id=636&amp;mode=1&quot; rel=&quot;lightbox&quot; class=&quot;link-lightbox&quot;&gt;&lt;img src=&quot;http://blog.asial.co.jp/read_file.php?id=636&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://webkit.org/&quot;&gt;Webkit&lt;/a&gt;をベースにしたブラウザ。SafariでもプラグインをインストールすることによりFirefox並に機能を拡張することが出来ますが、これははじめからそれ並みの機能を持っています。セッションのリストアやユーザスクリプト等。しかも&lt;a href=&quot;http://lanaer.com/cruz-with-the-webkit-nightly&quot;&gt;こちらのサイトで公開されている方法&lt;/a&gt;を使用すると最新のWebkitを使用してこのブラウザを使うことができるので、&lt;a href=&quot;http://webkit.org/blog/197/web-inspector-redesign/&quot;&gt;Firebug並の新しいインスペクタ&lt;/a&gt;が使用できてさらに便利に。最近はこれとFirefoxを使い分けています。&lt;br /&gt;
&lt;br /&gt;
そんなことで、Macの世界に戻ってきました。文字はきれいで読みやすいし、何といっても新しいMacBookは速くて快適ですね！ </content>
				<link rel='alternate' type='text/html' href='http://blog.asial.co.jp/510'></link>
			</entry>
	
	<entry>
		<id>http://blog.asial.co.jp/510</id>
		<published>2009-01-05T19:34:22+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category>-</category>
		<title type='text'>続・Macを買ったらすぐインストールするアプリケーション</title>
		<content type='html'> またまたMacユーザに戻ったということで、以前紹介しなかった買ったらすぐインストールするアプリケーション紹介の第2弾です。 </content>
				<link rel='alternate' type='text/html' href='http://blog.asial.co.jp/510'></link>
			</entry>
	
	<entry>
		<id>http://www.phppro.jp/qa/1766</id>
		<published>2009-01-05T16:20:49+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>ページのナビゲーションでの配列の受け渡し</title>
		<content type='html'>$PAGESIZE件ごとにページ分け表示する際のページのナビゲーションについて、 
例えば、前のページに値($tcnt)をtcntという変数名で受け渡したいときは次のようにすると思います。このようにして配列を受け渡すことは可能ですか？ 
 
   //ページのナビゲーション  
  if&amp;nbsp;($page&amp;nbsp;&amp;gt;&amp;nbsp;1)&amp;nbsp;{  
  &amp;nbsp;&amp;nbsp;//2ページ以降の場合は[前]を表示します  
  &amp;nbsp;&amp;nbsp;$body&amp;nbsp;.=&amp;nbsp;&amp;quot;&amp;lt;a&amp;nbsp;href=&#039;$PHP_SELF?page=&amp;quot;.($page-1).&amp;quot;&amp;amp;tcnt=$tcnt&#039;&amp;gt;前の&amp;quot;.$PAGESIZE.&amp;quot;件&amp;lt;/a&amp;gt;&amp;quot;;  
  }    
$dis[]という変数名の多次元配列で中身は次のようになっています。 
Array&amp;nbsp;(&amp;nbsp;[0]&amp;nbsp;=&amp;gt;&amp;nbsp;Array&amp;nbsp;(&amp;nbsp;[レシピNo.]&amp;nbsp;=&amp;gt;&amp;nbsp;10&amp;nbsp;[マッチ数]&amp;nbsp;=&amp;gt;&amp;nbsp;1&amp;nbsp;)&amp;nbsp;[1]&amp;nbsp;=&amp;gt;&amp;nbsp;Array&amp;nbsp;(&amp;nbsp;[レシピNo.]&amp;nbsp;=&amp;gt;&amp;nbsp;11&amp;nbsp;[マッチ数]&amp;nbsp;=&amp;gt;&amp;nbsp;1&amp;nbsp;)&amp;nbsp;) 
 
PHPは初心者です。よろしくお願いします。</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/qa/1766'></link>
			</entry>
	
	<entry>
		<id>http://www.phppro.jp/qa/1765</id>
		<published>2009-01-05T14:59:15+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>ランダム文字生成＋重複チェック</title>
		<content type='html'>コード用のランダム文字を生成し、以前登録されたデータに重複するコードがあれば再生成する、というPHPを作りたいと思っています。 
過去記事を探したところ、http://www.phppro.jp/qa/960にて、ほぼ私がやりたい事と同じ内容が回答されておりました。 
2番目に回答されたsignalさんのサンプルコードを使用させていただきました。 
 
「signalさんが書かれたコード」 
   function&amp;nbsp;make_passwd(&amp;nbsp;$length&amp;nbsp;)&amp;nbsp;{&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;$char&amp;nbsp;=&amp;nbsp;&#039;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&#039;;&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;$list&amp;nbsp;=&amp;nbsp;preg_split(&amp;nbsp;&#039;//&#039;,&amp;nbsp;$char,&amp;nbsp;-1,&amp;nbsp;PREG_SPLIT_NO_EMPTY&amp;nbsp;);&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;$rand&amp;nbsp;=&amp;nbsp;array_rand(&amp;nbsp;$list,&amp;nbsp;$length&amp;nbsp;);&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;$str&amp;nbsp;&amp;nbsp;=&amp;nbsp;&#039;&#039;;&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;foreach&amp;nbsp;(&amp;nbsp;$rand&amp;nbsp;as&amp;nbsp;$key&amp;nbsp;)&amp;nbsp;$str&amp;nbsp;.=&amp;nbsp;$list[$key];&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;return&amp;nbsp;$str;&amp;nbsp;  
  }&amp;nbsp;  
  function&amp;nbsp;get_passwd(&amp;nbsp;$conn,&amp;nbsp;$length&amp;nbsp;=&amp;nbsp;8&amp;nbsp;)&amp;nbsp;{&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;do&amp;nbsp;{&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$passwd&amp;nbsp;=&amp;nbsp;make_passwd(&amp;nbsp;$length&amp;nbsp;);&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$result&amp;nbsp;=&amp;nbsp;mysql_query(&amp;nbsp;&amp;quot;SELECT&amp;nbsp;upw&amp;nbsp;FROM&amp;nbsp;tablepw&amp;nbsp;WHERE&amp;nbsp;upw&amp;nbsp;=&amp;nbsp;&#039;$passwd&#039;&amp;quot;,&amp;nbsp;$conn&amp;nbsp;);&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$count&amp;nbsp;&amp;nbsp;=&amp;nbsp;mysql_num_rows(&amp;nbsp;$result&amp;nbsp;);&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;}&amp;nbsp;while(&amp;nbsp;$count&amp;nbsp;&amp;gt;&amp;nbsp;0&amp;nbsp;);&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;return&amp;nbsp;$passwd;&amp;nbsp;  
  }&amp;nbsp;  
  &amp;nbsp;&amp;nbsp;  
  $conn&amp;nbsp;=&amp;nbsp;mysql_connect(&amp;nbsp;$host,&amp;nbsp;$user,&amp;nbsp;$pw&amp;nbsp;);&amp;nbsp;  
  mysql_select_db(&amp;nbsp;$db,&amp;nbsp;$conn&amp;nbsp;);&amp;nbsp;  
  print&amp;nbsp;get_passwd(&amp;nbsp;$conn,&amp;nbsp;6&amp;nbsp;);    
要らないと思われる部分を削り、以下のコードで動作は確認できました。 
(重複チェックしているかは、まだなのですが･･･) 
 
「私が書いたコード」 
   //&amp;nbsp;DB接続  
  require_once(&#039;db_joint.php&#039;);  
  &amp;nbsp;  
  /*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;コード生成&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/  
  function&amp;nbsp;make_code($length)&amp;nbsp;{  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;$rdm_str&amp;nbsp;=&amp;nbsp;md5(uniqid(rand(),&amp;nbsp;true));&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;ランダム文字生成  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;$rdm_str&amp;nbsp;=&amp;nbsp;substr($rdm_str,0,6);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;生成文字を6文字に縮小  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;$today&amp;nbsp;=&amp;nbsp;date(&amp;quot;ymd&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;現在の年月日  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;$cp_code&amp;nbsp;=&amp;nbsp;&amp;quot;CP_&amp;quot;.$rdm_str.$today;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;コード生成  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;$cp_code;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;生成したコードを返す  
  }  
  &amp;nbsp;  
  /*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;生成コードの重複チェック&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/  
  function&amp;nbsp;get_code($length)&amp;nbsp;{  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;do&amp;nbsp;{  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$cp_code&amp;nbsp;=&amp;nbsp;make_code($length);  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$result&amp;nbsp;=&amp;nbsp;mysql_query(&amp;quot;SELECT&amp;nbsp;code&amp;nbsp;FROM&amp;nbsp;code_table&amp;nbsp;WHERE&amp;nbsp;code&amp;nbsp;=&amp;nbsp;&#039;$cp_code&#039;&amp;quot;);  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$count&amp;nbsp;&amp;nbsp;=&amp;nbsp;mysql_num_rows($result);  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;}  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;while($count&amp;nbsp;&amp;gt;&amp;nbsp;0);  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;$cp_code;  
  }  
  &amp;nbsp;  
  //&amp;nbsp;生成コード表示  
  print&amp;nbsp;get_code();    
上記に書いたPHPコードで、文法的には間違っていないでしょうか？ 
また文法以外にも、何か間違っているなどありましたら、教えていただきたいです。 
(コード自体理解しきれていないので、signalさんが書かれたコードを1行ずつ解説していただけると嬉しいです) 
よろしくお願いいたします。</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/qa/1765'></link>
			</entry>
	
	<entry>
		<id>http://www.phppro.jp/qa/1764</id>
		<published>2009-01-05T14:34:01+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>データベースの表示方法について</title>
		<content type='html'>mySQLデータベースにphpで接続し、一覧表示をさせるときに、基本、縦に一覧が表示されますが 
例えば横にも５列表示させる方法は有りますでしょうか？ 
 
写真とコメントのデータベースを表示させるのに、例えば横に５列、縦に５列の２５個を表示して、それ以上の場合はページングでページを変えたいと思っています。 
 
   &amp;lt;table&amp;gt;  
  &amp;lt;tr&amp;gt;  
  &amp;nbsp;&amp;nbsp;&amp;lt;td&amp;nbsp;rowspan=2&amp;gt;  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &amp;lt;?php  &amp;nbsp;  echo  &amp;nbsp;  $row  [  &amp;quot;  data1  &amp;quot;  ]  ;  ?&amp;gt;    
  &amp;nbsp;&amp;nbsp;&amp;lt;/td&amp;gt;  
  &amp;nbsp;&amp;nbsp;&amp;lt;td&amp;gt;  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &amp;lt;?php  &amp;nbsp;  echo  &amp;nbsp;  $row  [  &amp;quot;  data2  &amp;quot;  ]  ;  ?&amp;gt;    
  &amp;nbsp;&amp;nbsp;&amp;lt;/td&amp;gt;  
  &amp;lt;/tr&amp;gt;  
  &amp;lt;tr&amp;gt;  
  &amp;nbsp;&amp;nbsp;&amp;lt;td&amp;gt;  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &amp;lt;?php  &amp;nbsp;  echo  &amp;nbsp;  $row  [  &amp;quot;  data3  &amp;quot;  ]  ;  ?&amp;gt;    
  &amp;nbsp;&amp;nbsp;&amp;lt;/td&amp;gt;  
  &amp;lt;/tr&amp;gt;  
  &amp;lt;/table&amp;gt;    
例えば上記の場合、テーブルの形のまま、データが有るだけ下に表示されてしまいます。このテーブルの形を活かして横にも５列例えば表示させる様にするにはどのようにしたら良いのでしょう？ 
ご教授下さい。※テーブルやテーブルの形は例えです。</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/qa/1764'></link>
			</entry>
	
	<entry>
		<id>http://www.phppro.jp/qa/1763</id>
		<published>2009-01-05T02:03:22+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>チェックボックスの判別について教えてください。</title>
		<content type='html'>以下のようなソースでチェックボックスを表示させ$strに何を選んだのかまではできています。 
 
   &amp;lt;input&amp;nbsp;type=&amp;quot;checkbox&amp;quot;&amp;nbsp;name=&amp;quot;flag[]&amp;quot;&amp;nbsp;value=&amp;quot;1&amp;quot;&amp;nbsp;/&amp;gt;aaa  
  &amp;lt;input&amp;nbsp;type=&amp;quot;checkbox&amp;quot;&amp;nbsp;name=&amp;quot;flag[]&amp;quot;&amp;nbsp;value=&amp;quot;2&amp;quot;&amp;nbsp;/&amp;gt;bbb  
  &amp;lt;input&amp;nbsp;type=&amp;quot;checkbox&amp;quot;&amp;nbsp;name=&amp;quot;flag[]&amp;quot;&amp;nbsp;value=&amp;quot;3&amp;quot;&amp;nbsp;/&amp;gt;ccc  
  foreach&amp;nbsp;($_POST[&#039;flag&#039;]&amp;nbsp;as&amp;nbsp;$val)&amp;nbsp;{  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$str[]&amp;nbsp;=&amp;nbsp;$val;  
  }    
例えば1と3を選んだ場合 
 
   $str[0]&amp;nbsp;=&amp;gt;&amp;nbsp;1  
  $str[1]&amp;nbsp;=&amp;gt;&amp;nbsp;3    
となるのですがチェックしていない場合は常に0を配列に返し上記の例と同様に1と3を 
選んだ場合以下のような配列で返すにはどうすればいいのでしょうか？ 
 
   $str[0]&amp;nbsp;=&amp;gt;&amp;nbsp;1  
  $str[1]&amp;nbsp;=&amp;gt;&amp;nbsp;0  
  $str[2]&amp;nbsp;=&amp;gt;&amp;nbsp;3    
セレクトボックスであればvalueに0を入れれば済むので問題ないのですがチェックボックスの 
場合どうやっていいものか全くわからず悩んでおります。</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/qa/1763'></link>
			</entry>
	
	<entry>
		<id>http://www.phppro.jp/qa/1762</id>
		<published>2009-01-04T21:32:54+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>pear DBを使ってテーブルをトランケート</title>
		<content type='html'>タイトルの通りなのですが、pearのDBを使ってテーブルをトランケートしたいと思っているのですが、そもそも可能なのでしょうか？ 
検索してもうまくヒットしなかったので・・・</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/qa/1762'></link>
			</entry>
	
	<entry>
		<id>http://www.phppro.jp/qa/1761</id>
		<published>2009-01-03T12:49:15+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>imagickやpear-file_archiveからの書き込みで文字化け</title>
		<content type='html'>タイトルの通りなのですが、imagickから$image-&amp;gt;writeimage(～やfile_archiveからFile_Archive::extract(～で書き込まれるファイル名が日本語の場合文字化けしてしまっています。 
 
サーバのosはFreeBSDです。 
 
文字コードの問題だとは思うのですが、imagickやpearからの出力時に文字コードを指定する方法がみつかりませんorz 
 
もしご存じの方がいらっしゃいましたらご教授お願いいたします。</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/qa/1761'></link>
			</entry>
	
	<entry>
		<id>http://www.phppro.jp/qa/1760</id>
		<published>2009-01-02T03:36:36+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>ｓｍａｒｔｙ　ループ処理　多次元の場合</title>
		<content type='html'>こんにちは、 
ｓｍａｒｔｙのループ処理に関しまして 
$conectdata配列の内になる、userid,userpassの値を 
表に表示しようとしているのですが 
多次元構成の場合、loop処理機能で表示させる方法はありますでしょうか。 
 
 
$conectdata配列中身--------------------- 
Array&amp;nbsp;(&amp;nbsp;[0]&amp;nbsp;=&amp;gt;&amp;nbsp;OK&amp;nbsp; 
[1]&amp;nbsp;=&amp;gt;&amp;nbsp;Array&amp;nbsp;(&amp;nbsp;[userid]&amp;nbsp;=&amp;gt;&amp;nbsp;testuser&amp;nbsp;[userpass]&amp;nbsp;=&amp;gt;&amp;nbsp;testpass&amp;nbsp;)&amp;nbsp; 
[2]&amp;nbsp;=&amp;gt;&amp;nbsp;Array&amp;nbsp;(&amp;nbsp;[userid]&amp;nbsp;=&amp;gt;&amp;nbsp;1testuser&amp;nbsp;[userpass]&amp;nbsp;=&amp;gt;&amp;nbsp;testpass&amp;nbsp;)&amp;nbsp;)&amp;nbsp; 
 
テンプレート------------- 
&amp;lt;table&amp;nbsp;border=&amp;quot;3&amp;quot;&amp;gt;&amp;nbsp; 
		&amp;lt;tr&amp;gt; 
			&amp;lt;td&amp;gt;a&amp;lt;/td&amp;gt;&amp;nbsp; 
			&amp;lt;td&amp;gt;b&amp;lt;/td&amp;gt;&amp;nbsp; 
			&amp;lt;td&amp;gt;c&amp;lt;/td&amp;gt;&amp;nbsp; 
		&amp;lt;/tr&amp;gt; 
	{section&amp;nbsp;name=cnt&amp;nbsp;loop=$data1} 
		&amp;lt;tr&amp;gt; 
			&amp;lt;td&amp;gt;{$data1[cnt][userid]}&amp;lt;/td&amp;gt; 
			&amp;lt;td&amp;gt;{$data1[cnt][userpass]}&amp;lt;/td&amp;gt; 
			&amp;lt;td&amp;gt;{$data1[cnt][userid]}&amp;lt;/td&amp;gt; 
		&amp;lt;/tr&amp;gt; 
	{/section} 
&amp;lt;/table&amp;gt;&amp;nbsp; 
 
ＰＨＰ------------------- 
	$smarty-&amp;gt;assign(&amp;nbsp;&amp;#039;data1&amp;#039;&amp;nbsp;,&amp;nbsp;$conectdata);</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/qa/1760'></link>
			</entry>
	
	<entry>
		<id>http://www.phppro.jp/qa/1759</id>
		<published>2009-01-01T10:29:45+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>MySQLとQuickForm</title>
		<content type='html'>MySQLにフォームデータを格納し、スクリプトにアクセスされた際、そのデータを呼び出し、QuickFormでフォームを構成しています。 
 
その際、&amp;nbsp;foreachで&amp;nbsp;addelement&amp;nbsp;や&amp;nbsp;addRule　を適用しているのですが、&amp;nbsp;addRuleが上手く機能しません。 
 
 
   foreach($res&amp;nbsp;as&amp;nbsp;$value)  
  {  
  $f-&amp;gt;addelement($value[&#039;1&#039;].......);  
  $f-&amp;gt;addRule(.....);  
  }    
表示の際、入力必須の&amp;nbsp;＊　はcheckbox項目以外は問題なく表示されるのですが、checkboxだけ、&amp;nbsp;＊　が表示されません。 
また、addRuleを適用しているはずなのに、全て空白でsubmitを押しても問題なく処理されてしまいます。（本当はエラーをはき出さなければならないのですが） 
 
尚、 
   $f-&amp;gt;addElement(....);  
  $-&amp;gt;addRule(....)  
  ...   のように一つ一つ表記すれば問題なく処理されますので、QuickFormの問題ではありません。 
 
どうぞよろしくお願いします。</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/qa/1759'></link>
			</entry>
	
	<entry>
		<id>http://blog.asial.co.jp/509</id>
		<published>2008-12-25T17:47:17+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category>Tech</category>
		<title type='text'>linuxでリモートデスクトップ</title>
		<content type='html'> 今回は、rdesktopについて書いていきます。&lt;br /&gt;
&lt;br /&gt;
Windowsで遠隔操作と言えば、手軽に出来るリモートデスクトップが有名です。&lt;br /&gt;
XP以降デフォルトで入っているので手間をかけずにかつ、レスポンスも高速なのでかなり便利な機能ですが、&lt;br /&gt;
実はLinuxからでもrdesktopを使えばアクセスできます。&lt;br /&gt;
&lt;br /&gt;
それを実現するのが rdesktop(&lt;a href=&#039;http://www.rdesktop.org/)&#039;&gt;http://www.rdesktop.org/)&lt;/a&gt; です。&lt;br /&gt;
&lt;br /&gt;
インストールは、&lt;br /&gt;
&lt;br /&gt;
apt-get install rdesktop&lt;br /&gt;
&lt;br /&gt;
以上。&lt;br /&gt;
&lt;br /&gt;
使い方は、&lt;br /&gt;
&lt;br /&gt;
&lt;ol class=&quot;boxcode-main&quot;&gt;&lt;li&gt;rdesktop&lt;wbr /&gt;&amp;nbsp;サーバー名&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;
で、ログイン画面を表示出来ます。&lt;br /&gt;
&lt;br /&gt;
私の場合は、もう少しオプションを付加して、&lt;br /&gt;
&lt;br /&gt;
&lt;ol class=&quot;boxcode-main&quot;&gt;&lt;li&gt;rdesktop&lt;wbr /&gt;&amp;nbsp;192.168.100.100&lt;wbr /&gt;&amp;nbsp;-g&lt;wbr /&gt;&amp;nbsp;1680x1050&lt;wbr /&gt;&amp;nbsp;-u&lt;wbr /&gt;&amp;nbsp;&#039;hogedomain\\yuji&#039;&lt;wbr /&gt;&amp;nbsp;-K&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;
こんな感じになります。&lt;br /&gt;
&lt;br /&gt;
-g 解像度&lt;br /&gt;
-u ドメイン名\\ユーザー名&lt;br /&gt;
-K キーボードを乗っ取らせない(デフォルトでは、キーボードからの入力を完全に乗っとるので、ratpoisonのキーが使えない・・・)&lt;br /&gt;
&lt;br /&gt;
その他オプションはman pageを見てください。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
実際の使用感としては、vncに比べかなり高速。&lt;br /&gt;
vncの場合は、プロトコルがシンプルで画面をそのままキャプチャして送るのでどうしても遅くなりがちですが、リモートデスクトップはできるだけ必要最小限にする工夫をしてあるのでこれだけの速度が出る模様。&lt;br /&gt;
ただし、スクロールなど短時間で書き換えが起こる場合はやはり通信速度がネックになります。&lt;br /&gt;
&lt;br /&gt;
windowsを使う必要があって、リモートデスクトップで十分な場合にはかなり役立つツールかと思いますので、ぜひ使ってみてください。&lt;br /&gt;
&lt;br /&gt;
おまけ&lt;br /&gt;
Xenの完全仮想化でwindowsXPなどを動かす場合は、付属のコンソールを使うよりrdesktop使った方が軽快に動くかもしれません。 </content>
				<link rel='alternate' type='text/html' href='http://blog.asial.co.jp/509'></link>
			</entry>
	
	<entry>
		<id>http://blog.asial.co.jp/509</id>
		<published>2008-12-25T17:47:17+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category>-</category>
		<title type='text'>linuxでリモートデスクトップ</title>
		<content type='html'> 今回は、rdesktopについて書いていきます。

Windowsで遠隔操作と言えば、手軽に出来るリモートデスクトップが有名です。
XP以降デフォルトで入っているので手間をかけずにかつ、レスポンスも高速なのでかなり便利な機能ですが、
実はLinuxからでもrdesktopを使えばアクセスできます。 </content>
				<link rel='alternate' type='text/html' href='http://blog.asial.co.jp/509'></link>
			</entry>
	
	<entry>
		<id>http://www.phppro.jp/news/591</id>
		<published>2008-12-25T16:43:40+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>PHPプロ！Weekly PECL リリース @ 08/12/25号</title>
		<content type='html'>PHPプロ！Weekly PECLリリースでは、前週からの１週間にリリースされたPECLパッケージを、毎週まとめてご紹介します。
本記事では、12月18日から12月25日までの間にリリースされたパッケージ一覧を掲載しています。</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/news/591/rss'></link>
			</entry>
	
	<entry>
		<id>http://www.phppro.jp/news/590</id>
		<published>2008-12-24T14:53:07+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category></category>
		<title type='text'>PHPプロ！Weekly PEAR リリース @ 08/12/24号</title>
		<content type='html'>PHPプロ！Weekly PEARリリースでは、前週からの１週間にリリースされたPEARパッケージを、毎週まとめてご紹介します。
本記事では、12月17日から12月24日までの間にリリースされたパッケージ一覧を掲載しています。</content>
				<link rel='alternate' type='text/html' href='http://www.phppro.jp/news/590/rss'></link>
			</entry>
	
	<entry>
		<id>http://blog.asial.co.jp/508</id>
		<published>2008-12-24T12:45:16+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category>-</category>
		<title type='text'>MemcachedではなくRepcachedをセッション管理に使用する（ついでにTokyo Tyrantについても少し）</title>
		<content type='html'> 複数台のWebサーバでセッション管理をする場合、NFS・DB・Memcachedなんかが一般的ですが、今回はMemcachedじゃなくてレプリケーションができるRepcachedを使ってみよう！というお話です。

ついでに、Tokyo Tyrantをバックエンドに使用することについても少し。 </content>
				<link rel='alternate' type='text/html' href='http://blog.asial.co.jp/508'></link>
			</entry>
	
	<entry>
		<id>http://blog.asial.co.jp/508</id>
		<published>2008-12-24T12:45:16+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category>Tech</category>
		<title type='text'>MemcachedではなくRepcachedをセッション管理に使用する（ついでにTokyo Tyrantについても少し）</title>
		<content type='html'> 森川です。&lt;br /&gt;
&lt;br /&gt;
複数台のWebサーバでセッション管理をする場合、NFS・DB・Memcachedなんかが一般的ですが、今回はMemcachedじゃなくてレプリケーションができるRepcachedを使ってみよう！というお話です。&lt;br /&gt;
&lt;br /&gt;
まずは、Repcachedの話です。といってもMemcachedにレプリケーション機能が追加されたものというものです。&lt;br /&gt;
&lt;br /&gt;
Repcachedは&lt;a href=&quot;http://www.klab.org/&quot;&gt;KLab株式会社&lt;/a&gt;さんの&lt;a href=&quot;http://lab.klab.org/wiki/Repcached&quot;&gt;クラブラボ&lt;/a&gt;で公開されています。インストール方法などについては、リンク先のページを見ればわかると思います。&lt;br /&gt;
&lt;br /&gt;
今回のエントリで重要なのは、&lt;br /&gt;
&lt;br /&gt;
・高速であること （Memcachedと遜色ない）&lt;br /&gt;
・レプリケーションができること （１台が落ちてもデータが失われない）&lt;br /&gt;
・Memcachedのクライアントが使えること（設定を変更する必要がない）&lt;br /&gt;
&lt;br /&gt;
ということです。&lt;br /&gt;
&lt;br /&gt;
ただし、割り当てたメモリを超えてデータを保存した場合には、データが失われてしまうので、きちんと割り当てメモリには余裕を持ちましょう。&lt;br /&gt;
&lt;br /&gt;
NFSは使いたくないけど、もっと信頼性が欲しい、という場合はTokyo Tyrantを使ってみるというのも一つの手です。&lt;br /&gt;
&lt;br /&gt;
Tokyo Tyrantについてですが、すごく簡単に言ってしまうと、&lt;a href=&quot;http://tokyocabinet.sourceforge.net/tyrantdoc/#clientprog&quot;&gt;Tokyo Tyrant&lt;/a&gt;はmemcachedくらい速いけど、ファイルにデータを保存できるDBみたいなのです。&lt;br /&gt;
&lt;br /&gt;
Tokyo Tyrantは&lt;a href=&quot;http://tokyocabinet.sourceforge.net/&quot;&gt;Tokyo Cabinet&lt;/a&gt;というライブラリの（ホームページにも書いてある通り）ネットワークインタフェースです。&lt;br /&gt;
&lt;br /&gt;
なにやら意味がわからん！という人は、MySQLのストレージエンジン（MyISAMとかInnoDBとか）がTokyo Cabinetで、MySQLそのものがTokyo Tyrantだと思うと良いと思います。MySQLはその2つが一緒になっているけど、今回は別々なんだと。もっと詳しく知りたい人は、Web+DB Vol.47を参照したり、&lt;a href=&quot;http://alpha.mixi.co.jp/blog/&quot;&gt;mixi Engineers&#039; Blog&lt;/a&gt;もすごく簡単です。&lt;br /&gt;
&lt;br /&gt;
それでTokyo Tyrantについて今回のエントリで重要なのは、&lt;br /&gt;
&lt;br /&gt;
・高速であること （Memcachedに比べると遅いみたい）&lt;br /&gt;
・ファイルにデータを保存できること （データが自動的に削除されることがない）&lt;br /&gt;
・レプリケーションができること （１台が落ちてもデータが失われない）&lt;br /&gt;
・Memcachedのクライアントが使えること&lt;br /&gt;
&lt;br /&gt;
です。ただし、最悪な欠点が一つだけあって、ガーベッジコレクションを自分で実装する必要があります。つい最近までそれを知らずに、セッションストレージに使おうかなと思っていたのですが…&lt;br /&gt;
&lt;br /&gt;
というのも、セッション管理でmemcachedを使用する場合、ガーベッジコレクションは行われず、memcachedの有効期限の設定で管理されているのですが、Tokyo Tyrantではデータの有効期限ができないのです。そのため、memcachedと同じように使用するとセッションデータが肥大化することになってしまうので、注意しましょう。&lt;br /&gt;
&lt;br /&gt;
そのため、Tokyo Tyrantを使用する場合はセッションハンドラを自分で作成する必要があります。そこまでするなら、共有ファイル領域にファイルとして保存したほうがよいかと個人的には思います。 </content>
				<link rel='alternate' type='text/html' href='http://blog.asial.co.jp/508'></link>
			</entry>
	
	<entry>
		<id>http://blog.asial.co.jp/507</id>
		<published>2008-12-18T21:06:47+0900</published>
		<updated>2009-01-08T07:28:27+0900</updated>
		<category>Tech</category>
		<title type='text'>GDとImageMagickの画質比較</title>
		<content type='html'> こんばんは、牧野です。&lt;br /&gt;
以前、GDでの画像処理を紹介しました。&lt;br /&gt;
今日はPHPでよく使われるもう１つの画像処理方法、ImageMagickを使うやり方で画質にどれくらい差があるのか比べてみました。&lt;br /&gt;
&lt;br /&gt;
まずは早速、テスト用プログラムです。&lt;br /&gt;
&lt;br /&gt;
gd_test.php&lt;br /&gt;
&lt;ol class=&quot;php-main&quot;&gt;&lt;li&gt;&lt;span class=&quot;php-inlinetags&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$image_file&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;sample.jpg&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;MyImage&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$image_file&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;resizeImage&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;500&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;500&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;createImageFile&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;gd_sample.jpg&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;Content-type:&lt;wbr /&gt;&amp;nbsp;image/jpeg&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;readfile&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;gd_sample.jpg&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;MyImage&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$width&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$height&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$font_path&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;MyImage&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$image_path&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$font_file_path&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;imagecreatefromjpeg&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$image_path&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;imagesx&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;img&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;imagesy&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;img&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;resizeImage&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$max_w&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$max_h&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;floatval&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$max_w&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;/&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;-&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&amp;lt;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;floatval&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$max_h&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;/&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;-&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$rate&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;floatval&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$max_w&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;/&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_w&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$max_w&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_h&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;min&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;intval&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;*&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$rate&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$max_h&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$rate&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;floatval&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$max_h&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;/&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_w&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;min&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;intval&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;*&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$rate&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$max_w&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_h&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$max_h&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;imagecreatetruecolor&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_w&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_h&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;imagecopyresampled&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_w&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_h&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;createImageFile&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_file_dir&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_file_name&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_file_path&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_file_dir&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;.&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;.&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_file_name&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$result&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;imagejpeg&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_file_path&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;chmod&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_file_path&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;0666&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$result&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;}&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol class=&quot;php-main&quot;&gt;&lt;li&gt;&lt;span class=&quot;php-inlinetags&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$image_file&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;sample.jpg&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;MyImage&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$image_file&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$img&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;createResizedImage&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;500&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;500&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;imagick_sample.jpg&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;Content-type:&lt;wbr /&gt;&amp;nbsp;image/jpeg&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;readfile&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;imagick_sample.jpg&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;MyImage&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$img_path&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$width&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$height&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$font_file_path&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;MyImage&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$image_path&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;img_path&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$image_path&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$image_info&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;getimagesize&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$img_path&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$image_info&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$image_info&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;php-number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-reserved&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;createResizedImage&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$max_w&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$max_h&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_file_dir&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;,&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_file_name&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_file_path&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_file_dir&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;.&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;.&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$new_file_name&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$cmd&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;=&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;convert&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;.&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;img_path&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;.&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;php-string&quot;&gt;&lt;wbr /&gt;&amp;nbsp;-resize&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;{$max_w}x{$max_h}&lt;wbr /&gt;&amp;nbsp;{$new_file_path}&lt;/span&gt;&lt;span class=&quot;php-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-identifier&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$cmd&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;wbr /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;php-code&quot;&gt;&lt;/span&gt;&lt;span class=&quot;php-brackets&quot;&gt;}&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;
GDの場合、以前笹亀さんが書いていたように、サムネイル画像サイズを自力で計算する必要があります。&lt;br /&gt;
ImageMagickはpeclエクステンションもありますが、サーバにインストールされているImageMagick、PHPのバージョンの制限がわりと厳しいので、コマンドラインから使う方が手軽だと思います。&lt;br /&gt;
&lt;br /&gt;
今回比べたかったのは画質なので、それ以外のことはとりあえず無視します。&lt;br /&gt;
（プログラムの書き方がいい加減というつっこみは今回はできればなしの方向で。。。）&lt;br /&gt;
画像をアップロードして、それを適当な大きさの表示用画像とサムネイル画像にサイズ変更して保存する、という機能は、ウェブアプリケーションでは比較的よくある機能だと思います。その時にどれくらい差が出るものなのかを調べるのが今回の目的です。&lt;br /&gt;
元画像のsample.jpgは、615×410で、今回のテストでは少しだけ小さくしています。&lt;br /&gt;
&lt;br /&gt;
結果は、、&lt;br /&gt;
&lt;br /&gt;
GDで変換した画像&lt;br /&gt;
&lt;a href=&quot;/read_file.php?id=627&amp;mode=1&quot; rel=&quot;lightbox&quot; class=&quot;link-lightbox&quot;&gt;&lt;img src=&quot;http://blog.asial.co.jp/read_file.php?id=627&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
ImageMagickで変換した画像&lt;br /&gt;
&lt;a href=&quot;/read_file.php?id=628&amp;mode=1&quot; rel=&quot;lightbox&quot; class=&quot;link-lightbox&quot;&gt;&lt;img src=&quot;http://blog.asial.co.jp/read_file.php?id=628&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
ブログの写真では変わらないように見えるかもしれませんが、ImageMagickを使ったほうがピントが合っているような感じで少し綺麗でした。&lt;br /&gt;
ということで、ImageMagickの方が画質的にはいいということがわかりました。&lt;br /&gt;
&lt;br /&gt;
GD、ImageMagickともに様々な関数、オプションが用意されています。&lt;br /&gt;
GDでもこの関数をこんなふうにするともっと綺麗になる、等、何かご存知の方がいましたら、ぜひお知らせ下さい。 </content>
				<link rel='alternate' type='text/html' href='http://blog.asial.co.jp/507'></link>
			</entry>
	
</feed>