Project

General

Profile

Actions

Bug #33728

closed

Error in Crop Parameter for ImageMagick convert

Added by Florian Weber almost 13 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Image Cropping
Target version:
-
Start date:
2012-02-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.6
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

While executing a crop with the ImageMagick convert and the picture is bigger on either width or height but smaller at the other parameter, the convert command is not able to process correctly.
It results in 1 negative and 1 positive Offset for the Crop parameter.
To Solve the Problem you have to make sure both offsets for the Crop Parameter are either positive or negative.

You can achive this by extending the if queries at \t3lib\class.t3lib_stdgraphic.php line 2274-2284 like this:

// Cropscaling:
if ($data['crs']) {
    if (!$data['origW'] || ($data['origW']>$data[0] && $data['origH']<$data[1])) {
        $data['origW'] = $data[0];
    }
    if (!$data['origH'] || ($data['origW']<$data[0] && $data['origH']>$data[1])) {
        $data['origH'] = $data[1];
    }
    $offsetX = intval(($data[0] - $data['origW']) * ($data['cropH'] + 100) / 200);
    $offsetY = intval(($data[1] - $data['origH']) * ($data['cropV'] + 100) / 200);
    $params .= ' -crop ' . $data['origW'] . 'x' . $data['origH'] . '+' . $offsetX . '+' . $offsetY . ' ';
}

Actions #1

Updated by Markus Klein almost 13 years ago

Hi Florian!

Thank you for reporting this issue.
In order to manage our code changes we have a review system.

Would you mind pushing your suggestion to this system?
These links describes how to do this:
http://wiki.typo3.org/Git_Gerrit
http://wiki.typo3.org/Contribution_Walkthrough_Tutorials

Thank you.

Actions #2

Updated by Thorsten Kahler almost 13 years ago

  • Status changed from New to Accepted
  • Target version set to 4.7.0-beta1
  • Complexity changed from no-brainer to easy

Image generation is never a no-brainer ;-)

I didn't test it yet but your suggested code change looks reasonable and I'll have a look at it.

Actions #3

Updated by Steffen Gebert almost 13 years ago

  • Target version deleted (4.7.0-beta1)
Actions #4

Updated by Gerrit Code Review almost 13 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9143

Actions #5

Updated by Gerrit Code Review almost 13 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9143

Actions #6

Updated by Gerrit Code Review almost 13 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9143

Actions #7

Updated by Gerrit Code Review over 12 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9143

Actions #8

Updated by Gerrit Code Review about 12 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9143

Actions #9

Updated by Gerrit Code Review over 11 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/9143

Actions #10

Updated by Gerrit Code Review over 11 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/9143

Actions #11

Updated by Gerrit Code Review almost 10 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/9143

Actions #12

Updated by Markus Klein over 9 years ago

  • Status changed from Under Review to Needs Feedback
  • Is Regression set to No

Please post clear instructions on how to reproduce this error. TypoScript code + test-image
Thanks.

Actions #13

Updated by Alexander Opitz over 9 years ago

  • Status changed from Needs Feedback to Closed

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

BTW: Patch was abandoned.

Actions

Also available in: Atom PDF