This is working as designed.
Images can be automatically resized after they are uploaded and this significantly changes the file size. Given an 8MB image which would have fairly large dimensions, if it was resized all the way down to something small like 1024px x 1024px then clearly it wouldn't be 8MB anymore. At that point we check the final size and if it is below the limit, we accept it, otherwise it would be rejected.
The front end validation you're seeing where it kicks it out much quicker is because the file is likely physically too large to be transmitted to the server. We check things like post_max_size
and upload_max_file_size
. These are hard server limits. Files exceeding these limits would be rejected by PHP or your web server so we wouldn't even be able to attempt to resize the,.
Hope that makes sense.