Re: low quality images after importing them into silva document

Daniel Nouri <[email protected]> Tue, 24 Jul 2007 14:03:09 +0200
Newsgroups gmane.comp.web.zope.silva.devel
Message-ID <[email protected]>
Thanks for the report, Valentim.  What I would suggest here is to set the
modification date of the image directly, and not scale it to 100% to set it
indirectly.

This should probably be reported here, so that we don't forget:
https://bugs.launchpad.net/silva/


Thanks,
Daniel



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.
> Importing images into Silva, OK, working fine. But when I "place reference"
> in Kupu and put a image in a document, the image seems to lose quality
> (became blur and without definition).
> I do some tests and you can see the different between files, in Silva image
> proprieties and the same image in published document or in Kupu editor,
> after "place reference":
> 
> Take a look in this print:
> http://www.uc.pt/pessoal/valentim/kupu_image_blur.jpg
> 
> It's obvious that the image was been compressed. But why?
> In the mIRC, I asked Daniel Nouri for help on this, if he already saw this
> effect in Kupu.
> He was so surprised as I and after some tests he realized that something
> wrong was happing when putting images in documents.
> 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.