[opencms-dev] Get image path based on downscaled image's URL

Siegfried Ehret s.ehret at eurelis.com
Wed Oct 31 16:27:51 CET 2012


I haven't played with it yet, but the cms:device tag should help.
http://files.opencms.org/javadoc/core/org/opencms/jsp/CmsJspTagDevice.html
Types can be found here : http://files.opencms.org/javadoc/core/org/opencms/jsp/util/CmsJspDeviceSelector.html

Have fun :)

Siegfried Ehret

On 10/31, Paul-Inge Flakstad wrote:
> Hi,
> 
> I'm looking into creating an adaptive image solution for my site, and I'm wondering if there's a way to retrieve the path to an original image, based on the online URL of a downscaled version.
> 
> For example: 
> 
> The online, downscaled image URL is:
> http://mysite.com/opencms/export/sites/default/images/myimage.jpg_123456789.jpg
> 
> Apache will receive this, and redirect to a handler JSP, which will act as an "intelligent proxy", possibly serving a smaller image to smaller screens. In order to do this, the JSP will need to read the original image resource from the VFS. So needs to be able to somehow get the VFS path:
> /images/myimage.jpg   (OR /sites/default/images/myimage.jpg)
> 
> Any way this can be done using the OpenCms API? Or do I have to resort to manually determining the VFS path based on the URL (i.e. using string methods, regexes or whatever)?
> 
> Cheers,
> Paul
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
> 
> 
> 
> 



More information about the opencms-dev mailing list