Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map tips does not show images correctly anymore... on Linux #23581

Closed
qgib opened this issue Oct 3, 2016 · 18 comments
Closed

map tips does not show images correctly anymore... on Linux #23581

qgib opened this issue Oct 3, 2016 · 18 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Map Tools Related to non-digitizing map tools Regression Something which used to work, but doesn't anymore
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Oct 3, 2016

Author Name: Adam Szieberth (@SzieberthAdam)
Original Redmine Issue: 15658
Affected QGIS version: 2.18.11
Redmine category:map_tools


I faced with the same issue:

http://gis.stackexchange.com/questions/211117/map-tip-display-text-in-qgis-2-16-pictures-not-showing-up-anymore

Map tips are not showing images correctly; there are scrollbars instead.

My formula:

<h2> [% "filename" %] </h2>
<br>
<img src="[% "filepath" %]" width="400" />

Before (2.10.x) I saw the filename and the photo below correctly.



Related issue(s): #20335 (duplicates), #24310 (duplicates)
Redmine related issue(s): 12141, 16401


@qgib
Copy link
Contributor Author

qgib commented Oct 3, 2016

Author Name: Adam Szieberth (@SzieberthAdam)


Enclosing content in divs worked as I posted in my answer on SE:

<div style="width:400;height:320">
<div style="height:20; margin: 0 auto;">
[% "filename" %]
</div>
<div style="height:300; margin: 0 auto;">
<img style="max-width:400px; max-height:300px;" src="[% "filepath" %]" />
</div>
</div>

However, I believe many have formatted they map tip html according to this answer (as did I):

http://gis.stackexchange.com/a/160131/44921

This issue is related to the plain and common practice mentioned by this SE answer.

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Alexander Bruy (@alexbruy)


@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Alexander Bruy (@alexbruy)


Raising priority as this is regression.


  • os_version was changed from XP to
  • description was changed from I faced with the same issue:

http://gis.stackexchange.com/questions/211117/map-tip-display-text-in-qgis-2-16-pictures-not-showing-up-anymore

Map tips are not showing images correctly; there are scrollbars instead.

My formula:

[% "filename" %]


Before (2.10.x) I saw the filename and the photo below correctly. to I faced with the same issue:

http://gis.stackexchange.com/questions/211117/map-tip-display-text-in-qgis-2-16-pictures-not-showing-up-anymore

Map tips are not showing images correctly; there are scrollbars instead.

My formula:

[% "filename" %]


Before (2.10.x) I saw the filename and the photo below correctly.

  • priority_id was changed from Normal to Severe/Regression
  • operating_system was changed from Windows to

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • version was changed from 2.16.3 to 2.18.4
  • fixed_version_id was configured as Version 2.18

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • regression was configured as 1

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • priority_id was changed from Severe/Regression to High

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • easy_fix was configured as 0

@qgib
Copy link
Contributor Author

qgib commented May 12, 2017

Author Name: Giovanni Manghi (@gioman)


work as expected on 2.18.7


  • status_id was changed from Open to Closed
  • resolution was changed from to not reproducable

@qgib
Copy link
Contributor Author

qgib commented Jun 9, 2017

Author Name: Giovanni Manghi (@gioman)


seems with local image is still broken and in 2.14 was ok.


  • version was changed from 2.18.4 to 2.18.9
  • status_id was changed from Closed to Open
  • resolution was changed from not reproducable to

@qgib
Copy link
Contributor Author

qgib commented Jun 9, 2017

Author Name: Alexander Bruy (@alexbruy)


Seems now you need to specify image size and follow strict HTML rules, then it works.


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Jul 19, 2017

Author Name: Pavel Diptan (Pavel Diptan)


Alexander Bruy wrote:

Seems now you need to specify image size and follow strict HTML rules, then it works.

Can you provide an example of working HTML code? The one specified by Adam Szieberth doesn't work.

The HTML code that used to work for me pre 2.14.x:

[%CONCAT('<img src="',"filepath",'" width="640"></img>')%]

The new HTML code as recommended above doesn't work for me:

<div style="width:400;height:320">
<div style="height:20; margin: 0 auto;">
[% "filename" %]
</div>
<div style="height:300; margin: 0 auto;">
<img style="max-width:400px; max-height:300px;" src="[% "filepath" %]" />
</div>
</div>

Below are a bunch of images trying to explain my problem as clearly as possible and my system information. Does anyone know why Map tips don't work (they are not working on a whole bunch of Linux machines, unable to test on Windows). Is there an error in the code I am using?

When using map tips, the filename of the image comes up, but the image itself is blank:
!Map_Tips_empty_dialog.png!

The HTML code is as specified above:
!Map_Tips_code.png!

The attribute table showing filepath:
!Attribute_table.png!

The weird thing is that identify features works:
!identify_features_working.png!

When filepath is set to be 'Photo':
!identify_features_code.png!

My system:

Kernel: 4.4.0-83-generic x86_64 (64 bit)
Desktop: MATE 1.14.1  Distro: Linux Mint 18 Sarah
QGIS version 2.18.10
QGIS code revision 59e0f78
Compiled against Qt 4.8.7
Running against Qt 4.8.7
Compiled against GDAL/OGR 1.11.3
Running against GDAL/OGR 1.11.3
Compiled against GEOS 3.5.0-CAPI-1.9.0
Running against GEOS 3.5.1-CAPI-1.9.1 r4246
PostgreSQL Client Version 9.5.2
SpatiaLite Version 4.3.0a
QWT Version 5.2.3
PROJ.4 Version 492
QScintilla2 Version 2.9.1

  • 11189 was configured as Map_Tips_empty_dialog.png
  • 11186 was configured as Attribute_table.png
  • 11187 was configured as identify_features_code.png
  • 11190 was configured as identify_features_working.png
  • 11188 was configured as Map_Tips_code.png

@qgib
Copy link
Contributor Author

qgib commented Jul 19, 2017

Author Name: Giovanni Manghi (@gioman)


The HTML code that used to work for me pre 2.14.x:

[...]

The new HTML code as recommended above doesn't work for me:

[...]

this snippets as also the one in the description... al works fine on Windows 2.14.16 or 2.18.10, they "just" don't work on Linux.


  • version was changed from 2.18.9 to 2.18.10
  • subject was changed from map tips does not show images correctly anymore to map tips does not show images correctly anymore... on Linux
  • status_id was changed from Closed to Open
  • operating_system was changed from to Ubuntu 16.04 (possibly others)

@qgib
Copy link
Contributor Author

qgib commented Jul 25, 2017

Author Name: Giovanni Manghi (@gioman)


  • version was changed from 2.18.10 to 2.18.11

@qgib
Copy link
Contributor Author

qgib commented Oct 3, 2017

Author Name: Alexander Bruy (@alexbruy)


Works fine on all systems with strict HTML

<img src="file:///path/to/image.png" width=200 height=200/>


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Oct 3, 2017

Author Name: Giovanni Manghi (@gioman)


  • resolution was changed from to not reproducable
  • status_id was changed from Feedback to Closed

@qgib qgib closed this as completed Oct 3, 2017
@qgib
Copy link
Contributor Author

qgib commented Nov 28, 2017

Author Name: Alexander Bruy (@alexbruy)


@qgib
Copy link
Contributor Author

qgib commented Dec 28, 2017

Author Name: Bernd Vogelgesang (Bernd Vogelgesang)


Nice to finally find that this works when adding "file://" to the path.
But still it's a regression from the state before, when a simple path like it is generated e.g. from Photo2shape-plugin does not work anymore.
Neither intuitive nor to be expected.
Furthermore it's not documented anywhere, and after month of not being able to get some work done which would have relied on that function, I accidently stumbled upon this bug report.

@qgib
Copy link
Contributor Author

qgib commented Sep 9, 2018

Author Name: Marco Bernasocchi (@mbernasocchi)


The most portable way to use this (assuming you have the images in the same folder as the project) currently (tested on 3.2 - ubuntu) is:

<img src="file://[%  @project_home  %]/[% "your_relative_picture_path" %]" />

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Map Tools Related to non-digitizing map tools Regression Something which used to work, but doesn't anymore labels May 25, 2019
@qgib qgib added this to the Version 2.18 milestone May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Map Tools Related to non-digitizing map tools Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

No branches or pull requests

1 participant