[opencms-dev] Photo album overview to crop images

Paul-Inge Flakstad flakstad at npolar.no
Mon Aug 2 10:14:11 CEST 2010


Hi again Yves,

The empty CmsPhotoAlbumConfiguration constructor does no initialization. I assume that's why it won't work.

Instead you should probably use one of the other constructors:
CmsPhotoAlbumConfiguration(CmsJspActionElement jsp)
CmsPhotoAlbumConfiguration(CmsJspActionElement jsp, java.lang.String configUri)

Best regards,
Paul

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

Hi,

I did what you suggested, without a result...
when I set back the CmsPhotoAlbumConfiguration to the CmsPhotoAlbumBean object, the album detailoverview is not displayed at all anymore....

Any more hints for my square details pics ?

Best regards,
Yves

CmsPhotoAlbumBean cmsPhoto = new CmsPhotoAlbumBean(pageContext, request, response);

// set the CSS style class names
CmsPhotoAlbumStyle style = new CmsPhotoAlbumStyle();
style.setClassThumbTable("pgThumbTable");
style.setClassThumbImageTitle("pgThumbImageTitle");
style.setClassThumbText("pgThumbText");
style.setClassNavigation("pgNavigation");
style.setClassDetailImageDescription("pgDetailImageDescription");
style.setClassDetailImageTitle("pgDetailImageTitle");

cmsPhoto.setStyle(style);

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

cmsPhoto.setConfiguration(configuration); <- when I add this line, the album is not displayed at all anymore



On 9 July 2010 15:38, Paul-Inge Flakstad <flakstad at npolar.no<mailto:flakstad at npolar.no>> wrote:
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> [mailto: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/20100802/a27cea30/attachment.htm>


More information about the opencms-dev mailing list