I have the following graphQL snippet:
images: bannerImages {
url
width
height
size
}
imagesSmall: bannerImages @transform(handle: "small") {
url
width
height
size
}
which results in the following output:
"images": [
{
"url": "http://127.0.0.1:10000/devstoreaccount1/assets/content-images/banners/banner-1.png",
"width": 1382,
"height": 922,
"size": "2777441"
}
],
"imagesSmall": [
{
"url": "http://127.0.0.1:10000/devstoreaccount1/assets/content-images/banners/_small/banner-1.png",
"width": 170,
"height": 50,
"size": "2777441"
}
]
As you can see above, the url, width & height properties are getting transformed, however, the size property is still showing the size of the original, hi-res file in the imagesSmall version instead of the size of the "small" transform (which is around 2000-3000 bytes in this case)
That's not a GraphQL thing. Currently size always reflects the original image size, so I'll mark this as an enhancement.
This might also happen only for Craft 4.0, as that's a change in behavior that might be breaking for some if they don't expect the size field to reflect the transform filesize.
Most helpful comment
That's not a GraphQL thing. Currently
sizealways reflects the original image size, so I'll mark this as an enhancement.This might also happen only for Craft 4.0, as that's a change in behavior that might be breaking for some if they don't expect the
sizefield to reflect the transform filesize.