NP_ImageLimitSize.php

NP_ImageLimitSize will resize an image during upload if it is larger than the maximum width or height set for the blog. This is a fairly basic plugin, written as a proof of concept for a Plugin API event, that may not meet the needs of everybody. However, it is quite useful for cases where photos on a site are all standard sizes.

General Plugin info
Author: Kai Greve, yamamoto, shizuki
Current Version: 0.14
Download: zip file (zip, 4kb)
Forum Thread: here

Installing

  1. Unzip the file and upload the contents to your plugin directory
  2. Set general plugin options, and if desired set options at blog-level also

How to use the plugin

No special procedure is needed to use this plugin. It will perform its function everytime an item author uploads an image for inclusion in an item.

Available SkinVars and/or TemplateVars

  • N/A

Options

  • Maximum width for images: integer. Maximum width in pixels of any image uploaded. Also, sets the default for all blogs.
  • Maximum height for images: integer. Maximum height in pixels of any image uploaded. Also, sets the default for all blogs. If left blank, height will be set to ratio based on maximum width.
  • quality (1-100, 85 is recommended value.): integer. Image quality. Larger number means better quality, but larger file size.

Blog Options

  • Enable image limit size: yesno. Whether image limit size restrictions should be applied to this blog.
  • Maximum width for images: integer. Maximum width in pixels of any image uploaded to this blog. Leave blank to use same width as set in general options.
  • Maximum height for images: integer. Maximum height in pixels of any image uploaded to this blog. Leave blank to use same height as set in general options.

Tips and Tricks

Wishlist

Bugs

History

  • [Version 0.14, 3 Dec 2010 ]
    • CHANGED: improved check for available memory that was causing issues when uploading larger images.
imagelimitsize.txt · Last modified: 2010/12/03 19:27 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki