Masonry Effect Image Cropping

Phoca Gallery - image gallery extension
GGGolf
Phoca Member
Phoca Member
Posts: 14
Joined: 04 Sep 2009, 17:20
Location: Montréal, Québec

Masonry Effect Image Cropping

Post by GGGolf »

Hi Jan!

I have a question about the masonry effect in Joomla 3.

Is it posibble for the thumbnails to be always displayed in a ration similar to the original image? If it's a portait, the thumbnail would be portrait and the same for landscape? The landscape pictures are cropped very awkwardly and randomly and I would like to set it properly.

Thank you!

Catherine
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Masonry Effect Image Cropping

Post by Jan »

Hi, for now there is an easy rule, which says - if the image is landscape - display the image which is 2x wider and when it is portrait - display the image which is 2x higher. This easy rule works for displaying double sizes only - there is no such option for cropping as this function is really complicated and such needs to be customized for specific features (e.g. to not crop human body, to crop empty places on the photo, etc. :idea: )

Jan
If you find Phoca extensions useful, please support the project
GGGolf
Phoca Member
Phoca Member
Posts: 14
Joined: 04 Sep 2009, 17:20
Location: Montréal, Québec

Re: Masonry Effect Image Cropping

Post by GGGolf »

Hi Jan,

Please see the attached image. It's a print screen from how the gallery displays. If you look at it, the Koala Photo and the baby photo on the bottom are lanscape pictures, but displayed as portraits. The only portait pictures are the two at the bottom right. Event the flowers on top right are displayed as portrait when they are actually landscapes. And this changes everytime I releoad the page. Is this the way it shoul be or have I done something wrong?

Image

Thanks again,

Catherine
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Masonry Effect Image Cropping

Post by Jan »

Hi, do you mean MOSAIC EFFECT (categories view)
https://www.phoca.cz/joomla3demo/

or DIFFERENT THUMBNAIL HEIGHT (category view):
https://www.phoca.cz/joomla3demo/category/6-cities

Only in category view there is such option

Jan
If you find Phoca extensions useful, please support the project
GGGolf
Phoca Member
Phoca Member
Posts: 14
Joined: 04 Sep 2009, 17:20
Location: Montréal, Québec

Re: Masonry Effect Image Cropping

Post by GGGolf »

Hi Jan,

I mean for the different thumbnails height. I want the thumbnails of the gallery to be of different heights, but the landscape pictures are displayed randomly in portrait. They should simply be displayed in the format they were taken and disposed accordingly in metro style...

Is that possible?

Thanks,
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Masonry Effect Image Cropping

Post by Jan »

Hi, for this, I think, you need to customize directly the code:

administrator\components\com_phocagallery\libraries\phocagallery\image\imagefront.php
components\com_phocagallery\views\categories\tmpl\default.php
components\com_phocagallery\views\category\tmpl\default_images.php


Jan
If you find Phoca extensions useful, please support the project
proudbird
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 06 Feb 2016, 12:58

Re: Masonry Effect Image Cropping

Post by proudbird »

In file "components\com_phocagallery\views\category\tmpl\default_images.php" try to change block:

Code: Select all

$m2 = mt_rand(0,1);
if ($m2 == 1) {
$iFormat = 'medium1';
}
to

Code: Select all

$m2 = mt_rand(0,1);
if ($m2 == 1) {
$iFormat = 'medium';
}
Post Reply