And I’ve added extra members to be able to crop by ratio:Īdding transformations is a way more maintenance friendly process, you don’t need to go over all of your assets to generate a new public link. I’ve first extended my own cropping definition class with a boolean to indicate I want to generate a public link for the original image (without cropping, this is also a new feature of this version). I simply added the possibility to crop on ratio instead of size, and moved the cropping by size to the transformation functionality of Content Hub. The solution I came up with drastically reduces the amount of required public links, while removing any limitation caused by predefined image sizes. You could add all of your image sizes in twice the resolution, but than you would even double the amount of required public links! Lastly, the third disadvantage is a huge blocker in flexibility and maintenance if you ever want to extend the list of desired image resolutions.Īdditionally, I should mention that while transformations are generated on demand, they are still being cached on CDN after that, making each subsequent request way faster. If you want to serve the image on your website for retina displays you would need 2048 x 1152 for example, which is perfectly possible given the original image size. The second disadvantage means that you rule out the possibility of delivering content for retina displays: if you pre-configure a fixed size like 1024 x 576 while the original image is 5624 x 3749, you are inadvertently loosing a lot of image data. The first disadvantage means that you will end up with a lot of public links, which clutters the user interface and has a negative impact on performance upon regeneration of the public links (when the focal point changes, when the source image changes, or when the user requests to refresh the public links) and possibly on your Content Hub implementation in general. and you cannot easily add a new image size to all of your assets.you are unnecessarily downsizing your original image too early in the process,.you would have to create a public link for each desired image size,.Those two reasons steered me in the direction of basing my initial focal point crop functionality solely on public links.Īfter the first pilot phase though, I discovered three disadvantages of this method: Also, public links can be custom cropped, thus the algorithm can be influenced to obtain the desired result of focal point cropping while transformations can only be either cropped ‘smart’ or centered. Public links are pre-generated and cached on CDN, and transformations are generated on-the-fly.
0 Comments
Leave a Reply. |