<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>PHP Thumb Topic: Instant resizing or multiple thumbnail creation? in both cases, Help!</title>
<link>http://phpthumb.gxdlabs.com/forums/</link>
<description>Help, Suggestions, and General Discussion</description>
<language>en</language>
<pubDate>Tue, 07 Feb 2012 12:22:42 +0000</pubDate>

<item>
<title>Birch on "Instant resizing or multiple thumbnail creation? in both cases, Help!"</title>
<link>http://phpthumb.gxdlabs.com/forums/topic/instant-resizing-or-multiple-thumbnail-creation-in-both-cases-help#post-64</link>
<pubDate>Sat, 25 Jul 2009 02:26:09 +0000</pubDate>
<dc:creator>Birch</dc:creator>
<guid isPermaLink="false">64@http://phpthumb.gxdlabs.com/forums/</guid>
<description>&#60;p&#62;Ok, this has been really a pain in the neck.&#60;/p&#62;
&#60;p&#62;I have a database made with MySQL and PHP. The script I used selects 1 row from the table, and displays the values in a table using echo.  So I used the technique written in &#60;a href=&#34;http://trac.gxdlabs.com/projects/phpthumb/wiki/Docs/BasicUsage#ShowingImages&#34; rel=&#34;nofollow&#34;&#62;http://trac.gxdlabs.com/projects/phpthumb/wiki/Docs/BasicUsage#ShowingImages&#60;/a&#62;&#60;br /&#62;
 But, when the solution the docs say failed, I used various ways such as &#60;code&#62;	echo &#34;&#60;a&#62;&#38;lt;img src=\&#34;thumb.php?file=&#34;.echo urlencode('/covers/komix$id.png').&#34;\&#34; /&#38;gt;&#60;/a&#62;&#34;;&#60;/code&#62;, but I couldn't achieve it. When I tried to fetch the image with a img tag outside the php tags, I found out that the script show the exception error. No matter what I did,(ie ../s and directory changes) I could not get a result.&#60;/p&#62;
&#60;p&#62;the thumb.php file source:&#60;br /&#62;
&#60;code&#62;&#38;lt;?php&#60;/p&#62;
&#60;p&#62;   $path = $_SERVER['DOCUMENT_ROOT'];&#60;br /&#62;
   $path .= &#34;/scripts/thumb/ThumbLib.inc.php&#34;;&#60;br /&#62;
require_once &#34;$path&#34;;&#60;/p&#62;
&#60;p&#62;$fileName = (isset($_GET['file'])) ? urldecode($_GET['file']) : null;&#60;/p&#62;
&#60;p&#62;if ($fileName === null &#124;&#124; !file_exists($fileName))&#60;br /&#62;
{&#60;br /&#62;
     // handle missing images however you want... perhaps show a default image??  Up to you...&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;try&#60;br /&#62;
{&#60;br /&#62;
     $thumb = PhpThumbFactory::create($fileName);&#60;br /&#62;
}&#60;br /&#62;
catch (Exception $e)&#60;br /&#62;
{&#60;br /&#62;
     // handle error here however you'd like&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;$thumb-&#38;gt;resize(201, 283);&#60;br /&#62;
$thumb-&#38;gt;show();&#60;/p&#62;
&#60;p&#62;?&#38;gt;&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Another problem is the thumbnail saving. I have 300+ pngs of a high quality and doing it manually is a nightmare.  How can I do it?&#60;/p&#62;
&#60;p&#62;Thank you in advance for your help!
&#60;/p&#62;</description>
</item>

</channel>
</rss>

