%META:TOPICINFO{author="TWikiContributor" date="1298533139" format="1.1" version="$Rev$"}%
---+!! Max Image Size Plugin
<!--
   Contributions to this plugin are appreciated. Please update the plugin page at
   http://twiki.org/cgi-bin/view/Plugins/MaxImageSizePlugin or provide feedback at
   http://twiki.org/cgi-bin/view/Plugins/MaxImageSizePluginDev.
   If you are a TWiki contributor please update the plugin in the SVN repository.
-->
<sticky><div style="float:right; background-color:#EBEEF0; margin:0 0 20px 20px; padding: 0 10px 0 10px;">
%TOC{title="Page contents"}%
</div></sticky>
%SHORTDESCRIPTION%

---++ Introduction

This is an plugin to restrict the max size of an image. It gets called before images are saved to disk and changes the size of them according to the RESIZE_GEOMETRY string.

   * i.e. http://studio.imagemagick.org/www/Magick++/Geometry.html

---++ Syntax Rules

None.

---++ <nop>%TOPIC% Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, for example, ==%<nop>MAXIMAGESIZE_SHORTDESCRIPTION%==

   * One line description, shown in the %SYSTEMWEB%.TextFormattingRules topic:
      * Set SHORTDESCRIPTION = Limit the size of images attached to TWiki topics

   * Resize geometry
      * Set RESIZE_GEOMETRY = "640x480>"

   * Debug plugin: (See output in =data/debug.txt=)
      * Set DEBUG = 0

---++ Plugin Installation Instructions

__Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

   * For an __automated installation__, run the [[%SCRIPTURL{configure}%][configure]] script and follow "Find More Extensions" in the in the __Extensions__ section.
   * Or, download the ZIP file from the Plugins web (see below),
   * Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
     | *File:* | *Description:* |
     | ==data/TWiki/%TOPIC%.txt== | Plugin topic |
     | ==data/TWiki/%TOPIC%.txt,v== | Plugin topic repository |
     | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
   * Test if the plugin is correctly installed:
      * Attach a larger jpg image to a topic and check the size.

---++ Plugin Info

|  Plugin Author: | TWiki:Main.MartinCleaver |
|  Copyright: | &copy; 2003 TWiki:Main.MartinCleaver, &copy; 2008-2011 TWiki:TWiki.TWikiContributor |
|  License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
|  Plugin Version: | 2011-02-23 |
|  Change History: | <!-- versions below in reverse order -->&nbsp; |
|  2011-02-23: | TWikibug:Item6638: Fix for TWiki-5.0; doc improvements; changing TWIKIWEB to SYSTEMWEB -- TWiki:Main.PeterThoeny |
|  2003: | Initial version |
|  CPAN Dependencies: | http://www.imagemagick.org/www/perl.html |
|  Other Dependencies: | Image Magick |
|  Perl Version: | 5.005 |
|  Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
|  Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |

__Related Topics:__ %SYSTEMWEB%.TWikiPreferences, %SYSTEMWEB%.TWikiPlugins
