Consistent with paths saved by the mediafinder form widget, media paths should use the media folder as the root. In addition to handling file attachment objects, you can also pass the filter an image path in your media or uploads storage. Set to true to flatten transparent images using the background option.Īrray of RGB values specifying a background color to use when flattening an image. GetThumb will automatically upscale images to match your desired dimensions, but this plugin will only do so if upscale is true or "exact" is the mode. By default takes the defaultPriority value set in the plugin config. (optional) string: the priority level to use for queuing (more below). All getThumb options are the same, but this plugin adds some options. (optional) string or array: if a string, it is used as the mode option. 0 if width should be used as the sole constraint. 0 if height should be used as the sole constraint. The full list of available parameters is smart_resize(width, height, options, priority) Parameter This filter is almost a drop-in replacement for the getThumb function provided by OctoberCMS file attachments with the addition of a priority parameter to specify queueing priority. This also removes resizing from the main page load, but resizing on image load should only be done in production if you're sure your server configuration is capable of dealing with the concurrent resize requests.Ī smart_resize filter is available for use in your Twig templates. If you don't have a queue set up or choose not to use it, this plugin will resize on image load. Depending on server load and your configuration, there may still be a significant delay before your visitor can load all page images, but they should experience temporary slowness loading images rather than long waits for page loads or PHP execution time limit errors. If for some reason required image sizes were not pre-generated and don't exist at the time a site visitor accesses a page, the page can render and start displaying before the image resizes have been performed. The purpose of this plugin is to make that easier by avoiding page execution time limits and handling resizes in queue workers where higher memory limits might be appropriate. by triggering relevant page renders when image galleries change via the backend. This functionality is most useful on image-heavy sites where the images to be displayed will change over time and various sizes of the same image are used in your site templates.įor the best user experience, it's anticipated that wherever possible you will be pre-generating the image sizes you need, e.g. This plugin allows you to offload image resizing from page rendering by either pushing image resize jobs onto a queue or by resizing on image load.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |