[silva-dev] low quality images after importing them into silva document
Jasper Op de Coul
jasper at infrae.com
Thu Aug 2 15:04:38 CEST 2007
Hi Valentim,
Thanks for your mail.
Valentim Branquinho wrote:
> Hi all!
>
> When working in Silva, importing images and putting them into a Silva
> Document, I was feeling that something wrong was happening with images, in
> Kupu.
<snip>
> Seems that the image is being resized, to 100%, when setting a new
> modification date.
> 'An image scaling to 100% is done even if the image doesn't need to be
> scaled' and so, the final image loses quality.
>
> To solve this, Daniel told me to make some changes in Silva/Image.py:
> # In line 502
> if self.web_scale == '100%' and image.info.get('duration', 0):
> # changed to:
> if self.web_scale == '100%':
>
> After some tests, this change seems to be working perfectly, the images now
> doesn't lose any quality.
>
Right, although this works, it gives a very non-obvious caching error.
If an image is being thumbnailed, the modification-date headers in the
http request get updated. Then if the image is set back to 100% again.
The modification date should be newer then the old thumbnail date,
otherwise the client browser does not know that the image has changed.
The best solution for this would be to update the modification time of
the original image when 100% scaling is chosen (so it's newer then the
thumbnailed image), but because we saw no obvious way to do this, we
rescaled the image to 100%.
Looking back, this was not a good solution. I looked at the problem
again, and implemented it so that the modification headers do get
updated, although the image is not rescaled.
This is checked into svn on the silva-2.0 branch and the trunk.
Best regards,
Jasper Op de Coul
> Regards!
>
> ................................
> Valentim Branquinho
> Taskforce Internet CIUC GCI
> University of Coimbra UC.PT
>
> Tel: +351 239 853 188
> Email: valentim at ci.uc.pt
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> silva-dev mailing list
> silva-dev at lists.infrae.com
> https://lists.infrae.com/mailman/listinfo/silva-dev
More information about the silva-dev
mailing list