Download the PHP package bloke/smd_thumbnail without Composer

On this page you can find all versions of the php package bloke/smd_thumbnail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package smd_thumbnail

h1. smd_thumbnail

"Download":https://github.com/Bloke/smd_thumbnail/releases | "Packagist":https://packagist.org/packages/bloke/smd_thumbnail

If you're bored of one Textpattern thumbnail per image and don't fancy using an auto-resizing script or relying on the browser to stretch your thumbnails, @smd_thumbnail@ could be the answer! It allows you to create profiles for as many Textpattern thumbnail sizes as you like and will automatically create physical thumbnails at those dimensions for any/all of your images.

Please report bugs and problems with this plugin at "the GitHub project's issues page":https://github.com/Bloke/smd_thumbnail/issues.

h2(#features). Features

h2(#install). Installing

Requires Textpattern 4.7.0+

Download the plugin from either "GitHub":https://github.com/Bloke/smd_thumbnail/releases, or the "software page":https://stefdawson.com/sw/plugins/smd_thumbnail, paste the code into the Plugins administration panel, install and enable the plugin. Visit the "forum thread":https://forum.textpattern.io/viewtopic.php?id=34367 for more info or to report on the success or otherwise of the plugin.

Note: When upgrading from v0.1x to v0.20, your preferences for 'Keep Textpattern thumbnails in sync with default profile' will be removed. Please visit the 'Setup' area to reinstate the behaviour you desire.

Alternatively, this plugin can be installed using "Composer":https://getcomposer.org:

bc. $ composer require bloke/smd_thumbnail:*

h2(#usage). Usage

Visit the Images panel. Above the list of images is an area labelled Thumbnail profiles. Click it to reveal the control panel. You can toggle this panel open and closed by clicking the heading.

You must define at least one profile to begin with, so click the New profile button. This will reveal edit boxes where you can enter:

Once you've configured your profile, click 'Save' to store it. You can always edit it again by clicking its name. Go ahead and create some more profiles for thumbnails of different sizes/parameters. If you wish to delete a profile, click the 'x' button and confirm. All thumbnails associated with that profile will be deleted.

At this point, no thumbnails have been created. Let's rectify that...

h3. Creating thumbnails

Pick one of your images and click to edit it. Beneath the main picture you will see an area labelled 'Create thumbnail'.

Inside this area is a simple select list containing one entry for each thumbnail profile you have configured, plus the special entry 'All sizes'. You can select one of these entries and click 'Create' to create thumbnail(s) in the selected size or click 'Delete' to remove the selected thumbnail(s).

Once created, the thumbnails appear in the panel.

If you select 'All sizes' and click 'Create', you will get one thumbnail for each active profile. Similarly, if you click 'Delete' any thumbnails stored against an active profile for the current image will be removed. By toggling certain thumbnail profiles on/off you can control which ones are created or deleted - by default:

Note that if you use Textpattern's multi-edit tool to delete images, all corresponding thumbnails for the selected images (including inactive ones) will be removed.

h3. Custom thumbnails

If you prefer to make your own thumbmails in an external program, you can still set up the profiles as normal but instead of clicking 'Create' in the 'Image edit' screen, you can pick a profile size from the dropdown and use the file picker facility 'Browse...' to select a thumbnail from your hard drive. When you click 'Upload' the image will be inserted against the selected profile.

At any time you can click one of the thumbnails (or select a size from the dropdown) and choose for another image to replace the existing thumbnail - even ones that have been auto-created. Some things to note about this feature:

The thumbnail must be of the same file type as the original image or the upload will be ignored.

You can click a highlighted image to deselect it.

You cannot 'Browse...' for an image (the file upload box is greyed out) unless you have chosen one profile.

h3. Batch thumbnail creation

You can also create thumbnails en-masse. Click the 'Tools' button (labelled 'Setup' if you have sufficient rights) in the right hand corner of the smd_thumbnail control panel. From there you will see an area that allows you to create thumbnails for:

Only the selected images (the checkboxes next to each image).

All images of a particular category.

All images uploaded by a particular user.

All images.

After selecting the desired option (and if you choose category or author, select one of the entries from the secondary list that apears), click 'Create'. Once you confirm your action, the plugin will create thumbnails for every active profile for all images that match your criteria. This is a quick way to generate thumbs for your existing images. Note that if you choose the first (empty) category entry, then all images that have not been assigned a category are manipulated.

Because of the nature of this tool - especially with large image pools - the process is done as a background task via AJAX. After clicking the 'Create' button (and confirming you are sure) a counter will appear in the top-right of the prefs panel showing how many images it has processed out of the total number of images in the set. When it's done, if you then refresh your 'Images' tab (e.g. click to the 'Profiles' pane) you will see your chosen default thumbnails in the list - assuming you've set one as default.

h3. Preferences

If you have sufficient privileges, in the lower portion of the 'Setup' panel are some options that govern how thumbnails are created for all users. There is no 'Save' action here: the checkmarks are stored in real-time and always reflect the current state.

h4. Create smd_thumbnails from

Governs whether the smd_thumbnails are created from the full size image or its (Textpattern) thumbnail. If you have elected not to have Textpattern thumbnails created then it'll probably not work very well! This preference applies:

When you use any of the batch tools to mass-produce smd_thumbnails.

If you upload a new image.

If you reupload a main image and 'Recreate thumbnails on re-upload of main image' is checked.

h4. Keep Textpattern thumbnails in sync with default profile

This option only appears if you have set a profile as default.

Ordinarily, smd_thumbnail works independently of Textpattern's thumbnails. If you disable the plugin you'll see that everything goes back to how it was before you installed it. This is great because your hard-graft isn't lost if you have uploaded your own thumbs. But, if you start creating thumbs with the plugin you will notice that Textpattern's built in tags such as @@ and @@ won't work for newer thumbnails. This might be confusing so you can opt to have smd_thumbnail update your Textpattern thumbnails at the same time.

By ticking either of the checkboxes, the plugin will track any changes to the default profile and mimic them with Textpattern's thumbnails. This has a few effects worth highlighting...

When the 'Creation' checkbox is ticked:

If you batch create thumbs, upload a new image, or replace an existing image, a new Textpattern thumbnail will be created at the default size. Any existing thumbs will be overwritten.

If you change default profile, any Textpattern thumbnails that have been created will remain at the previous size. Only when you start creating, uploading or replacing images will the new thumbnail sizes be created.

When the 'Deletion' checkbox is ticked:

If you delete a single thumb that corresponds to the default profile, both the profile thumb and Textpattern's thumbmail will be deleted.

If you delete an entire profile, all its thumbnails and all Textpattern's thumbnails will be removed.

Further:

If you have no default profile, the checkboxes disappear and the settings have no effect. Choose a default profile to reinstate the behaviour.

If you deactivate the default profile the checkboxes have no effect unless you delete the profile (since you're deleting it, its status is 'lost' and therefore the checkboxes function as normal). If there's any doubt, uncheck the 'Deletion' checkbox first!

h4. Recreate thumbnails on re-upload of main image

When this checkbox is cleared and you replace a main image (from the 'Image edit' screen) any thumbnails that have already been assigned to the image are left as they are - only missing thumbnails will be created from the main image. Conversely, if you set this checkbox, when you upload the replacement image ALL smd_thumbnails for active profiles will be (re)created from the main image.

Note one important exception: Textpattern thumbnails are NOT covered by this option - they are governed by the 'Keep Textpattern thumbs in sync' 'Creation' checkbox. Thus, if you upload a replacement image and the 'Creation' checkbox is on, you will replace Textpattern's thumbnail regardless of the setting of the 'Recreate thumbnails...' option.

h2(#tags). Tags

h3(#st). smd_thumbnail tag

bc.

A direct replacement for the built in "txp:thumbnail":https://docs.textpattern.com/tags/thumbnail tag with exactly the same functionality and attributes apart from the additional attributes listed below.

h4. Attributes (in addition to standard txp:thumbnail tag attributes)

; @add_stamp="boolean"@ : Adds the image file modification time to the end of the thumbnail's URL. Use @add_stamp="1"@ to switch this feature on. This helps prevent stale images, but may prevent browsers from cacheing the thumbnails properly, thus increasing bandwidth usage. : Default: @0@. ; @break="tag"@ : HTML tag to apply between each thumbnail when iterating over them. : Default: unset. ; @breakclass="class name"@ : HTML @class@ to apply to the @break>@ tag. : Default: unset. ; @class="class name"@ : HTML @class@ to apply to the @@ attribute value. : If omitted, the name of the profile will be used as a @class@ name for the @@ tag. : If you specify a @wraptag@ and omit the @class@, the profile name will be used as a @class@ on both the container and the @@ tag. ; @force_size="value"@ : Usually when you set one or other width/height to @0@ in a profile, the browser scales the missing dimension automatically. It does this by omitting the @width=@ or @height=@ attribute in the @img@ tag. This may cause visual artefacts as the page is rendered and the browser calculates the sizes. If you wish the plugin to add the actual dimension to the @@ tag (the size at the time the thumbnail was created), tell the plugin with this attribute. Choose one or both of @width@ or @height@. Comma-separate as required. : Default: unset. ; @form="form name"@ : You can construct your own @@ tags using the given form. If not specified, you may use the tag as a container. ; @format="value"@ : By default, this tag outputs a full @@ tag. If you just require the image URL so you can make your own image tags, set @format="url"@. : Default: @thumbnail@. ; @quiet="boolean"@ : Use quiet="1" to suppress warnings about missing images. : Default: @0@. ; @size="ratio"@ : Only consider images of a particular aspect ratio/size. Choose from: @portrait@, @landscape@, or @square@. Or specify your own aspect ratio width:height, e.g. @16:9@ or @4:3@, or numeric ratio such as @size="1.33"@ or @size="0.8". You may also specify just a width or height, e.g. @size="300:"@ (only consider images that are exactly 300px wide) or @size=":800"@ (only consider images that are exactly 800px tall). : Default: unset. ; @sort="col dir, col dir, ..."@ : Order the images by the given columns and sort direction. : Default: @width DESC, height DESC@. ; @type="value"@ : Use this attribute to display thumbnails of the given profile name (e.g., @type="large"@). You may comma-separate multiple profile names to iterate over them. : type="SMD_ALL" will iterate over all defined profiles. : type="SMD_ACTIVE" will iterate over all active profiles. : If you do not specify this attribute, the default profile will be used. If there is no default profile you'll see warning messages.

The tag works inside @@ or can be used standalone by specifying the @id@ or @name@ attribute. If using it as a container or with the @form@ attribute you display the various pieces of thumbnail information using the @@ tag.

h4. Examples

h5. Example 1

bc.

</txp:images>

Show all images that have been generated with the 'big-size' smd_thumbnail profile.

h5. Example 2: responsive images

See "responsive images post":https://forum.textpattern.io/viewtopic.php?pid=288361#p288361 in the Textpattern forum.

h3(#st_info). smd_thumbnail_info tag

bc.

Display various information from the current @@ tag (in either its form or container).

h4. Attributes

  • @class="class name"@ HTML @class@ to apply to the @wraptag@ attribute value.
  • @break="value"@ Where value is an HTML element, specified without brackets (e.g., @break="li"@) to separate list items.
  • @item="item value"@ List of things you wish to display. Choose from: @alt@: image alt text. @author@: image author. @category@: image category name. @category_title@: image category title. @class@: class applied to thumbnail (if not supplied, is same as type). @date@ : raw datestamp of when the image was uploaded. @ext@: thumbnail file extension. @h@: thumbnail height (pixels). Note the resulting value is taken directly from your profile setup, so if you have the profile height set to @0@ (variable height) then this value will be incorrectly displayed as @0@. @html_h@: HTML-formatted @height@ attribute. @html_w@: HTML-formatted @width@ attribute. @id@: thumbnail ID. @name@: image name. @title@: image title/caption. @type@: thumbnail profile name. @url@: full image URL of the thumbnail. @w@: thumbnail width (pixels). Note the resulting value is taken directly from your profile setup, so if you have the profile width set to @0@ (variable width) then this value will be incorrectly displayed as @0@.
  • @wraptag="element"@ HTML element to wrap (markup) list block, specified without brackets (e.g., @wraptag="ul"@).
  • @escape="transform"@ to apply core escape transforms such as trim, tidy, html, textile, etc to the item.

h5. Example

bc.

"> "> "> h3(#st_if). smd_if_thumbnail tag bc. A direct replacement for the built in @@ tag with exactly the same functionality. h4. Attributes * @type@: use this attribute to check for thumbnails of the given profile name (e.g., @type="Medium"@). If you do not specify this attribute, the default profile will be tested. If there is no default profile the tag will always render the @@ portion. h5. Example bc. <txp:image_info type='alt' /> <txp:image_info type='alt' /> h2. How it works For reference, when you create a profile a directory is created with that name inside your Textpattern @images@ folder. Inside this folder you will find images of the format @id.ext@: where @id@ and @ext@ match the corresponding image IDs in the Textpattern database. That's pretty much it! You can delete thumbnail files manually from any of these directories and the plugin will figure everything out. But it's probably not advisable to delete the directories themselves - use the 'Delete' buttons in the control panel for that. h2(#history). History Please see the "changelog on GitHub":https://github.com/Bloke/smd_thumbnail/blob/master/CHANGELOG.textile. h2(#credits). Authors/credits Written by "Stef Dawson":https://stefdawson.com/contact. Many thanks to "all additional contributors":https://github.com/Bloke/smd_thumbnail/graphs/contributors. Special thanks also to the beta test crew who offered feature and workflow advice, especially thebombsite, jakob, jstubbs and maniqui.

All versions of smd_thumbnail with dependencies

PHP Build Version
Package Version
Requires textpattern/lock Version >=4.7.0
textpattern/installer Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bloke/smd_thumbnail contains the following files

Loading the files please wait ....