<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Benjamin Mock &#187; bug</title>
	<atom:link href="http://benjaminmock.de/tag/bug/feed/" rel="self" type="application/rss+xml" />
	<link>http://benjaminmock.de</link>
	<description>web &#38; mobile development</description>
	<lastBuildDate>Tue, 08 Nov 2011 16:20:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>CodeIgniter Validation-Library Probleme mit PHP 4</title>
		<link>http://benjaminmock.de/codeigniter-validation-library-probleme-mit-php-4/</link>
		<comments>http://benjaminmock.de/codeigniter-validation-library-probleme-mit-php-4/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 10:53:00 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://benjaminmock.de/?p=185</guid>
		<description><![CDATA[Die CodeIgniter-Validation-Library zum Überprüfen von Formularen hat mit PHP 4 ein Problem. Wer die Fehlermeldung Message: Undefined property: ... in seiner View erhält kann sich mit $data['this'] = $this; im Controller behelfen. So wird das $this in der View erreichbar und somit sind auch die Validation-Values zugreifbar.]]></description>
			<content:encoded><![CDATA[<p>Die CodeIgniter-Validation-Library zum Überprüfen von Formularen hat mit PHP 4 ein Problem.</p>
<p>Wer die Fehlermeldung</p>
<pre language="php">
Message: Undefined property: ...
</pre>
<p>in seiner View erhält kann sich mit </p>
<pre language="php">
$data['this'] = $this;
</pre>
<p> im Controller behelfen. So wird das <b>$this</b> in der View erreichbar und somit sind auch die Validation-Values zugreifbar.</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminmock.de/codeigniter-validation-library-probleme-mit-php-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codeigniter imagettftext() Problem &#8211; Could not read font</title>
		<link>http://benjaminmock.de/codeigniter-imagettftext-problem/</link>
		<comments>http://benjaminmock.de/codeigniter-imagettftext-problem/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 13:18:50 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[bild]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[imagettftext]]></category>
		<category><![CDATA[schrift]]></category>

		<guid isPermaLink="false">http://benjaminmock.de/?p=101</guid>
		<description><![CDATA[Wer mit Codeigniter (1.7.1) und der PHP-Funktion imagettftext() versucht Text in ein Bild zu schreiben wird &#8211; zumindest wenn er eine XAMPP Umgebung unter Windows nutzt &#8211; auf seltsame Probleme stoßen. Trotz korrektem Pfad zur integrierten Schrift, der texb.ttf, tritt nämlich die Fehlermeldung imagettftext: Could not read font auf. Da hilft kein experimentieren oder ändern [...]]]></description>
			<content:encoded><![CDATA[<p>Wer mit Codeigniter (1.7.1) und der PHP-Funktion <strong>imagettftext()</strong> versucht Text in ein Bild zu schreiben wird &#8211; zumindest wenn er eine XAMPP Umgebung unter Windows nutzt &#8211; auf seltsame Probleme stoßen.</p>
<p>Trotz korrektem Pfad zur integrierten Schrift, der <strong>texb.ttf</strong>, tritt nämlich die Fehlermeldung <strong>imagettftext: Could not read font</strong> auf. Da hilft kein experimentieren oder ändern des Pfades, es hilft nur eine neue Schriftart, denn offensichtlich ist diese Schriftart defekt oder funktioniert unter Windows nicht korrekt (unter Linux habe ich es noch nicht getestet). Massig coole Schriftarten gibt&#8217;s übrigens bei <a href="http://dafont.com/">dafont</a>. Die neue Schriftart sollte dann im dafür vorgesehenen Ordner <strong>system/fonts/</strong> gespeichert werden.</p>
<p>Und hier nochmal ein kleines Snippet, das zeigt wie man dann mit der neuen Schriftart Texte in Bilder schreibt:</p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Bild erzeugen, Farbe allokieren</span>
<span style="color: #000088;">$width</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">400</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$height</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$im</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreate</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span> <span style="color: #000088;">$height</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$background_color</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ImageColorAllocate</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> 255<span style="color: #339933;">,</span> 255<span style="color: #339933;">,</span> 255<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$text_color</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ImageColorAllocate</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> 0<span style="color: #339933;">,</span>0<span style="color: #339933;">,</span>0<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// schreiben</span>
<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'TEXT'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$font_size</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$angle</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$x</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">30</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$y</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$font_path</span>     <span style="color: #339933;">=</span> <span style="color: #0000ff;">'./system/fonts/neue_schriftart.ttf'</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagettftext</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> <span style="color: #000088;">$font_size</span><span style="color: #339933;">,</span> <span style="color: #000088;">$angle</span><span style="color: #339933;">,</span> <span style="color: #000088;">$x</span><span style="color: #339933;">,</span> <span style="color: #000088;">$y</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text_color</span><span style="color: #339933;">,</span> <span style="color: #000088;">$font_path</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Bild ausgeben</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-type: image/png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ImagePNG</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ImageDestroy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
</div>
</div>
<p>Ich habe in diesem Fall ein <strong>png</strong> erstellt. Den Code umzubauen, so dass ein gif oder jpeg erzeugt wird, sollte aber kein Problem sein.</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminmock.de/codeigniter-imagettftext-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

