in , ,

Crop A Part Of Image With PHP


While developing an application, there are various reasons to crop a photo. If you know the specific height and width to crop the photo and do not want users to give you an idea from where to crop, you can simply use PHP to crop the photo. This will be the pretty basic option. In this article, I am adding a code to crop a part of the image with PHP.

This PHP code extracts the image part from upper-left corner up to the 100px x 100px. You can change the crop size of the image to whatever you want.

Crop A Part Of Image With PHP

Change the given variable to change the part of the image you want to crop from the image.

This code for educational purpose and learn how PHP can be used to crop a part of the photo.

If you need the more advanced solution, you should go with jQuery. With jQuery, you can allow users to select the crop area and then use those dimensions and coordinates in this code o crop the image. To make you work easier, I am suggesting you to go with Image Crop & Uploader jQuery PluginThis plugin is simple to integrate in any kind of web application. It is paid but costs just $14. So, you can save hours by using this plug and play jQuery plugin to drag and drop photo.



Written by Deepanker

Deepanker Verma is the founder of Techlomedia. He is a tech blogger, developer and gadget freak.

Leave a Reply

Your email address will not be published. Required fields are marked *


Google panda

What is Google Panda and How does it affect traffic of a website?

Google Penalty

10 Tips to avoid Google Penalty