Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUM-8774 SessionReplay Image recording uses correct frame calculation for scaleAspectFill #2200

Merged
merged 3 commits into from
Feb 25, 2025

Conversation

Valpertui
Copy link
Contributor

@Valpertui Valpertui commented Feb 24, 2025

What and why?

What?
In Session Replay when capturing images from UIImageView with contentMode scaleAspectFill, in some condition the computed CGRect which represent what the customer will see on Session Replay Player, did not match what was displayed on device.

Why?
The condition used to find which dimension "scaling factor" to apply (height or width), was comparing the distance (in points) difference between the container and the content, instead of comparing the scaling factors required so that the image fill properly the container for both dimensions.

How?

The fix change this condition to now compute both the x and y scaling factor needed so the content image fills the container, and select the biggest of the two (using max), ensuring the image always fill the container in both dimensions.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

@Valpertui Valpertui marked this pull request as ready for review February 24, 2025 15:43
@Valpertui Valpertui requested review from a team as code owners February 24, 2025 15:43
@Valpertui Valpertui requested a review from ambushwork February 24, 2025 15:43
maxep
maxep previously approved these changes Feb 24, 2025
Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, Thanks!!

@Valpertui Valpertui force-pushed the valpertui/RUM-8774/bug-session-replay-image-size branch from 58b41ef to 3dc874a Compare February 25, 2025 13:59
@Valpertui Valpertui merged commit 363861d into develop Feb 25, 2025
14 checks passed
@Valpertui Valpertui deleted the valpertui/RUM-8774/bug-session-replay-image-size branch February 25, 2025 15:50
@ncreated ncreated mentioned this pull request Mar 6, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants