Skip to content

Conversation

japonicus
Copy link

If only one of image width or height is specified, then scale missing dimension to maintain the aspect ratio.

I suspect that for most use-cases users would prefer to maintain the aspect ratio of images rather than distort them if a width or height style is specified but not both. This small patch sets the missing dimension to maintain the image's aspect ratio.

If only one of image width or height is specified, then scale missing
dimension to maintain the aspect ratio.
@ivanlanin
Copy link
Contributor

Thanks @japonicus. I agree that users would prefer to maintain aspect ratio on most cases. Can you update the tests/PhpWord/Tests/Element/ImageTest.php for this enhancement?

@ivanlanin ivanlanin merged commit 833dfea into PHPOffice:develop Apr 13, 2014
@ivanlanin ivanlanin added this to the 0.10.0 milestone Apr 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants