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

Allow image uploads to be optimised to reduce bandwidth. #3412

Merged
merged 9 commits into from
Oct 16, 2024

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Oct 15, 2024

Follow on from #3408 and part of #3398, this PR implements the changes for image processing. I've re-written the processor quite a bit so this PR is broken down into chunks to make it easier to review.

Things to note:

  • We don't need to worry about potentially upscaling, CoreGraphics happily ignores that for us.
  • We optimise HEIC files as JPEG, but send them as HEIC when unoptimised.
  • We optimise PNGs as PNG to retain alpha and better compression of screenshots.
  • We don't optimise GIFs as it would destroy the animation.
  • All other image types are optimised as JPEG.

@pixlwave pixlwave requested a review from a team as a code owner October 15, 2024 09:26
@pixlwave pixlwave requested review from Velin92 and removed request for a team October 15, 2024 09:26
@pixlwave pixlwave force-pushed the doug/optimised-images branch from 16e5b43 to ec509a5 Compare October 15, 2024 09:27
Copy link

github-actions bot commented Oct 15, 2024

Warnings
⚠️ Some of the commits are missing ticket numbers. Please consider squashing all commits that don't have a tracking number.

Generated by 🚫 Danger Swift against f7b9c0d

Copy link

codecov bot commented Oct 15, 2024

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
845 2 843 0
View the full list of 2 ❄️ flaky tests
PreviewTests test_joinRoomScreen()

Flake rate in main: 15.38% (Passed 22 times, Failed 4 times)

Stack Traces | 3.38s run time
failed - Snapshot "Unknown" does not match reference.

@−
"file:.../__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Unknown.png"
@+
"file:.../tmp/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Unknown.png"

To configure output for a custom diff tool, use 'withSnapshotTesting'. For example:

    withSnapshotTesting(diffTool: .ksdiff) {
      // ...
    }

The percentage of pixels that match 0.9661255 is less than required 1.0
The lowest perceptual color precision 0.39999998 is less than required 0.98 (.../PreviewTests/Sources/PreviewTests.swift:84)
PreviewTests test_roomMemberDetailsScreen()

Flake rate in main: 19.21% (Passed 328 times, Failed 78 times)

Stack Traces | 3.73s run time
failed - Snapshot "Other User" does not match reference.

@−
"file:.../__Snapshots__/PreviewTests/test_roomMemberDetailsScreen-iPhone-16-en-GB.Other-User.png"
@+
"file:.../tmp/PreviewTests/test_roomMemberDetailsScreen-iPhone-16-en-GB.Other-User.png"

To configure output for a custom diff tool, use 'withSnapshotTesting'. For example:

    withSnapshotTesting(diffTool: .ksdiff) {
      // ...
    }

The percentage of pixels that match 0.85461426 is less than required 1.0
The lowest perceptual color precision 0.148125 is less than required 0.98 (.../PreviewTests/Sources/PreviewTests.swift:84)

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

Copy link

@pixlwave pixlwave added the pr-wip for anything that isn't ready to ship and will be enabled at a later date label Oct 15, 2024
@pixlwave pixlwave merged commit 6078398 into develop Oct 16, 2024
9 checks passed
@pixlwave pixlwave deleted the doug/optimised-images branch October 16, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-wip for anything that isn't ready to ship and will be enabled at a later date
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants