Modify

Opened 10 years ago

Closed 7 years ago

#11262 closed defect (fixed)

Image not displayed correctly in Help Window -> Map View

Reported by: raykiddy Owned by: team
Priority: normal Milestone: 15.10
Component: Core Version:
Keywords: help svg html Cc:

Description (last modified by Don-vip)

The image at the start of this Help information is not being displayed correctly. Either the image is bad, or it is being set to the wrong height.


Attachments (1)

JOSM_Help_View.png (52.0 KB ) - added by raykiddy 10 years ago.

Download all attachments as: .zip

Change History (9)

by raykiddy, 10 years ago

Attachment: JOSM_Help_View.png added

comment:1 by Klumbumbus, 10 years ago

There are also some problems on the help start page (Help) in the JOSM Help Browser

  • icons with wrong aspect ratio (same problem like OP)
  • svg do not work at all

comment:2 by Don-vip, 10 years ago

Component: unspecifiedCore

comment:3 by simon04, 9 years ago

Milestone: 15.10

For displaying SVG, this might be the way to go: http://stackoverflow.com/a/16073804, override javax.swing.text.html.HTMLEditorKit.HTMLFactory#create for kind==HTML.Tag.IMG.

For the correct height, the simplest version would be to drop the width information thus showing the image in full width+height (see below). We also might implement a better computation when considering SVG images.

  • src/org/openstreetmap/josm/tools/WikiReader.java

    diff --git a/src/org/openstreetmap/josm/tools/WikiReader.java b/src/org/openstreetmap/josm/tools/WikiReader.java
    index 6094c40..1246efa 100644
    a b protected String readFromTrac(BufferedReader in, URL url) throws IOException {  
    142142                // add a border="0" attribute to images, otherwise the internal help browser
    143143                // will render a thick  border around images inside an <a> element
    144144                b += line.replaceAll("<img ", "<img border=\"0\" ")
     145                         .replaceAll("width=\"(\\d+)\"", "")
    145146                         .replaceAll("<span class=\"icon\">.</span>", "")
    146147                         .replaceAll("href=\"/", "href=\"" + baseurl + "/")
    147148                         .replaceAll(" />", ">")

comment:4 by Don-vip, 9 years ago

Description: modified (diff)
Keywords: help svg html added; Help Window removed

comment:5 by Don-vip, 9 years ago

Resolution: fixed
Status: newclosed

In 8933/josm:

fix #11262 - Images not displayed correctly in Help Browser

comment:6 by stoecker, 7 years ago

See #15864 for a regression due to this.

Last edited 7 years ago by stoecker (previous) (diff)

comment:7 by anonymous, 7 years ago

Resolution: fixed
Status: closedreopened

comment:8 by Don-vip, 7 years ago

Resolution: fixed
Status: reopenedclosed

@anonymous: please don't reopen tickets closed long ago in a previous milestone.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.