www.webdeveloper.com
Results 1 to 3 of 3

Thread: Use PHP to crop an image from another website on the same server

  1. #1
    Join Date
    Apr 2011
    Location
    Seattle, WA
    Posts
    265

    Exclamation Use PHP to crop an image from another website on the same server

    I need to resize and crop some images that I'm sticking into FPDF... I need them to be resized and cropped to fit a 150 x 188 pixel rectangle... but I'd prefer to have a reusable function that I can pass the filename (full URL) and the target-dimensions to... then I can have it do the math with the dimensions to find out how big the resized image should be... I just need it to actually make a copy that size and then crop it to the other dimensions (evenly cropped, please, so it's still centered)

    Any help is greatly appreciated. I've seen tons of ideas around the internet that just don't work and it's hard to sift through and find one that actually does.

    And it needs to work with a full URL because most of the images are on a different website, but they're all hosted on the same server & account.

    Thanks in advance!

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,400
    Here's something I came up with a couple years ago: http://www.charles-reace.com/blog/?s=image+resize+crop
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Oct 2010
    Location
    Ohio
    Posts
    233
    And in case you're looking for something supporting more then jpeg here's mine --> http://rdennispallas.com/coding/view/2-ImageResize
    ~Ryan
    www.rdennispallas.com <-- Personal Site, changing regularly cuz its ugly.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles