joomla/joomla-cms — pull request #3587 by itbra (2014-05-12 13:53:47+00:00)
Title: Fix auto-offset 1px top offset

When calling JImage->crop($width, $height) without passing in a value for $top, the top offset is automatically calculated. I found the calculated value to be -1 in this case. As a consequence the created image always shows a 1px high black line on its top border (due to the black imagefill color). The suggested fix check whether the calculated offset value is < 0 and sets it to 0, which makes the imagecopy function to copy every pixel to its exact position without the offset.

Because of this issue i wonder if the initial values for $left and $top of this method should be fall back to 0 each rather than to null?

Your comments and suggestions are highly appreciated.