Skip to content

Conversation

sathinduga
Copy link

I have updated the aspect ratio calculation method from

ar = page.getWidth() / image.getWidth();

to

float i_width = image.getWidth();
float i_height = image.getHeight();

if(i_width > i_height){
    ar = page.getWidth() / i_width;
 }else {
    ar = page.getHeight() / i_height;
}

because if image height is greater than the width the updated method gives correct aspect ratio. Otherwise previous aspect ratio will give the value to fit in to width in every scenarios.

@HendrixString
Copy link
Owner

Thanks
I will go over this the next couple of days

@vladimirarevshatyan
Copy link

This has to be merged!

@HendrixString
Copy link
Owner

@vladimirarevshatyan have you tested it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants