SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2004
    Location
    San Diego, CA (USA)
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with image cropping function

    I am in the middle of writing a thumbnail class which is programmed to take a source image,crop it to certain dimensions, and then output it to a specified destination. I am using the image functions from the GD library, which I am not too familar with.

    I am having a problem with the cropping function, to be specific.

    here is the function:

    PHP Code:
    //This function is inside of the thumbnail class
    function crop() {
        
    $canvas imagecreatetruecolor($this->thumbw$this->thumbh);
        
    $srcdim getimagesize($this->srcpath.$this->srcfile);
        
    $original imagecreatefromjpeg($this->srcpath.$this->srcfile);
        
    imagecopy($canvas$original0000$srcdim[0], $srcdim[1]);
        
    imagejpeg($copy$this->destpath.$this->destfile$this->qual);

    Whenever this function of the class runs, I get an internal server error page.

    Also, the source and destination folders have been chmodded so that they are writable, so I already know thats not the problem.

    Can anyone help me out here?

    Thanks in advance.

  2. #2
    Non-Member bronze trophy geniusgoalie's Avatar
    Join Date
    Sep 2004
    Location
    Buffalo, USA
    Posts
    979
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    to be honest, as I dont see anythingwrong with it (at a glance) you may want to contact your host, as it sounds like the 500 error may be due to server problems.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •