Skip to content

Drawing: Limit scale of rendered annotationview image#24

Merged
frosty merged 4 commits intodevelopfrom
fix/drawing-memory-usage
Sep 3, 2020
Merged

Drawing: Limit scale of rendered annotationview image#24
frosty merged 4 commits intodevelopfrom
fix/drawing-memory-usage

Conversation

@frosty
Copy link
Contributor

@frosty frosty commented Sep 3, 2020

Improves wordpress-mobile/WordPress-iOS#14575, and fixes crashes that I was seeing.

UIGraphicsImageRendererFormat defaults to using the scale of the current screen, which was resulting in images 2 or 3x larger than their originals. This PR updates the renderer format to use a scale of 1.

To test

  • Build and run
  • Choose a device photo (I used the pink flowers) and draw something on top of it
  • Ensure you have the Debug Navigator open in Xcode (showing CPU, memory, etc)
  • When you tap Done, you should just see a small momentary increase in memory:

Screenshot 2020-09-03 at 19 44 11

  • Prior to this PR (you can test develop) you should see a more prolonged and much larger increase in memory. My simulator freezes up for a long time when this happens:

Screenshot 2020-09-03 at 19 45 05

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Pod::Spec.new do |s|
s.name = 'MediaEditor'
s.version = '1.2.0'
s.version = '1.2.1-beta.1'
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think anything else will be added in 1.2.1, we can release it right away with this fix (without using a beta Pod). Wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

@frosty frosty merged commit 8942cb9 into develop Sep 3, 2020
@frosty frosty deleted the fix/drawing-memory-usage branch September 3, 2020 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants