adi_image_tab – Enhanced image tab
This plugin provides enhancements to the standard TXP Image Edit tab as well as some new tags.
Additional image information displayed
- image publish date, author
- image file information – dimensions, file size, aspect ratio
- thumbnail file information – dimensions & file size
Navigation
Dropdown menus are provided to help speed up access to images:
- Recent images – contains a list of the recently updated images
- Images – is a link to the Images list tab plus a menu containing images surrounding the current image in the list
- Previous/Next links – for navigating through the image list
Tab behaviour
Tab behaviour is changed so that:
- the user is taken to the Image Edit tab immediately after uploading a new image
- when saving, the user stays in the Image Edit tab rather than being returned to the Images List tab
Functionality
Additional functionality in the Image Edit tab:
- image delete button
- option to populate alternate text from image name
- option to populate caption from alternate text
- ability to modify the image’s published date
- ability to edit image’s author
- image resize functionality
- checks writability of image & thumbnail files
Keywords
The plugin provides a new field for keywords. Enter a comma-separated list of keywords which can be utilised by new tags adi_image_keywords & adi_image_if_keywords.
Tags
To go with the new keywords field some extra tags are provided, as well as some tags to display additional image information. See below.
Image resize
The plugin enables you to resize images (dimensions and/or file size) during the upload process. This saves having to adjust image dimensions or file size locally on your computer before uploading.
To enable this functionality, go to adi_image_tab options in the Plugins tab and set the Enable image resize preference to “Yes”. Once this is done, you’ll be nagged to create a new writable directory (adi_image_tab/originals/) in the website images directory. Create the directory and click “Refresh page” to make sure the warnings disappear.
In the “Image Resize” tab under Extensions, a number of image resize sets can be specified. Enter a name, a maximum dimension (in px) and/or a maximum file size (in KB). On installation, an example Image resize set called “Gallery” is provided. This defines a maximum dimension of 640px and a maximum file size of 50KB.
When images are uploaded, the user is now prompted to select a resize set:
- if a resize set is selected:
- the image is uploaded, with the resized version linked to the database, and a copy of the original (unchanged) image stored in the adi_image_tab/originals/ directory
- if a resize operation is not selected (user clicks Cancel):
- the image is uploaded and linked to the database as normal
- if only a dimension is specified, then the resize operation won’t try to change the file size (although, inevitably, the size if the image file will be affected in this case)
- if an image is resized by dimension, then the longest side (width or height) will be set to the new value
- if a maximum file size is specified, the image will be compressed
Images can be re-resized from the Image Edit tab by clicking the Resize image button. If you want to restore the image to it’s original unchanged state, select “Restore original image”.
Notes & limitations:- resize functionality only works for JPEG & PNG images
- the resize process may occasionally fail to compress an image file size sufficiently
- image uploads are still subject to TXP and PHP installation file size restrictions
- resizing maintains the image’s aspect ratio
- image cropping needs to be done before uploading
- resizing doesn’t affect the thumbnail image
Tags
Some new tags are available, all of which should be used within <txp:images />
container tags.
- adi_image_keywords – displays the list of image keywords
- adi_image_if_keywords – conditional tag to detect whether image has keywords associated
- adi_image_download_link – generates a link for directly downloading the image
- adi_image_filesize – displays the file size of the original image (or the image linked in the database if not resized)
- adi_image_imagesize – displays the dimensions of the original or the database linked image
adi_image_keywords
This displays a simple comma separated list of keywords associated with the current image. No attributes.
adi_image_if_keywords
This is a conditional tag to detect whether the image has keywords or not.
<txp:adi_image_if_keywords>
IMAGE HAS KEYWORDS
<txp:else />
NO KEYWORDS FOR IMAGE
</txp:adi_image_if_keywords>
<txp:adi_image_if_keywords keywords="key1">
IMAGE HAS KEYWORD KEY1
</txp:adi_image_if_keywords>
adi_image_if_keywords – attributes
keywords="keyword list"
- comma separated list of keywords to be checked. Default = “” (any keyword).
adi_image_download_link
This tag generates a direct download link for the current image. By default the link text is the image name. Use the tag in container mode for custom link text. No attributes.
<txp:adi_image_download_link />
<txp:adi_image_download_link>my link text</txp:adi_image_download_link>
adi_image_filesize
This displays the size of the original image file, associated with current image. If the image hasn’t been resized, the size output will be for the database linked image. No attributes.
adi_image_imagesize
By default, this displays the dimensions of the original image file. Use original="0"
to display resized image dimensions.
ORIGINAL IMAGE DIMENSIONS <txp:adi_image_imagesize />, RESIZED TO <txp:adi_image_imagesize original="0" />
adi_image_imagesize – attributes
original="boolean"
- choose original or resized version. Default = “1” (original version).
Usage
After installing & activating the plugin, select the image you wish to edit from the Images list tab as normal. Image resize functionality can be switched on in the plugin Options tab.
Installation notes
- Plugin installation
- creates new database table adi_image_tab_resize
- adds columns adi_image_tab_keywords & adi_image_tab_resize to TXP table txp_image
- adds Image Edit tab extras (dimensions, file size, author etc)
- Enabling image resize functionality (preference in plugin options)
- user prompted to create directory adi_image_tab/originals/ in TXP images directory
- adds new menu item “Image Resize” under Extensions
- adds image resize options & information to Image Edit tab
- user automatically prompted to resize image on upload
- DOES NOT CHANGE images already linked to the database – these can be resized manually if required
- Disabling image resize functionality (preference in plugin options)
- hides “Image Resize” menu item
- hides image resize options & information in Image Edit tab
- user no longer prompted to resize image
- DOES NOT CHANGE images linked to the database (resized or not) or in adi_image_tab/originals/ directory
- individual image resize setting will be restored if image resize functionality re-enabled
- Uninstalling plugin
- deletes database table adi_image_tab_resize
- removes adi_image_tab_keywords & adi_image_tab_resize columns from txp_image table
- DOES NOT DELETE adi_image_tab/originals/ directory (under TXP images directory)
- images linked to TXP database left in resized state
- Image Edit tab extras removed
Plugin options
- Plugin privileges
- specify who gets to use the plugin - Standard edit panel behaviour?
- retain standard TXP tab behaviour
- default = No - Enable image resize
- to switch on image resize functionality
Textpack
To install the Textpack, go to the plugin’s Options tab and click on “Install textpack”. This will copy & install it from a remote server. The number of language strings installed for your language will be displayed.
If the Textpack installation fails (possibly due to an error accessing the remote site), the alternative is to click the Textpack also available online link. This will take you to a website where the Textpack can be manually copied & pasted into the TXP Admin – Language tab.
Additions and corrections to the Textpack are welcome – please use the Textpack feedback form.
Additional information
Support and further information can be obtained from the Textpattern support forum. A copy of this help is also available online. More adi_plugins can be found here.
adi_image_tabv0.4.2Download (Uncompressed) Textpack SupportTXP 4.7+
Other versions available: 0.2 (TXP 4.5 only)
- Plugin list
- adi_article_tab
- adi_calc
- adi_cat_menu
- adi_contact
- adi_detritus
- adi_file_tab
- adi_form_links
- adi_globals
- adi_gps
- adi_if_content
- adi_image_tab
- adi_join
- adi_link
- adi_list
- adi_matrix
- adi_menu
- adi_mobile
- adi_notes
- adi_page_tab
- adi_prefs
- adi_recent_tab
- adi_scripts
- adi_search_db
- adi_title
- adi_variables
- adi_webhook
- adi_wrap