Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

jimage division by zero #708

Closed
romacron opened this Issue Jan 5, 2012 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

romacron commented Jan 5, 2012

function prepareDimensions
from line: 665

if ($scaleMethod == JImage::SCALE_INSIDE)
{
$ratio = ($rx > $ry) ? $rx : $ry;
}
else
{
$ratio = ($rx < $ry) ? $rx : $ry;
}
is width or height 0 an error will be produzed

an Idea:
For Web-development/Administration in many cases i need an image-stack with same width or same height.
this harmonize the visible s for the website user.

perhaps we can build in an decision "is only one value 0" the image will be resized to the opposite value.

Contributor

Buddhima commented Apr 1, 2012

Isn't it better to be $rx same as $this->getWidth() if $width = 0 and $ry same as $this->getHeight() if $height=0 ?

Buddhima added a commit to Buddhima/joomla-platform that referenced this issue Apr 1, 2012

for issue #708
avoid division by zero

Signed-off-by: Buddhima Wijeweera <buddhimawijeweera@yahoo.com>

Buddhima added a commit to Buddhima/joomla-platform that referenced this issue Apr 1, 2012

commit 2 for issue #708
Signed-off-by: Buddhima Wijeweera <buddhimawijeweera@yahoo.com>
Contributor

romacron commented Apr 2, 2012

ive seen it on your stage it solves it, think

@romacron romacron closed this Apr 2, 2012

@romacron romacron reopened this Apr 3, 2012

Contributor

romacron commented Apr 3, 2012

i had reopen'd the ticket
and changed romacron/joomla-platform@3c28b42#diff-0

resize actions if they should scale to Edge must have as opposite value $rx or $ry an 0 not the $this->getWith()

@romacron romacron closed this Apr 3, 2012

chdemko added a commit that referenced this issue Apr 16, 2012

Merge pull request #1095 from Buddhima/for_jimage
Avoid division by zero (for issue #708)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment