hot!

phpThumbOn

Optimized snippet phpThumbOf for MODX Revolution
Version 1.3.5-beta2
Release date 02.12.2019
Downloads 11 654
Views 5 755
Warning! This component requires PHP version 5.3 or higher! If your site uses PHP less than required, the installation of this package could break it.
Warning! This package requires MODX not less than 2.3 !
Optimized snippet phpThumbOf for MODX Revolution. Similar syntax but faster operation. See changelog for details.

Package author to version 1.3.0 — Yevgeny Borisov (Agel_Nash)

The phpthumbon snippet



This snippet can be used as a modifier, for example: [[*image:phpthumbon=`w=200&h=200&zc=1`]]



ParameterDescriptionValue
inputPath to the image to be processed

Possible values
A string


Default value
(null)


Note:
This parameter makes the snippet operate as a modifier.


optionsphpThumb class parameters

Possible values
A random string with parameters separated from each other by the character & (ampersand); the value of a parameter is placed after the character = (equal mark)


Default value
q=96&src={assets_path}components/phpthumbon/noimage.jpg


Note:
The default values q and src can be redefined in the system settings via phpthumbon.noimage and phpthumbon.quality




System Settings



ParameterDescriptionValue
phpthumbon.images_dirThe folder to be cut off from the path in the cache directory

Possible values
Folder name


Default value
images


Note:
Relative to the “assets” folder


phpthumbon.qualityDefault image quality

Possible values
A whole number greater than 0


Default value
96


Note:
This value will be used if image quality is not defined in parameters when the snippet is fetched.


phpthumbon.cache_dirCache folder name

Possible values
Folder name


Default value
cache_image


Note:
Relative to the “assets” folder


phpthumbon.extThis type will be used if an image to be compressedis in an unknown format.

Possible values
Filename extension


Default value
jpeg


Note:
This type will be used if an image to be compressed is in an unknown format.


phpthumbon.noimagePath to an “Image does not exist” image

Possible values
Path to the file


Default value
{assets_path}components/phpthumbon/noimage.jpg


Note:
If an image specified in “Input” cannot be accessed, or if that parameter is empty, the image specified in this parameter will be fetched for processing.


phpthumbon.queueQueue support activation

Possible values
0, 1, 2


Default value
0


Note:
0 — use no queue; 1 — use a queue without compressing ‘noimage’; 2 — use a queue and reduce ‘noimage’ to a required size


phpthumbon.queue_classpathPath to a QueueThumb class file

Possible values
0, 1, 2


Default value
{core_path}/components/phpthumbon/queue/QueueThumb.class.php


Note:
The specified file should contain a QueueThumb class with the public static method add(phpThumbOn $ThumbOn, modX $modx). By default, the class uses no queues in the direct sense of the word and only saves relevant data in the table modx_thumb_images for further processing by the processor from cron.


phpthumbon.error_modeFlawed image processing rules

Possible values
1, 2


Default value
1


Note:
1 (by default) — compressing ‘noimage’ with defined parameters; 2 — displaying an original image without processing


phpthumbon.noimage_cacheFolder with cached noimage files

Possible values
Full path to any file


Default value
{assets_path}components/phpthumbon/cache/


Note:
Path to a file already containing ‘noimage’ of required sizes


phpthumbon.total_queueNumber of queued tasks processed at a time

Possible values
from 1 to 10


Default value
1


Note:
No more than 10. If this parameter has no value, the default value 1 will be set.


phpthumbon.make_cachenameSnippet capable of replacing default rules of image name cache formation

Possible values
Any name of a snippet present in the system


Default value
(null)


Note:
Snippet should refetch a serialized array with the following keys:

  • _cacheFileName (filename with a full address relative to the server root)
  • _cacheSuffix (suffix in a cache-file name)
  • _globThumb (search template for other previews of the same file


phpThumbOn 1.3.2-pl (16.09.2016)

Initialization of the modPhpThumb class for working with MODX 2.5.1

phpThumbOn 1.3.1-pl (14.01.2015)

Parameter $_config in the phpThumbOn class is now public for direct access from the snippet in the "phpthumbon.make_cachename" parameter.

The _pathinfo method in the phpThumbOn class has been rewritten from scratch for a better understanding of Russian symbols. Our thanks to Vasily Naumkin for implementing this function in the ms2Gallery component.

phpThumbOn 1.3.0 (23.09.2014)

German and English vocabulary

Package for compatibility with MODX 2.3.x updated

phpThumbOn 1.2.1 (27.12.2013)

Object data reset bug caused by the processor’s reply fixed

Problem with absolute paths fixed

phpThumbOn 1.2.0 (26.12.2013)

Deleting previously created previews during a repeated call of a snippet with other parameters

No more output emptiness if a script fails to create a preview

Caching compressed “noimage” images

Possibility of processing several images during one processor start

Flawed image copying fixed

Custom preview names

phpThumbOn 1.1.0 (06.12.2013)

Compression queue support added

phpThumbOn 1.0.2 (16.09.2013)

Operation in AJAX mode fixed

phpThumbOn 1.0.1 (25.08.2013)

Invalid reading of the “input” parameter starting with a slash

phpThumbOn 1.0.0 (02.08.2013)

Preview filename cleared of unintelligible symbol sequences

Images semantically distributed among folders in accordance with original images

Constant cache checkups and cleanups removed

AWS Amazon support deactivated

A number of parameters responsible for default preview quality and type added

Snippet code optimized for multiple calls