/** Minimages : Automatic image sizing for PmWiki2 rev 1.0 - 8 jan. 2005 * rev 0.1 : first issue 27 nov. 2004 * rev 0.2 : solved problem with page containing accented letters * rev 0.3 : solved problem with ext '.jpeg'.Allow uppercase extensions (not with FTP) * rev 0.4 : cosmetic, IPTC interactive input optional, $WriteGif to block Gif writing * rev 0.5 : modif to work with pmwiki 2.0 beta10 and over * rev 1.0 : working thumb reload - $OverSize parameter to limit resizing * My very first php script, so may need improvment * @author Pierre Rouzeau * @license http://www.gnu.org/licenses/gpl.html GNU General Public License * part of the stuff derived from the PmWiki upload.php script Need to have Upload activated (it is not by default on PmWiki) To run these markups, set in the config.php file : include (cookbook/minimage.php); ## optional parameters after the include #$img_smallsize = value; // Larger size of displayed image, default 256 #$img_plainsize = value; // Larger size of linked image, default 768 #$img_archsize = value; // Larger size of image archived on drive, default 1280 ## Setting archive size equal to linked size remove archive files #$OverSize = value; // extra size which do not drive to resize, default 1.15 ## Default IPTC tags (jpeg images only) #$def_iptc_caption = 'text'; //used if no tag exist,default 'Image collected on a PmWiki' #$def_iptc_copyright = 'text';//used if no tag exist and no Author defined, default empty #$def_iptc_special = 'text'; //*appended* to existing tag, default empty #$WriteGif = FALSE; //To inactivate gif writing (write jpeg images under gif extension) #$DispIPTC = FALSE; //To inactivate interactive IPTC input (so defaults values are used) Accept gif, jpeg and png images only. To use it in a page, write : Img:image.ext This script do *not* resize images lower than ($OverSize * required size) (to avoid quality loss for slightly larger image). #$OverSize = value; // extra size which do *not* give resizing, default 1.15 If gif resizing is not allowed create jpeg images with extension '.gif'. This is not quite neat but handled ok on most browsers. For images not resized, if IPTC tags exists, they are left unmodified, though if they are no IPTC tags, they are created. Images can be uploaded via FTP, they will be resized at first display. If not existing, the IPTC fields will be set at the default values, and the first viewer will hold the copyright if empty by default... For translation, next strings are to be set in an XLPage : 'Upload images' => '', 'Image for' => '', 'Upload' => '', 'Image to upload:' => '', 'Image wiki name:' => '', 'Step 1' => '', 'Step 2' => '', 'Image title' => '', 'Image copyright' => '', 'Ok' => '', 'Cancel' => '', 'Image special instructions' => '', 'IMGbadtype' => ' - invalid file extension -', 'ULnotimage' => 'uploaded file is not an allowed format', 'Image resizing not possible on your server' => '', 'IMGreload' => 'If wrong image, reload a new one', **/