Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

[SOLVED] Quality of picture in PDF - image_resize_image

By
Selverine
on 7/26/15, 5:37 AM 557 views

Hi,


Does someone already used image_resize_image (tools/image.py) in order print some picture inside some pdf? (Quotation for exemple?).

I am using it and I am not so satisfy about the quality of the picture. The image_resize_image makes my picture blurred.

I would like to know some tips to have better quality.

Thank you a lot,


Selverine

Here my code:

 if base64_source:
		image_stream = io.BytesIO(base64_source.decode(encoding))
    		image = Image.open(image_stream)
		if image.size[0] > image.size[1] :
        		return_dict[shape_name] = image_resize_image_medium(base64_source, size=(160,None),avoid_if_small=avoid_resize_medium)
		else:
        		return_dict[shape_name] = image_resize_image_medium(base64_source, size=(None,160),avoid_if_small=avoid_resize_medium)
0
Selverine
On 7/29/15, 1:11 PM

So,

I think I will not use this function in order resize my picture before print it in PDF, but I will write directly in rml the dimension that I want.

Good point: Good quality.

Bad point: I need to have a fix size for the picture.


Selverine

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/26/15, 5:37 AM
Seen: 557 times
Last updated: 8/2/16, 4:07 AM