Jump to content

Thumbnail Crop resize!


jpopuk

Recommended Posts

Hi,

 

I have a script that automatically creates thumbnails for images once uploaded. I currently have a script for when it auto crops an image to a thumbnail. Here is the code:

 

function crop($x, $y, $width, $height)

  {

    if(!$this->error)

    {

      $tmpimage = imagecreatetruecolor($width, $height);

      imagecopyresampled($tmpimage, $this->img, 0, 0, $x, $y,

                          $width, $height, $width, $height);

      imagedestroy($this->img);

      $this->img = $tmpimage;

      $this->y = $height;

      $this->x = $width;

    }

  }

 

What I want to be able to do is change the way the image crops, I want it to zoom into an image more, so like when it crops I want it to take a smaller scale of an image and crop it. Does that make sense to any one? If they can help I would really appreciate it.

Link to comment
https://forums.phpfreaks.com/topic/89779-thumbnail-crop-resize/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.