The typical use case:
The default image is a placeholder returned by Cloudimage in case you have enabled origin domain whitelisting or the origin image is unavailable.
When this default image is shown, the dimension of the default image is automatically resized with w/h = X/Y. With X and Y both =400px unless stated otherwise manually.
Even if you explicitly set height AND/OR width values, the proportions of the default image will be kept by the resizing engine and the placeholder will fit inside the "box" defined.
No other transformation will be processed whatsoever.
How to do it so it works properly:
First, let's have a look more in details how the servers process the image depending if found or not.
- When an image is found by the Cloudimage server the below process happens in order:
- download of the image
- inherit of the original image size and proportion
- use of those to fill in the missing size values
- apply any transformation as instructed
2. When the image is missing from the origin server the below process happens:
- by default, w/h inherits a value of 400/400
- the server returns to the CDN server the error response + the default image resized with the available values while skipping all the other processes mentioned in point 1.
As a reminder, the default image is with w/h = 400/400 values unless stated otherwise in the URL.
This is a server-based resolution and even if you upload a larger image, the result would still be 400/400 for the original default image.
The default image size will be changed ONLY IF you manually set Cloudimage width and height.
In a scenario, let's say the page is configured to deliver images with w=48&h=100% (h = the so-called variable height).
So, as expected the placeholder returns w= 48 and h= the original image height (so 400px), with the default image fitted in this frame, respecting its square proportions of 400x400.
Something like this would be the result:
It is an expected behavior and you should then place actual pixel values if you wish to have it in a specific way.
This is related to the fact that delivering default images (with no function added) does not change the default size values for the image, and is a server-side default process engineered to take the least resources possible in order to serve best existing images.