digitalpoint
Well-known member
- Affected version
- 2.2.8p1
I noticed avatars were sometimes being saved twice when uploading (annoying when you are using a 3rd party API for storing them). It's saved once when you upload it, and then again when you hit "Okay" on the Avatar window.
Did a little digging, and it appears to think there's an avatar crop adjustment even when there is none. If you upload the attached avatar, the
Have tried it with other images, and the same thing happens... with wider images it's varying by 1px on the x axis. In both cases, it causes an extra avatar write because it thinks the crop position changed when it has not.
My guess is that it's a rounding issue (maybe the JavaScript size is calculating the crop pixels differently than the PHP side?). Either way the end result is avatars are being saved twice without being cropped.
Did a little digging, and it appears to think there's an avatar crop adjustment even when there is none. If you upload the attached avatar, the
xf_user_profile.avatar_crop_y
column is set to 16
. When you hit "Okay" to close the dialog, that value changes to 15
, causing the avatar to be recreated and resaved.Have tried it with other images, and the same thing happens... with wider images it's varying by 1px on the x axis. In both cases, it causes an extra avatar write because it thinks the crop position changed when it has not.
My guess is that it's a rounding issue (maybe the JavaScript size is calculating the crop pixels differently than the PHP side?). Either way the end result is avatars are being saved twice without being cropped.