Bug report #20442

QGIS 3.4.1 map tips with images does not work

Added by salvatore fiandaca almost 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Map Canvas
Affected QGIS version:3.4.1 Regression?:No
Operating System:win 10 - osgeo4w nightly Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:28262

Description

I used this html code:

<img src="[% @project_folder || '/' || "filename" %]" width = "200">

in QGIS 2.18 it works, in QGIS 3.4.1 it does not work

projects and data:
https://mega.nz/#!tIxG2CoT!W5xz_2VMSF5Y7DWiVLoRXZh5Q4GFdMGn6kluwcTVAzw

scree218.png - screeshot 2.18 (84 KB) salvatore fiandaca, 2018-11-10 07:25 PM

screen341.png - SCREESHOT 3.4.1 (43.4 KB) salvatore fiandaca, 2018-11-10 07:25 PM

niente.png (114 KB) salvatore fiandaca, 2018-11-10 10:32 PM

wow.png (128 KB) salvatore fiandaca, 2018-11-11 10:14 AM

History

#1 Updated by Jan Lippmann almost 6 years ago

in my project it works with 3.4.1

html:

<img width="250px" src="[% "foto_url" %]" />

foto_url is a virtual field with for instance following content "file:///C:/fotos/folder.jpg"

#2 Updated by salvatore fiandaca almost 6 years ago

Jan Lippmann wrote:

in my project it works with 3.4.1

html:

<img width="250px" src="[% "foto_url" %]" />

foto_url is a virtual field with for instance following content "file:///C:/fotos/folder.jpg"

I tried but it still does not work.
I also changed the \ con / but nothing, it does not work.

#3 Updated by Jan Lippmann almost 6 years ago

try this:

<img src="[% 'file:///' || @project_folder || '/' || "filename" %]" width = "200">

it works with your project... i have tested

#4 Updated by salvatore fiandaca almost 6 years ago

Jan Lippmann wrote:

try this:

<img src="[% 'file:///' || @project_folder || '/' || "filename" %]" width = "200">

it works with your project... i have tested

so you need to write 'file: ///' ||
I think it's a bug !!!

thank you!!!

this works:

<img src = "[% 'file: ///' ||" path "%]" width = "200">
<img src = "[% 'file: ///' || @project_folder || '/' ||" filename "%]" width = "200">

#6 Updated by Giovanni Manghi almost 6 years ago

  • Status changed from Open to Closed
  • Resolution set to invalid

#7 Updated by salvatore fiandaca almost 6 years ago

IMHO is not a bug but it is a regression

adding 'file: ///' involves waste of time

#8 Updated by Giovanni Manghi almost 6 years ago

salvatore fiandaca wrote:

IMHO is not a bug but it is a regression

adding 'file: ///' involves waste of time

is a standard, https://en.wikipedia.org/wiki/File_URI_scheme

Also available in: Atom PDF