Cropping Images Help Needed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ralph Freshour

    Cropping Images Help Needed

    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...


  • Michael Fuhr

    #2
    Re: Cropping Images Help Needed

    Ralph Freshour <ralph@primemai l.com> writes:
    [color=blue]
    > 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?[/color]

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



    --
    Michael Fuhr

    Comment

    Working...