Opened 13 years ago

Last modified 11 years ago

#279 new enhancement

Images could have anchors to PDF version of image

Reported by: Peter Johansson Owned by: Jari Häkkinen
Priority: major Milestone: svndigest 0.x+
Component: output Version: trunk
Keywords: Cc:

Description (last modified by Jari Häkkinen)

related to #405

This should be configurable. Default no anchor.

This should be fairly straightforward when plplot is functional in svndigest (ticket:97)

Change History (18)

comment:1 Changed 11 years ago by Jari Häkkinen

Description: modified (diff)
Milestone: svndigest 0.x+svndigest 0.8

comment:2 Changed 11 years ago by Peter Johansson

Description: modified (diff)

Why not let there be an anchor all the time and let it be configurable where the anchor should go? If so, this must be design in conjunction with ticket:405.

Perhaps let the default be PNG, and the default in (#405) also be PNG that we only need to create one image.

Output wise I think images (no matter of format) should be located in the same directory now, i.e., if we produce both png and pdf the live together in the same directory as file.png and file.pdf.

comment:3 Changed 11 years ago by Peter Johansson

I'll implement the support in Configuration class just as for ticket:405.

comment:4 Changed 11 years ago by Peter Johansson

(In [996]) refs #279. Added support for anchor_image format in Configuration class and extended test of Configuration.

comment:5 Changed 11 years ago by Peter Johansson

Owner: changed from Jari Häkkinen to Peter Johansson
Status: newassigned

comment:6 Changed 11 years ago by Peter Johansson

(In [1023]) added new cmd option 'anchor-format'. refs #279

comment:7 Changed 11 years ago by Peter Johansson

(In [1024]) extracting format from Configuration inside function 'image' rather than passing Configuration::instance().image_format() every single time. refs #279

comment:8 Changed 11 years ago by Peter Johansson

(In [1025]) support for png/png case, refs #279

comment:9 Changed 11 years ago by Peter Johansson

(In [1026]) create anchor plot if anchor_format is different from format. refs #279

comment:10 Changed 11 years ago by Peter Johansson

Left is to implement an anchor from the svg <object> tag. Anyone has a pointer on how to do that?

comment:11 Changed 11 years ago by Peter Johansson

This code

<a href="http://www.lu.se">
<object data='summary_plot.png' type='image/png' width='600'>
</object>
</a>

creates an image that is a link to... whereas this code

<a href="http://www.lu.se">
<object data='summary_plot.svg' type='image/svg+xml' width='600'>
</object>
</a>

creates an image that is not a link...

Is this due to limitations in Firefox?

comment:12 in reply to:  11 ; Changed 11 years ago by Jari Häkkinen

Replying to peter:

Is this due to limitations in Firefox?

Maybe you need the object/embed trick in http://dev.thep.lu.se/svndigest/browser/trunk/lib/html_utility.cc#L71 is needed? The problem is that svg support is not complete in browsers, http://en.wikipedia.org/wiki/Scalable_Vector_Graphics

comment:13 in reply to:  12 Changed 11 years ago by Peter Johansson

Replying to jari:

Replying to peter:

Is this due to limitations in Firefox?

Maybe you need the object/embed trick in http://dev.thep.lu.se/svndigest/browser/trunk/lib/html_utility.cc#L71 is needed? The problem is that svg support is not complete in browsers, http://en.wikipedia.org/wiki/Scalable_Vector_Graphics

I've tried that too... with the same result. The search must go on.

comment:14 Changed 11 years ago by Peter Johansson

(In [1099]) refs #279. add warning when trying anchor_format != svg when format is svg (which is currently not supported).

comment:15 Changed 11 years ago by Peter Johansson

Owner: changed from Peter Johansson to Jari Häkkinen
Status: assignednew

I cannot figure out how to create an anchor from svg to pdf/png image, so unless you (jari) knows I think we postpone this.

comment:16 Changed 11 years ago by Jari Häkkinen

Description: modified (diff)

comment:17 Changed 11 years ago by Jari Häkkinen

I am not sure that current browser can anchor svg-files, or the svg specs might say that it should not be anchorable. wikipedia has solved the issue with generating a png with an svg anchor:

<a href="http://upload.wikimedia.org/wikipedia/commons/8/80/Anchor.svg">
<img alt="Fil:Anchor.svg"
 src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Anchor.svg/500px-Anchor.svg.png"
 height="500" width="500">
</a>

Adding a standard <a href> tag around the <object> tag for the svg case will actually create a link to the svg-file.

<a href=''summary_plot.svg'>
<object data='summary_plot.svg' type='image/svg+xml' width='600'>
<embed src='summary_plot.svg' type='image/svg+xml' width='600' />
</object>
</a>

If one moves the cursor slowly down from the plot there is a thin horizontal area that is linked to the svg-file.

Maybe there is a work around with java script, overlying an empty png with the svg, create something like gif maps. However, I think this ticket should be moved to the future where the browser hopefully support the full svg specs.

comment:18 Changed 11 years ago by Jari Häkkinen

Milestone: svndigest 0.8svndigest 0.x+
Note: See TracTickets for help on using tickets.