UBB.threads v7.6.1 introduced a feature which compresses images uploaded as attachments, the compression code is similar to the coding utilized in the gallery.
From the v7.6.1 Changelog: [NEW] Attached images can now be automatically resized at the time of upload. [NEW] Attached images can now be automatically compressed at the time of upload. [NEW] New image "Attachments" page has been added to the Control Panel to control the size and compression of image attachments.
Can the attachment compression code be disabled or enabled ? Is the compression code fixed or is it variable ?
Does the compression code affect the attachment size limit ?
For an example: The attachment limit is set at 300KB. You upload a 325 KB file, Does the 300KB limit reject the file because the file is over the limit or does the limit look at the file size after it has been compressed ?
Do you know the file compression percentage ? 289 -111= 179KB file reduction
You could disable it by setting the compression quality to 100%; though I'm not sure why you'd want to disable compression since image attachments at a 70-80% compression ratio are visually quite similar to an uncompressed image at a fraction of the size.
The attachment size limit (what is allowed to be uploaded) is pre-attachment, as it is an indication of the size of files that the server will allow; then the compression is done after the file is uploaded (to save space on images that're hosted on your server).
The resulting image size is dependent on the output from the image processor (and your settings in the Control Panel); you can't really "guess" what the filesize will be.
Most of these have been answered via threads on these forums, and all settings can be found in the "Attachments" section of the v7.6.1 Control Panel.
BTW, images are both resized and compressed, if you use a visually low quality image (such as being able to actually see individual pixels) and it resizes it and it looks crappy, it'll still have a similar result with or without compression; a photo with high detail will produce a higher result after being resized.
The attached image has a resolution of 1,920px × 1,080px at 449 KB (459,885 bytes), and is compressed to 285.79 KB (292,646 bytes). Since it was under the indicated resolution (1920px) in the Control Panel it was not resized.