Jump to content


Cropping images

  • Please log in to reply
2 replies to this topic

#1 phpvolution

  • Members
  • PipPip
  • Member
  • 13 posts

Posted 15 June 2006 - 04:29 AM

I just lately got back into PHP and am extremely rusty, so bare with me. I need to create a script that will go through a folder of images and crop each one to a certain dimension.

More specifically, these are all scanned images that are all the same dimensions and need to all be cropped the same size. So instead of going through hundreds or thousands of images manually I thought this would save me a bunch of time if I automated it. [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]

I'm not sure where to start as I haven't dealt with cropping yet, and I'm not sure how I can cycle through all the images in a folder. If anyone could provide some direction on how to do this, it would be greatly helpful!

And for the record the image dimensions are:
1276 x 1754 pixels
and need to be cropped to:
915 x 1560 pixels

I'd also like to resize them after cropping but I figure that'd be asking a little much, are there any great tutorials out there on this?

#2 Barand

  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 15 June 2006 - 06:53 AM

[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=95778\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=95778[/a]
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received


|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 phpvolution

  • Members
  • PipPip
  • Member
  • 13 posts

Posted 15 June 2006 - 08:42 AM

Thanks Barand, always great info.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users