Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PHP Image Cropping

Posted on 2009-06-30
4
Medium Priority
?
421 Views
Last Modified: 2013-12-25
We would like to crop images using a web browser. We have nearly 9000 product images and we would like the ability to use PHP to develop an app that allows the user to step through the records and view the images.

When the user sees an image that needs to be cropped, they can submit the image to PHP to be cropped and then the PHP can perform other options.
0
Comment
Question by:dilithiumtoys
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
yauhing earned 2000 total points
ID: 24747872
Please try to visit: http://www.php.net/imagecopy
<?php
// Create image instances
$src = imagecreatefromgif('php.gif');
$dest = imagecreatetruecolor(80, 40);
 
// Copy
imagecopy($dest, $src, 0, 0, 20, 13, 80, 40);
 
// Output and free from memory
header('Content-Type: image/gif');
imagegif($dest);
 
imagedestroy($dest);
imagedestroy($src);
?>

Open in new window

0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 24748137
I think this sounds more like a request for application development than a question that has a written or spoken answer.  You might want to hire a developer to help you draw up specifications and develop the programming to do this.

It is certainly doable.  Some things that will make it work better include being at the latest level of PHP with the latest GD library installed.  You will also want to have all the raw (unprocessed) images in a single directory or in sub-directories of a single directory.  You will want to have a data base, probably MySQL available so your developer can keep track of the images that have been processed, etc.

A written description of the workflow with some clarity about your meaning in the phrase "perform other options" would be helpful, too.

Best of luck with it, ~Ray
0
 

Author Comment

by:dilithiumtoys
ID: 24750317
I guess I should clarify. Our intent is to find how to do something specific. Crop images using our existing PHP 5 setup.

We already have a database. SQL Server EE. We use PHP in house already, and we actually use it with GD, but the docs are sketchy and I am not sure what to pass as parameters. We dont want to resize the images we want to crop out extraneous data, white space, background, prop tables etc.

We already have all of our images in the same directory.

Other options meaning that we need three sizes of the image.
0
 

Author Closing Comment

by:dilithiumtoys
ID: 31598445
This looks like a simple enough implementation. We could return the image as a preview before the user saves it. Thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question