Advertisement

07.24.2008 at 12:52PM PDT, ID: 23593555
[x]
Attachment Details

Problems with Cropping Operation

Asked by spiritwithin in PHP Scripting Language, Web Images, Images and Photos

Tags: ImageMagck

Hello together,

i am working on an image processing automation tool for a printshop - having vast difficultes getting to a satisfying result with an IM -crop operation.

I have researched for hours, but i just can not get it right. I guess the problem is on my side - i am pretty certain, most people can tell me the correct command right away.

The goal is to resize and crop a given image to fit into a specific area on a template. If the resized image does not perfectly fit the target area, it must be cropped (in the vertical and horizontal center) so that it fits.

The commands i use are attached as a code snippet.

The result is always the same: the source image gets resized to fit either height or width of the area placed into. It does not get cropped. Therefore i always and up with my target image to contain the source image, but also thick white borders.

I would appreciate any help on that matter!

There is two more things i wondered about:

1.) The image quality of the result is not satisfying even though it never gets enlarged but rather shrinked and even though the source image is Hi-Resolution. I tried using -quality 100 -depth 8, but the result remains the same. Why?

2.) Is there a possibility to merge the two commands i use into one, so that imagemagick has not got to be launched twice - therefore saving time and cpu.

Thank you very much!
Start Free Trial
1:
2:
3:
convert files/afoch/UZ4V0121.jpg -resize 236x236 -crop 236x236+0+0 files/afoch/UZ4V0121.jpg_resized.jpg
 
composite -geometry +0+0 "files/afoch/UZ4V0121.jpg_resized.jpg" "files/afoch__processed/UZ4V0121.jpg" "files/afoch__processed/UZ4V0121.jpg"
[+][-]07.24.2008 at 02:12PM PDT, ID: 22083575

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 02:29PM PDT, ID: 22083705

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 02:49PM PDT, ID: 22083884

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 02:51PM PDT, ID: 22083909

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 05:09AM PDT, ID: 22087715

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 10:10AM PDT, ID: 22090413

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.26.2008 at 06:26AM PDT, ID: 22094969

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07.26.2008 at 06:26AM PDT, ID: 22094970

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07.31.2008 at 01:15AM PDT, ID: 22127784

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Scripting Language, Web Images, Images and Photos
Tags: ImageMagck
Sign Up Now!
Solution Provided By: ee_auto
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628