I have a layer of CROSS SECTIONS (34) and the same number of IMAGES correspondent of each section. In the cross sections layer I have a column named PHOTOS where I defined this field as "ATTACHMENTS > IMAGES" in the attributes form.

enter image description here

The attribute table for the CROSS SECTIONS is this:

enter image description here

I made a ATLAS of it and I would like to see the images of each CROSS SECTIONS when I run the atlas. I tried to insert this HTML code:

<body style="font-family:calibri;"> <p>  <span style="color:#0c0002;font-weight:bold;"
>CROSS SECTIONS </p>  SECTION NUMBER =  <span style="color:#d91e3d;font-weight:bold;"
 > [% "Cross-Sect"%]</span> </p> <img src="CS19_River_Cross-section_Photo.jpeg"  width="600" height="600" > </p> </body>

to insert the images but it does not work as you can see in the image below:

enter image description here

Can you please tell me, how can I do this? I´m using QGIS 3.4

  • There are two ways to add an image to the print composer. The first is using HTML in an HTML item. The second is using a Picture item. Try the second method. – csk Feb 19 at 19:35

Just use expression to link the attribute as a source for your image like you do in case CROSS SECTIONS attribute [% "Cross-Sect"%]

In your case use:

<img src=[% "PHOTOS"%]  width="600" height="600" >

This retrieve the string (path to photo on your drive) from PHOTOS attribute for atlas feature.

If you can't see image even with manually inserted source, check if the path is correct. Use full path or relative path to QGIS project. Also check the path in the PHOTOS attribute

  • Oto Kaláb, thanks for your help, but it´s not working. Can you please send some prints of the this exercise results if you have there? I don't know but maybe it's because the QGIS version, isn´t it? And if you don´t mind I can send my datas to you. – Paulo Martinho Feb 19 at 15:05
  • I notice the spaces in path in your PHOTOS attribute, remove them. – Oto Kaláb Feb 20 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.