display the pagetitle() in linkmaps

without this patch, linkmaps display underscores and underscore escape
sequences in the rendered output.

this introduces a pageescape function, which invoces pagetitle() to get
rid of underscore escapes and wraps the resulting utf8 string
appropriately for inclusion in a dot file (using dot's html encoding
because it can represent the '\"' dyad properly, and because it doesn't
need special-casing of newlines).
set the file type parameter after reading the image

imagemagick, when reading an image, sets its magick parameter to
indicate the file type, overriding the explicitly set file type for
output if it is set at creation.

as a result, previously (with graphicsmagick-libmagick-dev-compat
1.3.18-1 providing Image::Magick), svg output files were not png,
neither svg, but mvg (imagemagick vector graphics).
add pdf support to the img directive

this is trivial as pdf is supported by imagemagick, and just needs an
explicit mention to enable conversion.
add pagenumber parameter

this allows picking a page from a pdf. also, this enhances performance
greatly when rendering pdfs, as only the first page is rasterized.
(otherwise, imagemagick would treat the pdf as a list of images, work
with all of them, until finally only the first page gets saved). the
default parameter of 0 will select the single image contained in typical
image files anyway, so no specialcasing between single- and multifile
containers is needed.
add unittests for img

this focuses on the features introduced in
http://ikiwiki.info/bugs/svg_and_pdf_conversion_fails/
make unittest work with all all three packages that provide perlmagick
drop unittest workaround for perlmagick

this was actually http://bugs.debian.org/753770
drop unittest workaround for new perlmagick

just install -extra to make it work
img plugin: split resizing calculations and actual resizing

there is now a size calculating part (which chooses a final size) and a
scaling part (which triggers if the sizes calculated by the former
indicate a downscaling).

this solves the issue of unproportional upscalings
(bugs/image_rescaling_distorts_with_small_pictures).

also, "small" pdf files (or pdf files without explicit size settings),
which would not be converted under the old mechanism, now get rendered
to pngs.

this commit affects a unit test: while svgs were previously
unconditionally rendered to pngs, this now only happens on downscaling.
this is intentional -- while a small version of an svg graphic is
likely to be more compact when rendered (eg as a preview), a large
version would not have that benefit, and why convert something that
browsers basically can show and be inconsistend with how other images
are handled. the new unit test simply makes the original svg larger to
check for the same behaviros as before.
show resized img in preview using data: urls

in analogy to sparklines, this renders scaled imgs to
data:img/...;base64,... urls in preview mode.

if the image is already present on the server (eg because it was not
just inserted), the already rendered image is referenced instead.
make img unittest easier to debug
unit test for bugs/image_rescaling_distorts_with_small_pictures
use readfile() instead of reinventing it

This avoids potential action-at-a-distance from locally redefining $/
but never reaching the end of the redefinition's scope.
Provide a UUID in edittemplate templates.

I want to make GUIDs for my RSS feeds that don't change when I move
pages around.  To that end, I've used UUID::Tiny to generate a
version 4 (random) UUID that is presented in a `uuid` variable in
the template.

At that point, you can do something like this:

    [[!meta guid="urn:uuid:<TMPL_VAR uuid>"]]
edittemplate: only generate a UUID on-demand

If the template doesn't use <TMPL_VAR UUID> there's no point in
incurring any cost.
Use Linux uuid facility instead of an external library if possible
Provide the current time to edittemplate.

The `time` variable contains a fixed-format time, guaranteed suitable
for parsing by timedate.

The `formatted_time` variable contains the same time formatted by
IkiWiki::formattime.
Only provide time, not formatted_time, to edittemplate templates

I'm not sure what the use-case is for formatted_time, and chrysn
pointed out that for display in HTML, [[!date "<TMPL_VAR time>"]]
would be nicer.
Indicate how the UUID is likely to be used
edittemplate: use unambiguous RFC 3339 datestamps

These take into account the timezone offset (and convert it to UTC+0000)
rather than being in an unspecified timezone.