I mean, using real image-like url. Now, portrait-bits works with an url like
/shared/portrait-bits.tcl?user_id=12345
what makes no sense to browsers to cache that as images.
That means to rewrite current portrait-bits url's as... something like /shared/portraits/12345/real-name.jpg
, Or maybe /shared/portraits/12345.jpg
, where 12345 is the user_id param, just to avoid collision between 2 different user portraits with the same image file name. And ".jpg" is the real file extension, so an api call should be use (of course) to get the user portrait url. (I've seen somewhere a manual url construction)
I don't know exactly how to do that. I've been looking packages/acs-subsite/www/image.vuh
file, but I can't realize If I can use it for that purpose. I have tried, but due to user portraits have not set "read" privileges, a "not found" text page is served when the user is not a swa. Maybe, (another proposal) a default image should be served instead of a text/plain message.
<h2>Smaller versions</h2>
Maybe that should be another proposal but... there is also a feature I'd like to have on user-portraits: "smaller" versions. If the user upload a big file (let's say real-name.jpg), it'd be nice to have a real-name-small.jpg, real-name-thumbnail.jpg, real-name-square.jpg file names depending on different maximum values for each version. Maybe created at running time, when user uploads its portrait.
the square version is really nice to make a grid layout of images (for instance, agraduation class photo -in spanish: "<span lang="es">orla</span>") having control on how images are shown, and keeping the aspect ratio of them (cropping, instead of distorting them)
I've made something similar on another framework (PHP+Apache+GD library), so maybe I could do it on openACS using CR, but I'll need help for doing that.