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!
"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
How to Ask Questions the Smart Way
(not affiliated with this site, but well worth reading)
And in case you're looking for something supporting more then jpeg here's mine --> http://rdennispallas.com/coding/view/2-ImageResize
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)