Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
9816 มุมมอง

Hello everyone.

On my qweb report for v12, i was able to add a dynamic image using:

<img t-attf-src="data:image/*;base64,{{o.image_field_name}}"/>

This is working and can see the image on the report.

The problem is, I need to resize the image to a specific height and width (not the standard image, image_medium and image_small). I want to be able to choose myself the image height and width

Can anyone help me please?

Thank you in advance

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Try this one

<img t-attf-src="data:image/jpg;base64,{{ object.logo }}" align="left" height="65" width="65" style='margin:0px;padding-top:0px;' />


อวตาร
ละทิ้ง
ผู้เขียน

Hi @Sehrish,

Using your code. Thank you once again.

Regards

my pleasure

ผู้เขียน คำตอบที่ดีที่สุด

Hi everyone,

I found a solution for this specific case.

Using styles I can define the maximum witdh and height for the image and since the images are bigger than the sizes I want, I can set a pre-defined value for maximum height and width.

This is the code:

<img t-attf-src="data:image/*;base64,{{o.image_field_name}}" style="max-height:420px; max-width:425px;"/>

Thank you once again

Regards

Paulo

อวตาร
ละทิ้ง

+1 working in website too :)

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.พ. 25
1783
1
ธ.ค. 23
3509
5
ก.พ. 20
3606
1
ก.ค. 25
1734
0
มิ.ย. 25
2647