PHP GD Library: Cropping Images whilst Maintaining the

Tutorials Shared by the Internet Community

Advertisements


Synopsis

An article demonstrating how to crop an image using PHPs GD library, whilst still keeping the aspect ratio as it was originally.

Statistics

  • Total Hits - 27668

  • Total Votes - 98 votes

  • Vote Up - 42 votes

  • Vote Down - 56 votes

  • Domain - www.talkphp.com

  • Category - PHP/Image Manipulation

  • Submitted By - Devesh Khanna

  • Submitted on - 2008-03-16 07:18:27

Description

An article demonstrating how to crop an image using PHP's GD library, whilst still keeping the aspect ratio as it was originally. This is very clever as it prevents the image from looking stretch. For example, if you resized an image to 80x80 but the original image was wide-screen, then the image would look very much stretched. This article shows you how to get around that and crop images the proper way! ...


Site  |   Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements