By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,591 Members | 650 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,591 IT Pros & Developers. It's quick & easy.

Cropping Images Help Needed

P: n/a
Is there anyway to crop .jpg images so that they are all of the same
width and height?

I use the following math to calculate the correct aspect ratio:

width / height == aspect ratio

so if I need a 268 w x 176 h I do this:

target width 268 / aspect ration == correct height

But because my images are of various sizes to begin with, using the
above math I can get all of the images width to be 268 but because of
the correct aspect ratio needed, the heights will vary from image to
image.

I'd like to figure out how to just crop each image starting from the
top left corner and make each one 268 x 176 by cropping it - so my
question is: can I crop an image starting from 0,0 top left corner?

I know this will cause some image loss but this is acceptable since I
would be getting most of the image.

Thanks...
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ralph Freshour <ra***@primemail.com> writes:
I'd like to figure out how to just crop each image starting from the
top left corner and make each one 268 x 176 by cropping it - so my
question is: can I crop an image starting from 0,0 top left corner?


See the "Image functions" chapter of the PHP manual:

http://www.php.net/manual/en/ref.image.php

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.