Large image pipeline
An iOS feature that edits and saves photos of tens of MB gets killed after a memory warning. From decoding to saving, how would you lower the memory peak?
An iOS feature that edits and saves photos of tens of MB gets killed after a memory warning. From decoding to saving, how would you lower the memory peak?
Instead of decoding the original whole into a UIImage, downsample at decode time with ImageIO's CGImageSourceCreateThumbnailAtIndex to only the size the screen and the edit need, release each stage's intermediate buffers right away with autoreleasepool and short scopes, and for the final save stream the original from disk and process only the region you need.
Performance and debuggingShort answerAdvanced
You need to show a single 50MB photo on screen. If you just load it with…
#downsampling #memory #imageio
Performance and debuggingShort answerAdvanced
A photo editing app gets frequent memory warnings and sometimes gets killed. In what…
#downsampling #memory
iOS system designMultiple choiceIntro
You show 60 thumbnails of 4000×3000 JPEGs in a 3-column grid and memory jumps to several…
#downsampling #memory
Performance and debuggingShort answerAdvanced
Users say "the app just closes," but Crashlytics has nothing. If you suspect…
#memory