Hi Andreas,
On 09/23/2010 10:10 AM, Andreas Hahn wrote:
Just curious, will there be an option preserved to
stick with the old
behaviour (i.e. no server-side resizing even if there are height and
width parameters specified) ? The simple reason is that we are doing all
of our documentation, screenshots e.t.c this way and come up with
thumbnails on the page but link them to lightboxes to make them appear
fullsize just in case you want to see the details ...
I'm just wondering how then we will have to specify this use case with
future releases ...
Sure, you can set:
rendering.imageDimensionsIncludedInImageURL = false
(it's true by default) in xwiki.properties configuration file.
Note that the new behavior applies only to images included using the
xwiki/2.0 syntax, if at least one of the image dimensions are specified:
[[image:picture.png||width="150px"]]
So if you include images in a different way (e.g. xwiki/1.0 syntax or
HTML syntax) then you shouldn't be affected. In other words, if you
control the image URL and you don't specify image dimensions in the
query string then the original image will be loaded.
Now, you say that you display thumbnails on the page and when the user
clicks them the full size image is displayed. Are the thumbnails
generated on the server or are they in fact the original images resized
by the browser? Couldn't you use the new behavior for displaying the
thumbnails and then use the image URL without the query string to load
the full size image in the light box? This way users that are not
interested in the details don't have to download full size images when
viewing the page.
An example of this behavior, without the light box is:
[[[[image:picture.png||width="150px"]]>>attach:picture.png]]
Hope this helps,
Marius
kind regards
Andreas
Am 08.09.2010 22:40, schrieb Marius Dumitru Florea:
Hi devs,
Currently the image plugin [1] allows us to create image thumbnails by
specifying the image width and/or height in the query string of the
image attachment download URL:
/xwiki/bin/download/Spage/Page/image.jpg?width=100
I propose that we:
(A) Use the image width and/or height (when they are specified in the
image syntax using pixel unit) to resize the image on the server side.
For instance:
[[image:logo.jpg||width="100px"]]
will be linked to
/xwiki/bin/download/Spage/Page/logo.jpg?width=100
and
[[image:logo.jpg||style="height: 50px; width: 70px"]]
will be linked to
/xwiki/bin/download/Spage/Page/logo.jpg?width=70&height=50
The image plugin also accepts a quality parameter that controls the
compression quality when encoding jpeg images. The default value of this
parameter (i.e. when not specified in the URL) is configurable. I
propose we use 0.3 by default, 1 representing the best quality.
(B) Add the ability to limit the image dimensions (preserving aspect
ratio) when the image width and/or height are not specified in the image
syntax (or when they are not using pixel unit). The width and height
limit will be configurable and -1 by default (i.e. no limitation). For
instance:
image:logo.jpg
will be linked to
/xwiki/bin/download/Spage/Page/logo.jpg?width=1024
when width limit is 1024, and to
/xwiki/bin/download/Spage/Page/logo.jpg?width=1024&height=768&keepAspectRatio=true
when width limit is 1024 and height limit is 768. Note that in this case
the image aspect ratio is preserved. The image is resized to best fit
the limits. If the user want to bypass the limit he has to specify the
image width/height in the image syntax.
I'm +1 for both (A) and (B). WDYT?
Thanks,
Marius
[1]
http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/…
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs