Image Resize Module provides you with different tools to perform various actions on your Origin image by adding module’s supported parameters to the content path.
Using this service you can resize your images,crop, watermark or rotate your images. You can use these services as an integrated part of your CDN service resulting in reducing your overall cost and saving storage by shifting these operations to CDN side.
Those images which have been resized using this module, would be cached on CDN as a unique image after the first Resize operation done. So, in order to invalidate or purge your processed images, its important to consider these files as a separate file and perform same actions for these files as well.
Supported formats: jpg, png
All the samples in this document, have the following structure:
Sample Image Link : http://www.yourdomain.com/path/yourimage.jpg
CDN Image Link : http(s)://yourcdndomain.mncdn.com/path/yourimage.jpg
Size of the image used in the document is: 1920×1080 px
1. Image Resizing – MNRESIZE
This feature is used to resize your images keeping the original ratio. For example; if your given image is rectangular and you need your output to be square, this feature doesn’t allow any disortion on the image and the output will still be rectangle. (example 4) If you only give either width or height of the desired image to be resized, this module will calculate the corresponding factor based on the ratio of the image.
(example2 and 3)
All the samples below will give a 400×225 output.
- http(s):// youraccount.mncdn.com/mnresize/-/225/yourimage.jpeg
- http(s):// youraccount.mncdn.com/mnresize/400/-/yourimage.jpeg
2. Add Padding – MNPADDING
You can add padding to configure the distance of your images from its borders. In this feature all parameters must be entered (width, height, hex). You must also enter the 6digit hex color code (without # in the beginning).
If your targeted dimention ratio is bigger than your original image, padding would be added. In the following image, the original dimention is 1920 x 1080 and it can be resized to 400×225 without any added part. But as seen in example 1 if the dimention given was 400×125, there would be a 89px padding added to the right and left of the picture, making 178px padding added and in the remaining part your image is located.
3. Cropping – MNCROP
This feature crops the image by centering the original image. For cropping the image,it doesn’t change the original dimentions. (only crops the the size of given target) While doing this process it doesn’t resize the original image. If you wish to resize the image you ought to use mncropresize feature.
4. Resizing and Cropping (Resize + Crop) – MNCROPRESIZE
This feature helps you to Crop and Resize your images at the same time. It applies both MNCROP and MNRESIZE features at the same time. Using this service, you can reach the target dimentions you wish.
For example the image used below can be resized to 400×225 without any disfigurement. As in example 1 if we enter 400px for height and 100px for width, it creates our targeted image cropping 125 pixel from top and bottom of the image. Similarly as in example 2 when target width is smaller is less than the calculated height rario, it will crop from left and right.
5. Optimization – MNOPTIMIZE
Using this service you can reduce the size of the image that is being served from CDN. There are various optimization features used with this service. In order to get maximum optimazation your original images must be as raw as possible. If the original image has gone through a previous optimization process, this service wouldn’t give a desired result. The aim of this service is to optimize your images without any quality reduction (like pixelation,color loss and etc.) in the best-case scenario you can optimize your images up to 80%.
You may use this service even without performing any of MNRESIZE features, simply by activating it through Medianova Panel.(https://panel.medianova.com) You may achieve reducing the size of your images to a great extent using MNRESIZE and similar features together with image optimization.
In order to activate this service you can follow the path : Medianova Panel > Zones > Settings > Imaj Optimization
6. Image Rotation – MNROTATE
You can rotate your images to a given angle using this service. Remember that you cant combine this service with other services. Rotation service can only get 90, 180, 270 degrees as input. If an angle except these given, it will cause in failure in performing this process.
7. Watermarking – MNWATERMARK
This module is used for add watermark to your images. In cotrast with the other modules,this module works with adding a watermark image to all your images. The reason for adding watermark to all your images is that,a watermarked image with a specific path (which includes watermark path) cant be used with removing the watermark path, reducing risk of these attempts. You can contact support for adding watermarks.
After adding your watermark image through panel,this image would be added to all the images that are not cached yet. If you want your cached images also contain watermark,you need to purge those cached images. If you want to have a trasnparent image, you should upload a transparent .png file.
This service by default adds the watermark to the middle of the image. If you want to set the size of watermark you may use resize method. MNCROP and MNROTATE modules cant be applied on the images containing watermark.