-
Notifications
You must be signed in to change notification settings - Fork 2
Image Indirect Plugin
Image Indirect is a Grails plugin which allow to access images on your file system (in a near future, perphaps other file types and remoely hosted files).
Sometimes you just don't want to configure a web server to manage some images outside your grails application context and just want to store apart.
Required:
imageindirect.basePath=[root path for your images]
Example:
imageindirect.basePath='/home/jmiguel/gprjs/img-indirect-data/files1/'
Optional: You can add more path (relative or absolute) to host different files. Suppose you have landscape and macro photos, and you want to keep them on separate directories. You could add the following variables on your Config.groovy:
imageindirect.category.landscapes='/home/jmiguel/gprjs/img-indirect-data/landscapes/' imageindirect.category.macrophoto='macro/'
Note: As landscape path begins with a slash ('/') files will be accesed on a absolute path which can be fully independant of basePath. On the other hand, macrophoto it's a relative (to basePath) route so the real path would be /home/jmiguel/gprjs/img-indirect-data/files1/macro/
Mime types are automagically
Add a tag on your GSP page as follows:
<<ii:imageTag indirect-imagename="file1.jpg"/>>