• PHPTHumb for Smaller detail image preview (to save traffic) 3 0 5 1
Currently:  

Author Topic: PHPTHumb for Smaller detail image preview (to save traffic)  (Read 49336 times)

0 Members and 1 Guest are viewing this topic.

Offline yousaf

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Attention:

We recommend NOT to use PHPTHumb until they released a fixed version!

The current version 1.7.9-200805132119 (released May 28, 2008) has a big security leak.
Attackers can compromise your server.

Secunia rated this vulnerability as "highly critical".

http://secunia.com/advisories/39556/


EDIT: 4images Team



This a Tutorial about how to use PhpThumb on your 4images gallery,
so that you can show up image size of your choice on details.php
Note: { if you are running your 4images gallery on a Shared hosting and you are getting high traffic then just forget it.
because resizing is using a lot of memory if you are planning to have a lot a visitors and lot of pictures..

instead you maybe try this mod
[MOD] Resize wallpaper for restrain resize template.}

There are lots of post about PhpThumb but none of them have clear instructions
and most the guys are getting this error message
Code: [Select]
phpthumb() v1.7.9-200805132119
"/home/xxx/public_html/xxx/phpthumb/./data/media/26/chapel beach.jpg" does not exist.
because they upload phpthumb files to wrong path
so i think i should post these steps which i followed with the help of Nicky(Thanks Nicky)

1.) Download phpthumb from this link. PhpTumb
then unzip it and just upload these 9 files to your gallery root

1. phpthumb.bmp.php
2. phpthumb.class.php
3. phpthumb.config.php.default    {dont forget to rename it before uploading to phpthumb.config.php}
4. phpthumb.filters.php
5. phpthumb.functions.php
6. phpthumb.gif.php
7. phpthumb.ico.php
8. phpthumb.php
9. phpthumb.unsharp.php

and fonts folder to /captcha/fonts

Delete the other remaining files & folders in Phpthumb folder, as they are not required
Which are

/cache        <--- Delete it
/demo        <--- Delete it
/docs         <--- Delete it
/fonts         <--- Delete it
/images      <--- Delete it
index.php    <--- Delete it


2.)
open phpthumb.config.php and

find
Code: [Select]
$PHPTHUMB_CONFIG['ttf_directory'] = dirname(__FILE__).'/fonts'; // Base directory for TTF font fileschange it to
Code: [Select]
$PHPTHUMB_CONFIG['ttf_directory'] = dirname(__FILE__).'/captcha/fonts'; // Base directory for TTF font files
3.)
open /templates/your template/media/jpg.html and

Find
Code: [Select]
<img src="{media_src}" border="1" alt="{image_name}"{width_height} /><br />replace it with
Code: [Select]
<img src="phpThumb.php?src={media_src}&w=800&h=600" border="0" alt="{image_name}" >
Thats it,
you can see the result on these sites as a kind of demo

WallpaperOwner.com
wallp.ape.rs
« Last Edit: November 10, 2010, 06:05:06 PM by kai »

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #1 on: June 15, 2009, 11:37:45 PM »
@ Step 3

Delete

Code: [Select]
1)From
Code: [Select]
1)<img src="phpthumb/phpThumb.php?src={media_src}&w=800&h=600" border="0" alt="{image_name}" >
So:
Code: [Select]
<img src="phpthumb/phpThumb.php?src={media_src}&w=800&h=600" border="0" alt="{image_name}" >

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #2 on: June 16, 2009, 02:46:36 AM »
also, I believe in Step 3 it should be without phpthumb/ dir:
Code: [Select]
<img src="phpThumb.php?src={media_src}&w=800&h=600" border="0" alt="{image_name}" >
1. What about images in portrait ?
2. Does it work with remote images?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #3 on: June 16, 2009, 09:22:36 AM »
hi all,

remote:
works with remote images too, but you have to change some settings (from true to false) in phpThumb.config.php
Code: [Select]
// * Off-server Thumbnailing Configuration:

portrait:
i have another settings as Yousaf,
my example:
Code: [Select]
<img src="./phpThumb.php?src={media_src}&w=400&fltr[]=wmt|resized:+^Xx^Y+to+^xx^y|10|B|FFFFFF|arial.ttf|100|7||000000|100|" border="0">
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline yousaf

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #4 on: June 17, 2009, 03:44:35 PM »
@ Benny, Vano and Nicky
Thanks for the corrections

i was kinda too sleepy bythetime i was posting it (round about 2 AM, mid night my time)
that was what i wrote with a sleepy head.

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #6 on: June 23, 2009, 12:35:51 PM »
I didn't try this with remote images, but I would consider about security:

Q: Are there / have there been any security issues in phpThumb?
A: http://secunia.com/product/5199/

http://phpthumb.sourceforge.net/demo/docs/phpthumb.faq.txt

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #7 on: June 30, 2009, 06:42:10 PM »
it works fine

sir..i have a hostgator account... so...i mi8 get slower...is thier any alternate way ?
« Last Edit: June 30, 2009, 06:54:50 PM by g2gayan »
I'm Back :)

Offline varoon

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #8 on: July 20, 2009, 03:46:00 PM »
What will happen if i upload a 500x500 picture ? when the default size for thumb is 800x600 !

Does the thumbnail will resize to 800x600 ??? or the original size 500x500 will be displayed ?

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #9 on: July 20, 2009, 03:54:59 PM »
hi,

What will happen if i upload a 500x500 picture ? when the default size for thumb is 800x600 !

Does the thumbnail will resize to 800x600 ??? or the original size 500x500 will be displayed ?
original 500x500 will be displayed

huuuum... i read it rightnow again... THUMB 800x600 default size? huh?

thats a great mode..thanks nicky...  :) just i more thig..can we display a message saying that this image is resized ??? !
if you use this code
Code: [Select]
<img src="./phpThumb.php?src={media_src}&w=400&fltr[]=wmt|resized:+^Xx^Y+to+^xx^y|10|B|FFFFFF|arial.ttf|100|7||000000|100|" border="0">example here
note: message will be shown even picture was not resized look
« Last Edit: July 20, 2009, 04:06:46 PM by Nicky »
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #10 on: July 20, 2009, 05:01:31 PM »
Thanks Nicky !
I'm Back :)

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #11 on: July 20, 2009, 05:10:04 PM »
thanks to yousaf who write it down ;)
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #12 on: July 20, 2009, 05:31:24 PM »
thanks to yousaf who write it down ;)

yeh .. thats true,,, but yousaf's php thumb link ddnt work for me..but urs worked :D thanks for both..great work.this was what i was expecting since i got the script :D
yeh... hipop Hureeeeeeeeeeeeeeeeeeeee ! ! !
I'm Back :)

Offline dicrox

  • Pre-Newbie
  • Posts: 3
    • View Profile
    • Foro SEO
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #13 on: August 16, 2009, 10:05:36 PM »
this is what exactly I was looking for for three days I have tested all the resizers plugins, tahnks, I wasnt sure to install this becouse the message about de big load un the server, do you think it is posible to have this same plugin but with cache function to minimize de load on the server?

....

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: PHPTHumb for Smaller detail image preview (to save traffic)
« Reply #14 on: August 18, 2009, 02:06:24 PM »
Yes thier is = i saw a mod on this web site !  :D:D:D !

Are you using a dedicated host ? then its fine..but im on a shared sever...even it ddnt bother Me  :mrgreen: ! Works Fine !
I'm Back :)