user2201765
user2201765

Reputation: 1043

Image Crop From URL

Hi I've been working with the iTunes API and what I've done is saved the data that's returned from the search into the database. I'm saving the iTunes image URL to my database and I'm wondering what would be the best method to crop the image from the URL with PHP, or is it better to crop the image with jQuery before I display the images on the site? Thanks in advance for you advice!

Upvotes: 1

Views: 3641

Answers (3)

QRohlf
QRohlf

Reputation: 2853

You're going to want to crop images server-side, probably. Cropping client side means the client is going to have to load the whole image, and that will slow down page loads (potentially a lot, depending on how big the images are).

Cropping server-side means that you'll have to save the cropped images to your server and serve them from there. This is more of a pain than just doing the cropping client-side, but it will probably be better for your users in the end.

Since you're using PHP, you want ImageMagick.

Upvotes: 1

Roy
Roy

Reputation: 428

It is best to crop and store the cropped versions on the server, that way the images load faster and you save a lot of bandwidth.

Upvotes: 1

Telvin Nguyen
Telvin Nguyen

Reputation: 3559

Full step-by-step tutorial to crop image using jQuery & php (included live demo)

http://www.script-tutorials.com/image-crop-plugin-using-jcrop-jquery/

Upvotes: 1

Related Questions