[opencms-dev] Photo album overview to crop images

Paul-Inge Flakstad flakstad at npolar.no
Fri Jul 9 15:38:54 CEST 2010


Hi Yves,

That method is protected, so you cannot access it directly.

Try something like this instead (haven't tested it myself):

CmsPhotoAlbumConfiguration configuration = new CmsPhotoAlbumConfiguration();
configuration.getDetailImageScaler().setQuality(90);
configuration.getDetailImageScaler().setType(2);
configuration.getDetailImageScaler().setCropArea(0, 0, 80, 80);

Hope this helps. :)

Best regards,
Paul

________________________________
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Yves Glodt
Sent: 9. juli 2010 15:21
To: The OpenCms mailing list
Subject: Re: [opencms-dev] Photo album overview to crop images

I tried the following code down here in the template of my photoalbum. Unfortulately it fails with:

"The method setDetailImageScaler(CmsImageScaler) from the type CmsPhotoAlbumConfiguration is not visible"

Anybody got a hint for me... :-) ?

Best regards,
Yves


CmsImageScaler scaler = new CmsImageScaler();
scaler.setQuality(90);
scaler.setType(2);
scaler.setCropArea(0,0,80,80);


CmsPhotoAlbumConfiguration configuration = new CmsPhotoAlbumConfiguration();
configuration.setDetailImageScaler(scaler); // it fails here

cms.setConfiguration(configuration);
//cms.getConfiguration().getDetailImageScaler().setType(2);
//cms.getConfiguration().getDetailImageScaler().setCropArea(0,0,80,80);

...

cms.displayAlbum();




On 6 July 2010 09:57, Yves Glodt <yg at mind.lu<mailto:yg at mind.lu>> wrote:
Bumping...

In fact, to clarify, I need to show the images in the gallery overview in a square shape (100x100px), not rectangle.

Doing some research I found that I can probably edit the template used for the photo album and create a custom instance of CmsImageScaler.

Is that possible? Are there any examples around?

Best regards,
Yves


On 22 June 2010 10:28, Yves Glodt <yg at mind.lu<mailto:yg at mind.lu>> wrote:
Hello,

is it possible to have the photoalbum crop the images in the overview?
(I have a situation where the overview should have square images only.)

Best regards,
Yves


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100709/031e4445/attachment.htm>


More information about the opencms-dev mailing list