Image Gallery option "square thumbnails" distorts displayed images when their width and height are not equal.

Bug #1397005 reported by aceMa on 2014-11-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Medium
aceMa

Bug Description

When defining an image gallery a user can choose the option "square thumbnails". This results in a Layout that shows the images distorted when their width and height are not equal. In most cases this is not the best result.
Version: 1.10.0, 1.9.3 (approved) and others
I made a quick fix for that by adding a new option that renders the images to fit in the defined square.

Hello,

Thank you for your patch. I'll ask a developer to put it into our code review system https://reviews.mahara.org

In future, if you wish to submit other patches, you are welcome to do it directly into the review system. See https://wiki.mahara.org/index.php/Developer_Area/Contributing_Code for more information.

Cheers
Kristina

Changed in mahara:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → aceMa (h-manthey)
milestone: none → 15.04.0
Aaron Wells (u-aaronw) wrote :

To get a better idea of what this patch does, I've attached a screenshot showing side-by-side:

1. The gallery block with the "Thumbnails" setting

2. The gallery block with the "Thumbnails (square)" setting before this patch

3. The gallery block with the "Thumbnails (square)" setting after this patch

You can see that neither "Thumbnails" nor "Thumbnails (square)" works particularly well for galleries that have a mix of images of different aspect ratios. "Thumbnails" sort of packs them together based on the size of the largest image, while "Thumbnails (square)" distorts them all into squares. So this new patch is certainly an improvement, scaling them all to fit into a square of the same size.

On the other hand, it also seems to put a big frame around the images? And if "Show descriptions" is turned on, it shrinks the images extra small to make room for the caption underneath them, which I'm not as happy about.

Aaron Wells (u-aaronw) wrote :

Details in this Layout may be changed. Feel free to do so.
For my solution I had the following in mind. The image Gallery is a
collection of different visual elements (images).
Displaying the square, as the underlying principle, gives a sort of
regularity or evenness that
(for my eyes) prevents it from beeing ugly.
It is nessasary to provide the description if the user decided so. That
needs some extra space.
Since these descriptions can be quite long they are shrinked to one
line. That may be a problem
but prevents an unpredictable behavior of the layout. I decided to give
some space to the images
simply because it is needed to present the content accordingly. Of
course this can be changed.

Am 01.12.2014 um 05:12 schrieb Aaron Wells:
> To get a better idea of what this patch does, I've attached a screenshot
> showing side-by-side:
>
> 1. The gallery block with the "Thumbnails" setting
>
> 2. The gallery block with the "Thumbnails (square)" setting before this
> patch
>
> 3. The gallery block with the "Thumbnails (square)" setting after this
> patch
>
> You can see that neither "Thumbnails" nor "Thumbnails (square)" works
> particularly well for galleries that have a mix of images of different
> aspect ratios. "Thumbnails" sort of packs them together based on the
> size of the largest image, while "Thumbnails (square)" distorts them all
> into squares. So this new patch is certainly an improvement, scaling
> them all to fit into a square of the same size.
>
> On the other hand, it also seems to put a big frame around the images?
> And if "Show descriptions" is turned on, it shrinks the images extra
> small to make room for the caption underneath them, which I'm not as
> happy about.
>

--
------------------------------------------------------------------------

Holger Manthey
Hochschule für Bildende Künste Braunschweig (HBK)
ZQL

Raum 14/109
Bürozeiten: Mo. - Do. 09:00 - 17:30 Uhr
Tel.: 0531 391 9150
E-Mail: <email address hidden>

------------------------------------------------------------------------

Aaron Wells (u-aaronw) wrote :

Thanks for the response. I like your new layout, and actually the extra padding does look better. So I hope to get this in for the next Mahara release. (15.04)

aceMa (h-manthey) wrote :

Hi Aaron,
thank you for your great work! Actually I learned a thing or two.

Holger

Am 10.12.2014 um 05:26 schrieb Aaron Wells:
> Thanks for the response. I like your new layout, and actually the extra
> padding does look better. So I hope to get this in for the next Mahara
> release. (15.04)
>

--
------------------------------------------------------------------------

Holger Manthey
Hochschule für Bildende Künste Braunschweig (HBK)
ZQL

Raum 14/109
Bürozeiten: Mo. - Do. 09:00 - 17:30 Uhr
Tel.: 0531 391 9150
E-Mail: <email address hidden>

------------------------------------------------------------------------

Reviewed: https://reviews.mahara.org/4047
Committed: http://gitorious.org/mahara/mahara/commit/a3f12ab1616931144818bff2bd96816110a56cef
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit a3f12ab1616931144818bff2bd96816110a56cef
Author: aceMa <email address hidden>
Date: Mon Dec 1 09:36:29 2014 +1300

Do square thumb images while preserving ratio (Bug #1397005)

I've taken what aceMa provided in bug report and made it a replacement
for the square thumbs option rather than a new option as we don't need
two square thumb options.

I've tweaked it a bit more and hopefully have got the padding/ratio
stuff more consistent and not using hardcoded numbers so much

And getting it to show descriptions/captions below frame

Change-Id: Iafc0ec8a8132d1bef5401b3ebd49e3df013fddc3
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9) on 2015-02-26
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9) on 2015-04-17
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments