New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize portrait images to same size as landscape #258

Merged
merged 2 commits into from Oct 9, 2017

Conversation

2 participants
@matze
Contributor

matze commented Sep 19, 2017

With the current approach images are resized along the width, which means images in portrait mode are substantially smaller than landscape images. This change resizes portrait images along the height so that they will cover the exact same area.

Resize portrait images to same size as landscape
With the current approach images are resized along the width, which means images
in portrait mode are substantially smaller than landscape images. This change
resizes portrait images along the height so that they will cover the exact same
area.
@saimn

This comment has been minimized.

Owner

saimn commented Sep 26, 2017

I don't remember the exact logic behind my initial choice. It's probably that the current logic makes theming easier. With your solution you get images with different width and height.
Before implementing this in sigal, did you check if there is a similar "processor" in pilkit ? If not, I think we need a setting to change the current behavior.

@matze

This comment has been minimized.

Contributor

matze commented Sep 26, 2017

Before implementing this in sigal, did you check if there is a similar "processor" in pilkit ?

As far as I can see, pilkit does not ever checks if an image is in portrait orientation and just passes width and height verbatim.

If not, I think we need a setting to change the current behavior.

Okay, I will add an option even though I do not see how the current behavior helps with theming.

@saimn

This comment has been minimized.

Owner

saimn commented Sep 26, 2017

Okay, I will add an option even though I do not see how the current behavior helps with theming.

It allows to have a regular grid, otherwise you will have portrait images higher than landscape ones.

@matze

This comment has been minimized.

Contributor

matze commented Sep 26, 2017

The change affects the resized images not the thumbnails which still have the same aspect ratio and allow for regular grids.

@saimn

This comment has been minimized.

Owner

saimn commented Oct 8, 2017

Oh indeed, sorry for the confusion ! So this choice is probably because originally there was only the galleria theme, which display images in a fixed-height frame. But I agree it would make sense to respect the orientation of the image to adjust the requested size. And after some thoughts I don't think we need a new setting for this, as there is no real drawback (only that the generated vertical images will be bigger).

So the only thing I would ask you is to update the tests to check the sizes for both horizontal and vertical images, just to be sure it works and does not break in the future.

@saimn saimn merged commit c083b84 into saimn:master Oct 9, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@saimn

This comment has been minimized.

Owner

saimn commented Oct 9, 2017

Thanks @matze !

@saimn saimn added this to the 1.4 milestone Oct 9, 2017

@matze matze deleted the matze:correct-portrait-resize branch Apr 16, 2018

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