4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: yousaf on June 15, 2009, 11:32:24 PM

Title: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: yousaf on June 15, 2009, 11:32:24 PM
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 (http://www.4homepages.de/forum/index.php?topic=10720.0).}

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 (http://phpthumb.sourceforge.net/)
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 (http://www.WallpaperOwner.com)
wallp.ape.rs (http://wallp.ape.rs)
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: Sunny C. 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}" >
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: V@no 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?
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: Nicky 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">
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: yousaf 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.
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: Sunny C. on June 17, 2009, 04:32:04 PM
I have added to my List
http://www.4homepages.de/forum/index.php?topic=24888.0
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: Lucifix 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
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: GaYan 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 ?
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: varoon 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 ?
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: Nicky 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 (http://wallp.ape.rs/wallpaper-pic-gallery-album-nissan-wallpaper-00014-18102.html)
note: message will be shown even picture was not resized look (http://wallp.ape.rs/wallpaper-pic-gallery-album-bmw-power-78376.html)
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: GaYan on July 20, 2009, 05:01:31 PM
Thanks Nicky !
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: Nicky on July 20, 2009, 05:10:04 PM
thanks to yousaf who write it down ;)
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: GaYan 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 ! ! !
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: dicrox 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?

....
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: GaYan 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 !
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: khan on February 21, 2010, 04:58:43 PM
hi,
great mode, i just add this to my gallery every thing works fine except there is no link to the original image on image displays on detial page, how to make the link to the original image?
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: SilverShadow on July 04, 2010, 06:51:47 PM
Works fine but I got the same issue as khan, there's no link for the original image
any help guys :)


EDIT
its only shows the new size "800X600" and no pop-up with the original image !!

UPDATE
Sorry, I didn't notice the Nicky's code :) resizing note appears now but still no link for the original image :(
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: Nicky on July 20, 2010, 12:50:20 AM
i have this in my details.html template

Code: [Select]
<a href="#" onClick="window.open('./showwall.php?src={media_src}&amp;image_id={image_id}&amp;title={image_name}', 'showpic', 'fullscreen=yes,resizable=yes,status=no,menubar=no,toolbar=no,scrollbars=yes,left=0,top=0'); return false;" title="{image_name}">
<img src="./media.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" alt="{image_name}"></a>

media.php would be phpThumb.php

showwall.php is this: http://phpthumb.sourceforge.net/index.php?source=demo%2FphpThumb.demo.showpic.php
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: Lucifix on November 10, 2010, 12:58:20 PM
For those who're using PHPthumb and have gallery with many images, I would recomment using this modification:
http://mrphp.com.au/code/image-cache-using-phpthumb-and-modrewrite

Quote
Generate thumbs by visiting a URL such as your.com/thumbs/50x50/images/image.jpg. This will create a 50x50px thumbnail of your.com/images/image.jpg.

The thumb will be stored on your server at your.com/thumbs/50x50/images/image.jpg so the next request for the same image will be loaded without loading php for ultra fast image cache.
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: kai on November 10, 2010, 05:16:51 PM
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/
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: Lucifix on November 10, 2010, 08:32:57 PM
PHPthumb security fix:
http://modxcms.com/forums/index.php/topic,54874.msg316279.html#msg316279
Title: Re: PHPTHumb for Smaller detail image preview (to save traffic)
Post by: clubbu on July 29, 2011, 06:11:13 PM
Very thanks for your bug fix