This is an old revision of the document!
Table of Contents
dpicorrect plugin
Compatible with DokuWiki
2009-12-25c
Corrects image size based on their resolution (dpi), giving them a width and height attribute with values that make sense for 72dpi devices (like a monitor)
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Download and Installation
Download and install the plugin using the Plugin Manager using the URL given above. Refer to Plugins on how to install plugins manually.
To install the plugin manually, download the source to your plugin folder, lib/plugins
, and extract its contents. That will create a new plugin folder, lib/plugins/dpicorrect
, containing a single file, action.php – The plugin is now installed.
Prerequisites
This plugin will only work on servers that have a PHP installation that comes with GD. You can check this by making a php file with as sole content <?php phpinfo(); ?>
, uploading it to your server, and visiting it in your web browser. This will tell you your PHP configuration. If “GD” is not mentioned, you cannot use this plugin.
Syntax and Usage
This plugin as no configuration. If enabled, it will set explicit width and height attributes for JPG and PNG images, with their dimensions computed based on their resolution. GIF is an exclusively on-screen format and has no resolution, so these are left alone.
If a JPG or PNG image has a dpi value of 240, and measures 1000 pixels by 750 pixels, it will be resized for on-screen rendering to 400×300 (the average screen has a resolution of 96dpi).
Bugs
None known.
Todo
Nothing planned.