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

Bug #1397005 reported by aceMa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
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.

Revision history for this message
aceMa (h-manthey) wrote :
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

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
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/4047

Revision history for this message
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.

Revision history for this message
Aaron Wells (u-aaronw) wrote :
Revision history for this message
aceMa (h-manthey) wrote : Re: [Bug 1397005] Re: Image Gallery option "square thumbnails" distorts displayed images when their width and height are not equal.

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>

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

Revision history for this message
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)

Revision history for this message
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>

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

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

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)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.