Author Topic: blur effect on thumbnails (v@no)  (Read 47431 times)

0 Members and 1 Guest are viewing this topic.

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: blur effect on thumbnails (v@no)
« Reply #30 on: January 21, 2006, 08:14:35 PM »
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 ch€ri{Bi}˛

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: blur effect on thumbnails (v@no)
« Reply #31 on: January 21, 2006, 08:37:27 PM »
look at my test page. i rename index.php so you can see/list all files my root  :wink:
ch€ri{Bi}˛


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: blur effect on thumbnails (v@no)
« Reply #32 on: January 21, 2006, 08:44:15 PM »
Hmm...ok, the 404 error comes from thumb.php...
ok, I see where is the error. originaly thumb.php was created for using with mod_rewrite, so change in functions.php:
Code: [Select]
        $file_src = "thumb.php?file=".urlencode($file_src)."&folder=blur";with this:
Code: [Select]
        $file_src = "thumb.php?file=".urlencode(str_replace(THUMB_DIR."/", "", $file_src))."&folder=blur";
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 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: blur effect on thumbnails (v@no)
« Reply #33 on: January 21, 2006, 09:16:23 PM »
Oh, I just realized, thumb.php required PHP v5.x
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 ch€ri{Bi}˛

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: blur effect on thumbnails (v@no)
« Reply #34 on: January 22, 2006, 12:19:27 AM »
V@no, thank you very much for your help!
and you're right : it works on php v5.x (tested without mod_rewrite) but not on php v4.x  :(

i didn't think to seach and it is true, I should have thought about this before :arrow: it seems the php function imagefilter arrived with php v5  :roll:

[EDIT]
it seems i found how to make it works with php v4  :D
it requires some improvements but it works on my site  :wink:
[/EDIT]
ch€ri{Bi}˛


Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: blur effect on thumbnails (v@no)
« Reply #35 on: February 14, 2006, 11:58:21 AM »
V@no, thank you very much for your help!
and you're right : it works on php v5.x (tested without mod_rewrite) but not on php v4.x  :(

i didn't think to seach and it is true, I should have thought about this before :arrow: it seems the php function imagefilter arrived with php v5  :roll:

[EDIT]
it seems i found how to make it works with php v4  :D
it requires some improvements but it works on my site  :wink:
[/EDIT]

Could you tell me how you got it working? :D

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: blur effect on thumbnails (v@no)
« Reply #36 on: February 15, 2006, 09:13:31 AM »
I'm writing on such an mod too,
cause i also "only" have php4 installed.
thumb creation is already done,
but the workaround isn't coded yet.
@cheribibi: How is your solution?
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: blur effect on thumbnails (v@no)
« Reply #37 on: February 15, 2006, 01:10:22 PM »
Hope cheribibi got my msg :)
I really need something like this he ;D

Offline ch€ri{Bi}˛

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: blur effect on thumbnails (v@no)
« Reply #38 on: February 15, 2006, 01:12:08 PM »
OK! since php v5 had in-built instructions to make pictures effects, here is my solution for blur effects (and others...) with php4 :

1 - (unzip and) add the attached file in your includes directory :


2  - Replace the code in  thumb.php by this one:
Code: [Select]
<?php
define
("ROOT_PATH""./");
include(
"config.php");
include(
ROOT_PATH."includes/constants.php");

if(!
function_exists('file_get_contents'))
{
  function file_get_contents($file)
  {
    $file file($file);
    return !$file false implode(''$file);
  }
}

if (isset(
$_GET['file']) && !empty($_GET['file']))
{
$file THUMB_DIR."/".urldecode($_GET['file']);
if (isset($_GET['folder'])) $folder $_GET['folder'];

if (file_exists($file)) {
// echo "yes : ".$file." exists<br>";
     $etag =  crc32($folder.$file);
//echo $etag."<br>";
     $info = @getimagesize($file);
    
    
$modified = ($modified) ? $modified gmdate('D, d M Y H:i:s'filemtime($file)).' GMT';
    
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && ($_SERVER['HTTP_IF_MODIFIED_SINCE'] == $modified || substr($_SERVER['HTTP_IF_MODIFIED_SINCE'],0,(strlen($_SERVER['HTTP_IF_MODIFIED_SINCE'])-strlen(strrchr($_SERVER['HTTP_IF_MODIFIED_SINCE'],";")))) == $modified) && (!isset($_SERVER['HTTP_IF_NONE_MATCH']) || empty($_SERVER['HTTP_IF_NONE_MATCH']) || $_SERVER['HTTP_IF_NONE_MATCH'] == '"'.$etag.'"'))
     {
       header("HTTP/1.1 304 Not Modified");
       header("ETag: \"".$etag."\"");
       exit;
    

include(ROOT_PATH."includes/class.imagefilter.php"); //--- incguding a class for pictures effects

$image = new ImageFilter;
$image->loadImage($file);
//$image->mosaic(2);
//$image->colorize(10, 1, 1, 1)
//$image->lightContrast(0, 100);
$image->lightContrast(10050);
//$image->Contrast();
$image->blur(2);
$image->blur();
//echo $etag."<br>";
//$image->lightContrast(0, 100);
//$image->blur();
//$image->mosaic(3);
//$image->sepia();

header("Last-Modified: " $modified);
$image->output('JPEG');
exit;
}
}
header("HTTP/1.1 404 Not Found");
exit;
?>


as you can see, you can apply many other effects : read the class.imagefilter.php file to get the complete effect list.

  :arrow: try all of them with new parameters to fit your needs.  :wink:

but as i said in one of last posts, it need some improvement... the var folder can be use to choose the effect as original mod...
« Last Edit: February 15, 2006, 03:21:01 PM by cheribibi »
ch€ri{Bi}˛


Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: blur effect on thumbnails (v@no)
« Reply #39 on: February 15, 2006, 05:36:21 PM »
Great Cheribibi :D

I only need one thing now. And that is getting it to work with  [MOD] Terms and Conditions for images v1.2.1 http://www.4homepages.de/forum/index.php?topic=7113.0
So if I "Terms and Conditions" selected then it shows the "blurry" thumb instead :)
« Last Edit: February 15, 2006, 07:09:59 PM by BartAfterDark »

Offline ch€ri{Bi}˛

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: blur effect on thumbnails (v@no)
« Reply #40 on: March 22, 2006, 07:24:45 AM »
 8O it seems the link disappeared !!!
i will repost it as soon as possible  :wink:
ch€ri{Bi}˛


Offline ch€ri{Bi}˛

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: blur effect on thumbnails (v@no)
« Reply #41 on: May 14, 2006, 06:48:56 PM »
sorry to post it so late  :oops:
as requested here, this is the missing file to make this mod work with PHP 4.x .

Cheers!
ch€ri{Bi}˛


Offline l1some

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: blur effect on thumbnails (v@no)
« Reply #42 on: June 11, 2006, 02:53:35 AM »
can you help me with this mod, I think I have install it correctly, but still have red X using thumb.php for php 4.

Offline Hello-world

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: blur effect on thumbnails (v@no)
« Reply #43 on: September 07, 2008, 11:17:44 PM »
Good idea! But it does not work. thumbnail does not become blur or any... I've php5 and I did all about which you spoke here.   :?