Enhance webp_uploads_pre_generate_additional_image_source
filter to support returning filesize
value
#333
Labels
[Plugin] Modern Image Formats
Issues for the Modern Image Formats plugin (formerly WebP Uploads)
[Type] Enhancement
A suggestion for improvement of an existing feature
Milestone
Follow-up to #307: As identified by @mitogh in #318 (review) and then further discussed in #160 (comment), we should allow developers to optionally return the file size of a custom generated additional image source when using the
webp_uploads_pre_generate_additional_image_source
. This is crucial for implementations where e.g. the image is hosted in a CDN, which would mean that callingfilesize()
on a path would not be feasible.It is probably best to make the
filesize
field optional, for two reasons:filesize()
on thepath
returned.Since the
path
returned is only relevant for callingfilesize()
, I suggest we implement the change as follows:file
key to be included in the array.path
orfilesize
to be included in the array.path
, keep callingfilesize()
on it like today.filesize
, use that value as is to return it within the result array.The text was updated successfully, but these errors were encountered: