How do you display a photo map tip in QGIS 3 on Windows?

As a new user I'm not sure if this is my lack of experience or a bug, so I've tried to simplify it as far as I can:

This is the contents of the Layer Display properties.

Properties -> Display

<div style="width:400;height:400">
<div><img src="C:\Local\aa.jpg" width="350" /></div>

and this is how it appears:

Maptip as it appears

C:\Local\aa.jpg is real file I'm using to try to figure out what the problem is. What am I doing wrong?

  • There's a forward slash at the end of the file path that looks out of place to me.Try <img src="C:\Local\aa.jpg" width="350"> instead of <img src="C:\Local\aa.jpg" width="350" />
    – csk
    Mar 12, 2018 at 19:19
  • 1
    That is for closing the img tag, which would be necessary in XHTML. I tried taking it out and it made no difference, thanks for the suggestion.
    – sandyscott
    Mar 12, 2018 at 19:32

1 Answer 1


Will you add file:/// before the drive letter C: ?

<img src="file:///C:/Local/aa.jpg" width="350" />
  • That fixed it, thank you! I'd previously tried the file:/// thing (and swapping the backslashes to slashes, but hadn't realized that you need 3 slashes, not 2.
    – sandyscott
    Mar 14, 2018 at 12:29
  • 1
    Thanks @sandyscott glad it worked. Yes, me too, tried 2 slashes first, then three by luck.
    – Kazuhito
    Mar 14, 2018 at 14:02
  • 1
    This helped me, too. 3 slashes are required for Windows systems. Linux paths already have one at the start. file:///C:\Users\username\my_photo.jpg, vs file:///home/username/my_photo.jpg. Mar 11, 2019 at 11:32
  • Maybe also worth mentioning is that, on Windows at least, it doesn't seem to care about the direction of slashes. I've just tested it with both variations and a combination(ie c:\gis\photos/2019-09-24 12.46.14.jpg works!). That is the way the ImportPhotos plugin formats it in QGIS 3.8.1
    – marcp
    Sep 25, 2019 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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