<!DOCTYPE html><html><head>
<style type="text/css">body { font-family:'DejaVu Sans Mono'; font-size:12px}</style>
</head>
<body>Am 27.10.2016, 00:12 Uhr, schrieb Nyall Dawson <nyall.dawson@gmail.com>:<br><br><blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px solid; padding-left: 1ex">
<p dir="ltr">On 27 Oct 2016 7:18 AM, "Bernd Vogelgesang" <<a href="mailto:bernd.vogelgesang@gmx.de">bernd.vogelgesang@gmx.de</a>> wrote:<br>
><br>
> Am 26.10.2016, 22:57 Uhr, schrieb Nyall Dawson <<a href="mailto:nyall.dawson@gmail.com">nyall.dawson@gmail.com</a>>:<br>
><br>
>> On 27 Oct 2016 6:51 AM, "Bernd Vogelgesang" <<a href="mailto:bernd.vogelgesang@gmx.de">bernd.vogelgesang@gmx.de</a>> wrote:<br>
>> ><br>
>> > Arghh, sorry for the noise!<br>
>> ><br>
>> > When hovering over the data-driven input button not so hectically, I discovered the explanation that it expects a 0 or 1.<br>
>> > So<br>
>> > case when <br>
>> > 'mypath'|| @atlas_pagename ||'_1.jpeg' IS NULL<br>
>> > THEN<br>
>> > 0<br>
>> > END<br>
>> ><br>
>> > did the trick!<br>
>><br>
>> This is odd... A null picture expression should be rendered empty, not as the red cross. The red cross is intended only as an obnoxious, obvious indicator that a picture path was set but couldn't be found.<br>
>><br>
>> The expression above would only result in 0 if @atlas_pagename is null.<br>
>><br>
>> Nyall<br>
><br>
><br>
> Well, yeah, I was too early to announce the solution. In fact this did not render the missing image, but also not the one which is there :(<br>
><br>
> case when <br>
> '/media/Daten/IVL_Projekte/2016024_Feldhamster_NEA/2_EINGANG_MA/Bernd/QGIS/Fotos/'|| @atlas_pagename ||'_1.jpeg' IS NULL<br>
> THEN<br>
> 1<br>
> ELSE<br>
> 0<br>
> END<br>
><br>
> This should do it. But now I am again where is started: When the image is there, it is rendered, when not, the red cross is exported as well.</p>
<p dir="ltr">That's because that expression is just testing whether the concatenated string itself is null, not whether the corresponding file actually exists.</p>
<p dir="ltr">My advice: make a small python custom function 'file_exists' which checks for the existence of a file. Then change your picture path expression to something like:</p>
<p dir="ltr">Case when file_exists( 'media/' ... Etc) then  'media/' ... Else null end</p>
<p dir="ltr">That should get you the result you are after.</p>
<p dir="ltr">Nyall</p></blockquote><div><br></div><div>Hi Nyall,</div><div><br></div><div>unfortunately, I have still no clue of python.</div><div>I now added blank images for the missing ones :(</div><div><br></div><div>I think I will at least file a bug report for the red cross not being rendered.</div><div><br></div><div>Thanx for your attention</div><div>Bernd</div><blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px solid; padding-left: 1ex">
<p dir="ltr">><br>
> :(<br>
><br>
> Bernd<br>
><br>
>> ><br>
>> > Just amazing!!! <br>
>> ><br>
>> > Thanx<br>
>> > Bernd<br>
>> ><br>
>> > Am 26.10.2016, 22:19 Uhr, schrieb DelazJ <<a href="mailto:delazj@gmail.com">delazj@gmail.com</a>>:<br>
>> ><br>
>> >> Hi,<br>
>> >> what about using the data-defined option near the "Exclude items from export" in the items properties --> Rendering (with a case when expression)?<br>
>> >> <a href="http://docs.qgis.org/2.14/en/docs/user_manual/print_composer/composer_items/composer_items_options.html#rendering-mode">http://docs.qgis.org/2.14/en/docs/user_manual/print_composer/composer_items/composer_items_options.html#rendering-mode</a><br>
>> >><br>
>> >> HTH,<br>
>> >> Harrissou<br>
>> >><br>
>> >> 2016-10-26 22:10 GMT+02:00 Bernd Vogelgesang <<a href="mailto:bernd.vogelgesang@gmx.de">bernd.vogelgesang@gmx.de</a>>:<br>
>> >>><br>
>> >>> Hi,<br>
>> >>> I set up a neat atlas for displaying a row of 50 sample plots. On a second page, I want to show 2 pictures taken of these plots automatically with an expression including the path || @atlas_pagenumber || '_1.jpeg' or '_2.jpeg' to display up to two photos named e.g. 1_1.jpeg, 1_2.jpeg.<br>
>> >>><br>
>> >>> This works really great! The problem is, that for some plots, we do not and have any picture or only one. In composer, these missing images are marked with a big red cross.<br>
>> >>> Unfortunately, these red crosses are also exported, which looks quite shitty.<br>
>> >>><br>
>> >>> Is there any clever way of forcing QGIS not to export these place holders but just not to print anything at this place?<br>
>> >>><br>
>> >>> The only (boring) idea I came up with till now, was to create empty white images and name them accordingly to avoid the red crosses.<br>
>> >>><br>
>> >>> Thanx<br>
>> >>> Bernd<br>
>> >>><br>
>> >>> -- <br>
>> >>> Bernd Vogelgesang<br>
>> >>> Siedlerstraße 2<br>
>> >>> 91083 Baiersdorf/Igelsdorf<br>
>> >>> Tel: 09133-825374<br>
>> >>> _______________________________________________<br>
>> >>> Qgis-user mailing list<br>
>> >>> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
>> >>> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
>> >>> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
>> >><br>
>> >><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Bernd Vogelgesang<br>
>> > Siedlerstraße 2<br>
>> > 91083 Baiersdorf/Igelsdorf<br>
>> > Tel: 09133-825374<br>
>> ><br>
>> > _______________________________________________<br>
>> > Qgis-user mailing list<br>
>> > <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
>> > List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
>> > Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Bernd Vogelgesang<br>
> Siedlerstraße 2<br>
> 91083 Baiersdorf/Igelsdorf<br>
> Tel: 09133-825374<br></p>
</blockquote><br><br><br><div id="M2Signature"><div>-- </div><div>Bernd Vogelgesang<br>Siedlerstraße 2<br>91083 Baiersdorf/Igelsdorf<br>Tel: 09133-825374</div></div></body></html>