On Wed, Aug 24, 2011 at 10:41 AM, Jerome Velociter
<jerome(a)winesquare.net> wrote:
Hi Vincent,
On Wed, Aug 24, 2011 at 9:11 AM, Vincent Massol <vincent(a)massol.net> wrote:
Hi Jerome,
On Aug 23, 2011, at 6:29 PM, Jerome Velociter wrote:
Hello again,
I would like to introduce a new module in platform : xwiki-platform-thumbnails.
The idea of the module is to provide means of handling thumbnails in
XWiki. Right now the main purpose is to expose APIs to retrieve
thumbnails URLs for images stored as attachments. This module first
use will be to generate thumbnails of user avatars. In this scenario,
it will also introduce a performance improvement compared to today's
way of computing avatar URLS, since the module caches both the
property values (the fact that user X has set an avatar Z.png) and the
thumbnail URL for this avatar.
I've already pushed it in a feature branch/. You can check in
particular
https://github.com/xwiki/xwiki-platform/commit/3f5aa1e24ba00fcc939b73b8f9ba…
and all commits in the branch at
https://github.com/xwiki/xwiki-platform/commits/feature-thumbnails
Let me know what you think.
I'm offline in the train right now so I cannot check the API you propose so my
comments/questions are general:
* Should this module be limited to thumbnails only or can we make it a more generic
module in charge of handling image manipulations (and caching) in general (and thus
including thumbnails)? I see this as replacing the old image plugin.
The image manipulation module was the idea I had at first indeed.
Unfortunately I later realized there were too much pre-requisites in
order for me to do it in the timeframe I can dedicate to it. For
example, there is the need of hooking a URI to an image
transformation. Which means I would have to also invest time in the
action module (I imagine).
In the end I decided to leave the image transformations to the old
image plugin, and go with a module dedicated to thumbnails for the
rest - thus the name.
* Re caching we should have an "active cache" working like this:
- Save the location of the image as part of the cache key. When the image is a page
attachment, then the location is an Entity Reference to an attachment. We could/should
also handle images on the FS.
- Have the cache be an EventListener listening to attachment events and have it refresh
its cache when there's an attachment udpate
- Save the transformation details as part of the cache key.
- Save the modified images on the FS (FS cache) - that's the cache value.
* We should replace all calls to the image plugin to use this new module and then move
the image plugin to the legacy module.
* As for caching information that user X has an avatar named Z.png I think this is not
generic enough and shouldn't be in this image manipulation module. IMO it should be in
a xwiki-user module in charge of handling users, and indeed that module could have a cache
of user information in memory to prevent user document loading.
No, that's not exactly what it's about. It's about caching information
that property X points to an attachement reference Y. The avatar is
just an illustration of that. IMO this need is generic enough when
speaking about thumbnails. For a true image module, maybe not.
Now the question is do we estimate this thumbnails module (that now
rely on the old image plugin to actually do transformations) is
acceptable enough to be integrated or should we wait until having a
true image module in order to support nice thumbnails. Personnally
while I definitetely share the vision of it. I won't have the time
necessary to work on that generic image module in 3.2 timeframe (and
likely not in 3.3). If we prefer to wait that's also fine by me : I
can live with a patch on the image plugin and the thumbnails module as
an external module.
Jerome.
WDYT?
Thanks
-Vincent
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Jerome Velociter
Winesquare
http://www.winesquare.net/