[opencms-dev] Photo album overview to crop images
Yves Glodt
yg at mind.lu
Mon Aug 2 09:55:36 CEST 2010
Sorry to flood the list but this topic is important for me...
So I need to be able to specify a scaleType parameter to the image gallery
overview (my task is to have all the images displayed as squares, cropped to
100x100px)
The photoalbum module generates the img:src as
"photo.jpg?__scale=w:100,h:100,c:000000", and what I would need is
"photo.jpg?__scale=w:100,h:100,c:000000*,t:2*"
Is there a way to add the scaleType by modifying the xsd of the photoalbums?
I could imagine it is possible since there are other properties which can be
set, like e.g.:
<layout element="Filter" widget="SelectorWidget"
configuration="none:${key.photoalbum.filter.none}|shadow:${key.photoalbum.filter.shadow}|grayscale:${key.photoalbum.filter.grayscale}|grayscale.shadow:${key.photoalbum.filter.both}"
/>
Best regards,
Yves
On 29 July 2010 13:47, Yves Glodt <yg at mind.lu> wrote:
> 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> 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] *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> 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> 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/d8ef14b5/attachment.htm>
More information about the opencms-dev
mailing list