Search code examples
phpimage-processingresolutionlandscape-portrait

Dealing with different resolutions when building a gallery


I'm currently struggling with different resolutions when building my gallery-application. I've realized the problem: the photos can be in entierly different resolutions, or taken in landscape/portrait. If I force the images to a fixed resolution - they are likely to be viewed as stretched. If I don't: I can expect something like this (example of 6 different images with loose resolution, only fixed witdh): enter image description here

When I'm actually looking for something like this (6 images with same resolution): enter image description here (these two galleries are actually running the same code)

I'd appreciate any suggestions on how to make this as pain-free as possible for the viewer. Thanks!


Solution

  • If you care anything about the artistic minded photographer, don't crop the image.

    Resize them to a max-size (either width or height) to a specific measure, 400px, and place them each in a square div.