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

scale down share preview thumbnail more memory efficiently #1533

Merged
merged 1 commit into from
Apr 12, 2022

Conversation

cyBerta
Copy link
Contributor

@cyBerta cyBerta commented Apr 12, 2022

fixes #1521

However even larger images (~7mb) cannot be sent due to the inefficient way the core scales down images, see deltachat/deltachat-core-rust#2681

Copy link
Member

@r10s r10s left a comment

Choose a reason for hiding this comment

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

works like a charme and fixes the issue!

i only have a small question, see below :)

// Should include kCGImageSourceCreateThumbnailWithTransform: true in the options dictionary. Otherwise, the image result will appear rotated when an image is taken from camera in the portrait orientation.
kCGImageSourceCreateThumbnailWithTransform: true
]
scaledImage = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, options as CFDictionary)
Copy link
Member

Choose a reason for hiding this comment

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

does this function create a physical file? saveImage saves in the .documentDirectory - so that thumbnail would be user-visible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, not this line but earlier in ImageFormat.save(...). That was there before and fixing it is a little bit complicated which is why I didn't add the fix to the other image-cleanup-PR .

@cyBerta cyBerta merged commit 7558bbd into master Apr 12, 2022
@cyBerta cyBerta deleted the share_large_images branch April 12, 2022 17:45
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.

share-to-delta not always working on iphone13
2 participants