For each feature I want a picture related to that feature. So its obvious to have written a path in the tables attribute. Then I´ll label that attribute somehow by brackets like [%path%]. But it´s not that simple and need some guidance how to write it correctly?
Another convenient way to get the path of your pictures if they are located in your project directory is to use the project_folder variable from Field calculator:
This is especially useful in the print composer or Atlas when using a relative save path for your project since if you move the whole project folder, the picture path will be updated in the image source.
An example of the syntax would be:
This is will retrieve the project folder path, then goes to the picture folder path and finally retrieves the picture_id from your attribute table.
And finally if you have some features which don't have a picture linked to it, you can avoid the ugly big red cross filling the blank image space by using a condition such as:
CASE WHEN "picture_id" is not null THEN @project_folder ||'/field_pictures/'||"picture_id" ELSE ' ' END