Looking at Site engine (enonic.com) the pageAsJson is probably the way it is because of the page renderer.
I can find the image objects matching the Uuid’s used in the pageAsJson in
- references
- children
- components
Don’t know witch is the best one, but one of them must be good. (Please tell if one is better as the others)
I can get the imageUrl by using the
mediaUrl(download:false, type:absolute)
found here Accessing images - scaling - Help - Enonic Discuss
I can can convert the mediaUrl to an imageUrl by combining the xAsJson.media.imageInfo and the image scaling functions explained here Image service (enonic.com) .
Converting the mediaUrl to an imageUrl by hand seems brittle.
Is there an imageUrl version that automatically applies the scaling from the xAsJson?
Alternatively could there be a npm lib function that does that and we can include in Next.js?