<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Sophia,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I suggest you set up a QGIS Action on the layer to view the images for a feature.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
For a single feature, your data needs to contain a field with all the image names space separated (so no whitespace within names unless you want to make life difficult!!).
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The action will be a batch file (Windows - painful, or Powershell) or script (Linux/Mac - easy) concatenate the path to each filename, then open each file with an image viewer.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
eg: <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
a point feature has this text as a field (called filename):</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<i>P1010005.JPG P1020700.JPG</i><br>
(the names of two pictures associated with the point feature)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I write a simple shell script (I'm on Linux) to iterate through a list of files (I called it open_images):</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<i>#! /bin/bash</i>
<div><i>#</i></div>
<div><i># iteratively opens images passed on the command line</i></div>
<div><i>#</i></div>
<div><i>FILES=$@</i></div>
<div><i><br>
</i></div>
<div><i>for FILE in $FILES ; do</i></div>
<div><i> eom /home/baw/Pictures/$FILE</i></div>
<i>done<br>
</i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The bash script sets the "$FILES" variable to store the list passed on the command line ($@)<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
It then uses the eom program (simple Linux image viewing program) to iteratively open each file in the list,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
prepending the path to the file for each one.<br>
</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In QGIS, I create an Action on this layer called "open image", it contains the command:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<i>/home/baw/qgis/open_images [%filename%]</i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This is the path to my my script, followed by the list of image names.<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
So, if I then select the action tool in QGIS, when I click on a feature on the canvas, QGIS runs the command as set up in the action, which is my script. It passes the contents of the "filename" field for the feature as a command line parameter. (essentially
runs the command: <i>/home/baw/qgis/open_images <i>P1010005.JPG P1020700.JPG</i></i><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The script then shows the first file, then the second, etc. whenever you click on a feature in QGIS. You can have a list with as many images per feature as you like (within reason... 30000 might be a problem!!<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hope this helps, I find the Action tool very useful for this sort of thing. Not quite as easy in Windows, which is not primarily a command line setup, but can still be done.<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Cheers<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div></div>
<div></div>
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment">
<div class="PlainText">Brent Wood<br>
<br>
Principal Technician, Fisheries<br>
NIWA<br>
DDI: +64 (4) 3860529</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Qgis-user <qgis-user-bounces@lists.osgeo.org> on behalf of chris hermansen <clhermansen@gmail.com><br>
<b>Sent:</b> Saturday, October 17, 2020 16:20<br>
<b>To:</b> sophia couchman <choccycouchman@iname.com><br>
<b>Cc:</b> qgis-user <qgis-user@lists.osgeo.org><br>
<b>Subject:</b> Re: [Qgis-user] Show multiple photos attached to one feature</font>
<div> </div>
</div>
<div>
<div dir="auto">
<div>Sophia and list,<br>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Fri, Oct 16, 2020, 06:20 sophia couchman <<a href="mailto:choccycouchman@iname.com">choccycouchman@iname.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="font-family:Verdana; font-size:12.0px">
<div>
<div>Hi All,</div>
<div> </div>
<div>I have mapped individual trees in a wood using QGIS and QField in a Layer called Trees. Each Tree/Feature contains a number of fields. I included a field for taking photographs and for each tree I took a number of photographs, anywhere from 2 to 6. </div>
<div> </div>
<div>I then brought the QField data onto the computer. When I right click on an individual feature using the Identify Features arrow the Identify Results box appears. It contains all the fields including the photo field but this contains only one photograph
in this format- DCIM/trees_20201010165100197.jpg but not the rest. How can I have the rest of the photographs listed here too?</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">I think that if you have up to six photos you are going to need up to six fields to put them in, are you not?</div>
<div dir="auto"><br>
</div>
<div dir="auto">Alternatively you could have a oneto zero or many relationship between your tree table and a separate photo table, which may be more difficult for you to manage.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Some databases will support an array of items but not sure if / how that is manifested in QGIS.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Chris</div>
</div>
</div>
</div>
<table style="width: 600px; font-size: 8pt; font-family: Arial" cellspacing="20">
<tbody>
<tr>
<td><a href="https://www.niwa.co.nz"><img src="https://www.niwa.co.nz/static/niwa-2018-horizontal-180.png"></a>
</td>
<td>
<table style="width: 500px">
<tbody>
<span>Brent Wood<br>
<font color="#1793d2">Principal Technician - GIS and Spatial Data Management</font><br>
<font color="#1793d2">Programme Leader - Environmental Information Delivery</font><br>
+64-4-386-0529 | <br>
National Institute of Water & Atmospheric Research Ltd (NIWA)<br>
301 Evans Bay Parade Hataitai Wellington New Zealand<br>
<b>Connect with NIWA:</b> <a href="https://www.niwa.co.nz">niwa.co.nz</a> <a href="https://www.facebook.com/nzniwa">
Facebook</a> <a href="https://www.linkedin.com/company/niwa">LinkedIn</a> <a href="https://twitter.com/niwa_nz">
Twitter</a> <a href="https://www.instagram.com/niwa_science">Instagram</a> </span>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<font face="Arial" size="1">To ensure compliance with legal requirements and to maintain cyber security standards, NIWA's IT systems are subject to ongoing monitoring, activity logging and auditing. This monitoring and auditing service may be provided by third
parties. Such third parties can access information transmitted to, processed by and stored on NIWA's IT systems</font>
</body>
</html>