language_model: Fix `ImageSize` storing pre-downscale dimensions (#54357)

When images are resized to meet provider size constraints (Anthropic's
1568px limit or the 5MB encoded-PNG cap), the stored ImageSize was still
recording the original width/height rather than the final post-downscale
dimensions. This caused incorrect token estimation via estimate_tokens()
since it uses width * height / 750.

Use processed_image.dimensions() after all downscale passes so that
ImageSize reflects the actual image sent to the provider.

Release Notes:

- Fixed an issue where token estimation would be incorrect in case where
the thread contained downscaled images.
f2f9e2766bDaniel Strobusch committed on 4/21/2026, 10:36:22 AM· committed by GitHubparentedfd8c8
1 file changedLine totals unavailable