[Lizmap] Atlas printing with images from media folder

G. Wagner, Wagner-IT info at wagner-it.de
Mon Oct 30 12:15:47 PDT 2023


Hi,

 

thank you very much for the feedback.

 

I had made it very simple.

In the popup window with Widget Type "Attachment" (relative path and as Integrated Document Viewer "Image" (auto).

This works fine in the Lizmap popup (Automatic).

 

In the Atlas print template I had added the photos as "Picture" (Raster image) with the variable (Field type: string) "foto1". This works fine in the local QGIS but not in the Lizmap client.

 

With the HTML code from Alain (<table> ....) it now works fine for me in the Lizmap client.

Thank you very much for the detailed help.

 

Regards

 

 

WAGNER-IT

Ingenieurbüro für Geoinformatik
Günter Wagner
Carl-Orff-Weg 7
79312 Emmendingen
Tel.:  07641/9621668
Fax:  07641/915599
www.wagner-it.de <http://www.wagner-it.de/> 

 

Von: Alain le gallou <alain.legallou at agglo-fecampcauxlittoral.fr> 
Gesendet: Montag, 30. Oktober 2023 12:47
An: Arnaud Vandecasteele <arnaud.sig at gmail.com>; Etienne Trimaille <etrimaille at 3liz.com>; G. Wagner, Wagner-IT <info at wagner-it.de>
Cc: lizmap at lists.osgeo.org
Betreff: RE: [Lizmap] Atlas printing with images from media folder

 

Hello,

 

I manage to print images in an atlas layout and to show them in the popup without problem.

 

In the popup, I use this code :

[% CASE

                        WHEN "photo1" IS NOT NULL OR trim("photo1") != ''

                        THEN concat(

                            '<p>', '<b>Photo N°1</b>', '<div class="field">', 

                    concat( '<a href="', "photo1", '" target="_blank">',

                                               ' <img src="',"photo1", '" width="100%" title="Photo N°1">', ' </a>'),

'</div>', '</p>' )

                        ELSE ''

                    END %]

 

where photo1 is like : « ../media/upload/name_of_the_project/name_of_the_layer/name_of_the_field/name_of_the_picture.jpg »

 

In the atlas layout, i use an HTML frame with this code :

<table>

<tr>

                               <td>

                                               [%if( attribute(@atlas_feature,'photo1') IS NOT NULL,

                                                               concat('<img src=',attribute(  @atlas_feature ,  'photo1'  ),' width=100%>'),'')%]

                               </td>

                </tr>

</table>

 

With this example, it’s OK under Lizmap Web Client. I haven’t tried under QGIS but I think it will be OK if I had the same tree structure.

 

I hope this feedback will help you.

                

Regards.

 


 <https://www.agglo-fecampcauxlittoral.fr/> 

Alain LE GALLOU

Géomaticien / Chargé du Système d'Information Géographique (SIG)
Communauté d’Agglomération Fécamp Caux Littoral
825, route de Valmont - 76 403 Fécamp Cedex
Tél. : 02 35 10 48 48
Port. : 06 14 19 52 51
Fax : 02 35 10 31 66
Mail :  <mailto:alain.legallou at agglo-fecampcauxlittoral.fr> alain.legallou at agglo-fecampcauxlittoral.fr
Site internet :  <http://www.agglo-fecampcauxlittoral.fr/> www.agglo-fecampcauxlittoral.fr

 




Adoptez l'éco-attitude. 
N'imprimez ce courriel que si c'est vraiment nécessaire

				

 

 

De : Lizmap <lizmap-bounces at lists.osgeo.org <mailto:lizmap-bounces at lists.osgeo.org> > De la part de Arnaud Vandecasteele via Lizmap
Envoyé : lundi 30 octobre 2023 11:26
À : Etienne Trimaille <etrimaille at 3liz.com <mailto:etrimaille at 3liz.com> >
Cc : lizmap at lists.osgeo.org <mailto:lizmap at lists.osgeo.org> 
Objet : Re: [Lizmap] Atlas printing with images from media folder

 

Hi,

I remember encountering the same problem a few months ago. 
I think we had a discussion about an improvement made by René-luc.

But I can't find our discussion in my emails...

Adding images in an atlas was not possible, it is like they were not fully loaded.

Regards,

Arnaud

 

On Mon, Oct 30, 2023 at 12:27 PM Etienne Trimaille via Lizmap <lizmap at lists.osgeo.org <mailto:lizmap at lists.osgeo.org> > wrote:

Hi,

Does a static logo/picture just stored in 'media/' works ?

It should be, anyway, without expressions.

But I sometimes use an expression with it doesn't work : https://docs.lizmap.com/current/en/publish/configuration/print.html#adding-your-own-images-in-a-layout

 

On 25/10/2023 20:48, G. Wagner, Wagner-IT via Lizmap wrote:

Hi,
 
 
 
I am photographing and saving images directly from the Lizmap client. The
images are saved autom. under ./media/......
And also displayed again in the popup window.
 
 
 
Now I want to use these images also in the atlas print.
 
 
 
If I copy the complete media directory locally, the atlas print incl. the
images in the local QGIS works fine. 
 
 
 
But the images are not found in the atlas print in the WebClient. Is there
a trick?
 
 
 
Thanks and greetings
 
 
 
Günter
 
 
 
 
 
 
 
QGIS Server 3.22.16 (Ubuntu) with Lizmap 3.6.7
 
 
 
 
 
 
 
WAGNER-IT
 
Ingenieurbüro für Geoinformatik
Carl-Orff-Weg 7
79312 Emmendingen
Tel.:  07641/9621668
Fax:  07641/915599
www.wagner-it.de <http://www.wagner-it.de>   <http://www.wagner-it.de/> <http://www.wagner-it.de/> 
 

 

_______________________________________________
Lizmap mailing list
Lizmap at lists.osgeo.org <mailto:Lizmap at lists.osgeo.org> 
https://lists.osgeo.org/mailman/listinfo/lizmap

-- 

Etienne Trimaille 
Géomaticien 
 <http://www.3liz.com> www.3liz.com 

Tel. 06 12 93 11 39 
Bureau 
31, rue de l'Argenterie 
34000 Montpellier 
Siège social 
73, allée Kleber 
Boulevard de Strasbourg 
34000 Montpellier 

 

_______________________________________________
Lizmap mailing list
Lizmap at lists.osgeo.org <mailto:Lizmap at lists.osgeo.org> 
https://lists.osgeo.org/mailman/listinfo/lizmap



-- 

--------------------------------------------------------------------
Arnaud Vandecasteele

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/lizmap/attachments/20231030/bab02ea4/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 26278 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/lizmap/attachments/20231030/bab02ea4/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.gif
Type: image/gif
Size: 1222 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/lizmap/attachments/20231030/bab02ea4/attachment-0001.gif>


More information about the Lizmap mailing list