Bug 459752

Summary: erroneous html generated by default; plus a request for a setting
Product: [Applications] kimagemapeditor Reporter: Shawn Rutledge <s>
Component: generalAssignee: Jan Schaefer <j_schaef>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 22.08.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Shawn Rutledge 2022-09-27 17:29:33 UTC
SUMMARY
1. the <img> tag is missing its usemap property
2. the <img> tag is not closed
3. the <img> tag uses an absolute path

STEPS TO REPRODUCE
1. load an image
2. define some areas
3. save the html

OBSERVED RESULT
<html>
<head>
</head>
<body>

<img src="/home/rutledge/expt/html/imagemap/e680.png">
<map name="mapagain">
  <area shape="rect" alt="Mail" href="mail.html" coords="120,4,176,44" />
</map></body>
</html>


EXPECTED RESULT
<html>
<head>
</head>
<body>

<img src="e680.png" usemap="#mapagain"/>
<map name="mapagain">
  <area shape="rect" alt="Mail" href="mail.html" coords="120,4,176,44" />
</map></body>
</html>

Probably it's best to have a setting for whether to use absolute or relative links.

I see that you have Image | Edit Usemap to set the usemap property, but the problem is it's blank by default, so it's easy to forget to do that.  I think it should use the map name by default.  That is "unnamed", which is noticeable already in the Maps list at startup, so I can see that I should probably rename it.  But I can't see the usemap name in the UI, it's just when I save the html that I find out that usemap is missing and it doesn't work in the browser.

SOFTWARE/OS VERSIONS
Linux: latest Arch Linux; running plain X11 desktop, not KDE
Qt Version: 5.15.6+kde+r177-1

ADDITIONAL INFORMATION

Anyway thanks for writing this!  I was glad to see that there is such a utility at all.