Question regarding automatic image file type conversion
Hi all,
I've just been reading about automatic image file type conversion, as described in your docs linked. I recently saw a social media post about how you can upload imagery into the XbyK content hub and define rules that automatically convert that image to WebP, for example.
Is this a conversion of the original physical file, or is this a conversion when the image is served via the API? Your docs sound like it changes the original uploaded file in the content hub.
Does this mean...
- If the CMS editor then downloads that file again, will it give them a WebP instead of the JPG or PNG (etc) they might have been expecting?
- And does this work well with email channels, or do you advise against using this if you are using an email channel? I'm may be totally wrong but I think many email clients still have an issue serving WebP?
We're looking to use XbyK SaaS in our next build, and I need to figure out the best way of serving imagery, because historically we've always used our own self-hosted image processing module.
Environment
- Xperience by Kentico version: Latest
- .NET version: 8, 9
- Execution environment: SaaS & Private cloud
- Link to relevant https://docs.kentico.com/developers-and-admins/development/content-types#automatically-optimize-image-assets
Answers
Hi Daniel,
I just tested it out. The image gets converted immediately after the upload. When the editor downloads it using the download icon, they get the converted image. Looking at the file system, both the original and converted files are kept. See the screenshot โ I uploaded a JPG image and got a WebP. The JPG version doesnโt seem to be accessible from the XbyK UI.
When I render the image URL in an email through a macro, I also see the converted image version. I agree with your concern about using WebP images in emails, as they are not widely supported by email clients.
Milan is correct ๐.
Image transformation in Xperience by Kentico is currently performed on upload, which is different than previous versions of Kentico where the built-in image optimization was performed on request.
An additional explanation of the feature can be found in the Kentico Community blog post - Xperience by Kentico Refresh - December 12, 2024.
This means you don't need to add a hash/signature to every auto-generated image variant to prevent a DoS attack of your application.
We only support 1 image variant at this time, but we plan to support multiple in the future and potentially offer a combination of on upload and on request optimization and transformation.
The original uploaded image is always saved (this lets you re-transform the original image after uploading) and if you download the image from the administration UI you are downloading the original un-transformed version. When retrieving the image via content delivery APIs, we always serve the transformed version of the image and you do not have direct access to the original through these APIs.
Webp has much better support across email clients than it did even a few years ago, however if email recipients are not using the web or new desktop version of Outlook, they could have issues seeing the image.
If you want to avoid sending webp images to your email recipients today you would either need to specify a fallback image and use VML to render that only for older versions of Outlook.
That fallback image could be static or it could be a second Content Item Asset field on your Content Type that is configured to have optimization/transformation convert to a supported format like jpg or png.
If you would like to have more flexible image variant selection, send us some feedback on our roadmap explaining your use cases ๐.
To answer this question, you have to login first.