Page 1 of 1

Posted: Sat Mar 03, 2007 12:28 pm
by aniltc
hi all


I am storing images in a folder in the server and getting ther paths in the db.if i am doing like this how can i make thumpnails and display images please help me. i am new to GD :(

Posted: Sat Mar 03, 2007 12:33 pm
by feyd
This thread has been split from viewtopic.php?t=35204

Posted: Sat Mar 03, 2007 12:42 pm
by RobertGonzalez
My first suggestion would be to search these forums for thumbnail as this topic is brought up once every 10 days or so.

Posted: Sat Mar 03, 2007 3:15 pm
by onion2k
I wrote a tutorial that covers it: viewtopic.php?t=41743

Posted: Sat Mar 03, 2007 6:32 pm
by AKA Panama Jack
Another alternative would be to use a templating system like Template Lite. It has a built-in thumbnail plugin that can auto create thumbnails for you and store them in a seperate directory.

{resize_image}

Code: Select all

{resize_image img_src="/thumbnails/" directory="/html/mysite/ad_images/" thumbdir="/html/mysite/thumbnails/" filename="Myfile.jpg" xscale="150" yscale="200" thumbname="thumb_"}
The above example would take the image Myfile.jpg located in the /html/mysite/ad_images/ directory and create a thumb_Myfile.jpg thumbnail image in the /html/mysite/thumbnails/ directory with a max image size of 150x200 and with the correct aspect ratio.

It returns...

Code: Select all

<img src="/thumbnails/thumb_Myfile.jpg" width="150" height="200" alt="image" border="0">
...in html output for the page.

Posted: Mon Mar 05, 2007 1:03 am
by aniltc
thanks to all

But how can i integrate with smarty?can u show me some examples?What is Template lite?

How can i use this with Smarty?

Posted: Mon Mar 05, 2007 10:36 am
by RobertGonzalez
TemplateLite is a Smarty rewrite/improvement. It uses the same syntax as Smarty, but is considerably lighter is memory usage and overall size. It is a great tool, and one I'd recommend.
AKA Panama Jack wrote:Template Lite ... has a built-in thumbnail plugin that can auto create thumbnails for you and store them in a seperate directory.

{resize_image}
And why wasn't this more widely known, mister? 8O This is a neat feature, one I did not know about...

Posted: Mon Mar 05, 2007 12:04 pm
by AKA Panama Jack
aniltc wrote:thanks to all

But how can i integrate with smarty?can u show me some examples?What is Template lite?

How can i use this with Smarty?
Template Lite is a clone of Smarty that was written from scratch to be smaller and faster.

And you really need to check the sites about how to use templating in your code. It's not an easy thing to really explain here.

Posted: Mon Mar 05, 2007 12:13 pm
by AKA Panama Jack
Everah wrote:TemplateLite is a Smarty rewrite/improvement. It uses the same syntax as Smarty, but is considerably lighter is memory usage and overall size. It is a great tool, and one I'd recommend.
AKA Panama Jack wrote:Template Lite ... has a built-in thumbnail plugin that can auto create thumbnails for you and store them in a seperate directory.

{resize_image}
And why wasn't this more widely known, mister? 8O This is a neat feature, one I did not know about...
Well, it was mentioned in the news on the Template Lite site, change logs and documentation. :)

BTW, it is far more powerful than you might think. It can even download images from other sites, store them and convert them to thumbnails. It will use CURL to grab the image if CURL is installed on the server. If not then nothing will happen.

I basically got tired of doing everything in PHP and then sending two different images to the template. Now I can send just one image name and let the template do the rest. Overall it just made things so much easier.

BTW, PHP news sites only tend to look at something once and then ignore it. Unless you happen to be special to someone on the editorial staff. :)