I'm currently uploading an image to a s3 bucket via Media Collection using the beforeChange hook. After using the GetObjectCommand to retrieve the image from s3, I am trying to do a file size check on the image file to make sure it isn't a duplicate image being uploaded. However, the filesize property inside the Media collection record displays a smaller size, than the original image size. Is there a way to get the original image size? (My assumption is that payload is compressing the image behind the scenes using sharp). Images attached. TY.
I am not sure of the image size differences off hand. Have you looked into using the cloud storage plugin?https://payloadcms.com/blog/plugin-cloud-storage
Thanks Jarrod. Will take a look.