if you have a lot of news with pictures and operators is not prepared thumbnails and using images of different formats and high resolution ....
- optimize images - decrease image resolution, decrease quality, repac and another that allows the ImageMagick (CKEditor is now able to change the resolution. In kernel is not an option)
- after optimization overwrite original for save space on the server
- scale and crop images with different proportions
- update images for templates and cms block
- for cms block automatically add link over image to view full size image
(for external ImageMagic only)
resize:800x600; - resize image if original 1024x1024 after scale will be 600x600; if original 1024x768 after scale 800x600; if original 768x1024 after scale 450x600
You can specify only one parameter resize:800x; all images after scale will be width 800 height reduced proportionally
overwrite:1; - overwrite original after scale.
gravity:center; crop with gravity; possible options: NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast (Standart options from ImageMagic)
if gravity active overwrite will be disabled automatically. See attached image for crop logic.
wm:/img/wm_logo.png|10|10; watermarking, option 1 - filename; 2- horizontal margin; 2-vertical margin; margin position illustrated in image
I'm add options to SystemSettings table ImageMagickWMFilename, ImageMagickWMhorzMargin, ImageMagickWMvertMargin. If Filename exists in ImageMagickWMFilename watermarking is active. if you want to disable for wm for specific template set option in tag: "wm:||;". For overwrite default value from SystemOptions set new option in "wm:" tag.
if overwrite is active then after scale image with new params will be saved without watermark.
if gravity is active - watermarking disabled.
optimize:options for jpg|options for png/gif; standard options from ImageMagic documentation for optimize Image;
Im add options to SystemSettings ImageMagickOptimizeJpgParams - default value: -strip -interlace Plane -density 75 -units pixelsperinch -quality 75%; ImageMagickOptimizePngParams: -strip +dither -colors 150 -depth 8 -type TrueColor.
for specific template you can disable default options optimize:|; or set other options/
Specific params for ContentBlock:
resize:800x600; - set Maximal Width Height. if in the editor when you add images with large sizes, they will be changed to the
in cms block added image tag <img src="pathToImage" style="width:2048px; height:1536px" />
resize:600x; image will ba scaled for width 600px and tag style will be changed <img src="pathToImageScaled" style="width:600px; height:450px" />
"style" not overwrite if it is set in percent (width:100%;) or used max-width: min-width: or max-height: min-height: (for responsive templates)
If original image 2048x1536 and to cms block added image tag <img src="pathToImage" style="width:600px; height:375px" /> after parse will be after parse <img src="pathToImageScaled" style="width:600px; height:450px" />
link:1024x768; options for add link for view full size image after click. For scripts like slimbox http://www.digitalia.be/software/slimbox2/
combination for resize:600x; and link:1024x768;
original image width:2048px; height:1536px result after parse:
If link options exists overwrite automatically disabled for tag <img /> within the tag <a> </a>
link_element:link_item; parse element 'link_item' for href insert tag <a href="">...</a>
link_overwrite:1 scale image to the size specified in the tag link:1024x768; and overwrite original if it is active: overwrite:1; automaticaly disabled. gravity for full image is disabled.
added option ImageMagickPath if Linux installation not like CentOs RedHat Fedora
I think that for sites which few pages it's not true. it can be useful to someone else :)