Why has this resize image script stopped working?

Discussion in 'PHP' started by Darden12, Jan 18, 2010.

  1. #1
    The following script takes an image url and adjust its size and brightness. This script has been working fine and suddenly stopped working today. I don't know why it stopped working. Any ideas?


    <?php
    header('Content-type:image/jpeg');
    $filename=$_GET['myMainBack'];
    $comingfrom=$_GET['comingfrom'];
    $b="160";
    $percent=0.9;
    if ($comingfrom=="article") {
    $percent=4.3; //size
    $b="195"; //brightness
    }
    
    //Getnewsizes
    list($width,$height)=getimagesize($filename);
    $newwidth=$width*$percent;
    $newheight=$height*$percent;
    
    if ($comingfrom=="article") {
    $newwidth="680";
    $newheight="680";
    }
    //Load
    $thumb=imagecreatetruecolor($newwidth,$newheight);
    $source=imagecreatefromjpeg($filename);
    
    imagefilter($source, IMG_FILTER_BRIGHTNESS, $b);
    //Resize
    imagecopyresized($thumb,$source,0,0,0,0,$newwidth,$newheight,$width,$height);
    //Output
    imagejpeg($thumb);
    imagedestroy($thumb);
    ?>
    PHP:

     
    Darden12, Jan 18, 2010 IP
  2. Darden12

    Darden12 Well-Known Member

    Messages:
    107
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #2
    Could it have anything to do with this message:

    url file access disabled

    Could my host have changed settings on me?
     
    Darden12, Jan 18, 2010 IP
  3. Darden12

    Darden12 Well-Known Member

    Messages:
    107
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #3
    Okay, I think I've found the culprit. The script does work, but I can't access it as before by using full URL because of a setting change that the host seems to have performed.
     
    Darden12, Jan 18, 2010 IP