Editing the input mask for resizing with SIP2 PHP Support
Discover the power of input mask when using Smart Image Processor PHP
Question
What options do I have for editing the input mask when creating new images with Smart Image Processor 2?
Answer
When using Smart Image Processor 2 to create new images of the ones that are resized during uploading, several options can be used for setting the filename the way you want.
After Smart Image Processor 2 is activated, the option Create new can be selected with the standard input mask becoming active:
##path##thumb_##name##.jpg
There are two standard commands that are used: ##path## and ##name##. The ##path## option uses the path set in the Upload behavior. When using this option, the resized image is saved in the same folder as the original one. The option ##name## represents the name of the original file.Knowing this, the input mask can be edited in any way you want!
If you want to use the text _small or _big instead of _thumb, use these kind of masks:
##path##small_##name##.jpg
##path##big_##name##.jpg
If you want the text _thumb, _small or _big to appear just before the file-extension, use these kind of masks:
##path####name##_thumb.jpg
##path####name##_small.jpg
##path####name##_big.jpg
If you want the imagesizes included in the filename, use these kind of masks:
##path####name##_640x480.jpg
##path####name##_150x150.jpg
##path##200x100_##name##.jpg
If you want to have the images placed in a subfolder of the upload path, use this kind of mask:
##path##/subfolder/##name##_thumb.jpg
If you want to place the resized images in a specific folder, use these kind of masks:
/folder/##name##_thumb.jpg
/folder/thumb_##name##.jpg
If you want to place the resized images in a subfolder of a specific folder, use these kind of masks:
/folder/subfolder/##name##_thumb.jpg
/folder/subfolder/##name##_small.jpg
If you want the resize to keep the original file extension, use these kind of masks:
##path##small_##name##.##ext##
/folder/##name##_thumb.##ext##
Any kind of combination of the masks above can be used.
Give it a try and see what happens! I'd really appreciate your feedback on your results! If you have any questions just let me know!
Comments
Be the first to write a comment
You must me logged in to write a comment.