? Success

User tests: Successful: Unsuccessful:

avatar itbra
itbra
12 May 2014

When calling JImage::crop() without passing in a value for $top, this offset is automatically calculated (same for $left - the left offset). I found the calculated top offset to be -1 in some cases - especially when JImage::resize() was applied first. I discovered that the calculation of the width and height values in JImage::prepareDimensions() is the reason. In my case i upload a file which is first resized and then cropped. Both methods receive the same height value (152px), because the input file is a portrait and i require a height of 152px. But the height value changes to 151px while the file passes JImage::resize(). I debugged the input- and output values just to find the place where the height is altered and found JImage::prepareDimension() to be the place - case SCALE_INSIDE. I could not yet figure out if its the rounding that works inaccurately.

As a consequence the created image always shows a 1px thick black line on its top border (due to the black imagefill color) indicating that imagecopy() starts pasting the pixels copied from the source image at the second row of the target image.

The suggested fix checks whether the calculated height offset value is

avatar itbra itbra - open - 12 May 2014
avatar brianteeman brianteeman - change - 21 Aug 2014
The description was changed
Status New Pending
avatar nicksavov nicksavov - change - 21 Aug 2014
Labels Removed: ?
avatar roland-d
roland-d - comment - 20 Aug 2015

Hello @itbra

Thank you for your contribution.

As there has been no comments on this, is this issue/pull request still valid? Perhaps start the discussion on the Joomla Google group. You are more likely to get a response there.

If no reply is received within 4 weeks we will close this issue.

Thanks for understanding!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3587.

avatar roland-d roland-d - change - 20 Aug 2015
Status Pending Information Required
avatar roland-d
roland-d - comment - 3 Nov 2015

@itbra Since no reply has been received in the past 4 weeks, I am closing this issue. If you feel the issue still applies, feel free to update and reopen the issue. Thank you for your contribution.

avatar roland-d roland-d - change - 3 Nov 2015
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2015-11-03 17:21:28
Closed_By roland-d
avatar roland-d roland-d - close - 3 Nov 2015

Add a Comment

Login with GitHub to post a comment