Commit Graph

274 Commits

Author SHA1 Message Date
Nora Trapp
6783db210e Add default disappearing message timer 2021-04-29 15:46:43 -07:00
Michelle Linington
054c7a0b0c MP4 looping media support
- Fetch mp4s from Giphy for showing previews
- Fetch mp4s from Giphy for sending (behind featuree flag)
- A new flag on attachments to tag a video as "looping media"
- Videos tagged with this flag will be shown on repeat
2021-04-22 14:53:47 -07:00
Matthew Chen
4959f555f4 Handle video export errors. 2021-04-14 17:34:38 -03:00
Nora Trapp
4dae0ce79a Convert all non-sticker images to jpg 2021-03-27 12:12:46 -07:00
Matthew Chen
d0cbf8cfd0 Rework dependency access. 2021-03-25 09:24:27 -03:00
Nora Trapp
303b3220d9 Actually thumbnail attachments on the attachment preview view 2021-03-17 13:15:51 -07:00
Nora Trapp
ab85b22856 Use CGImageSource for downsampling attachments 2021-03-15 15:05:36 -07:00
Nora Trapp
0785e301cf Clear SignalAttachment caches when we get a memory warning 2021-03-09 12:37:36 -08:00
Jordan Rose
14c93cbd20 Preserve orientation when stripping image metadata 2021-02-11 10:10:16 -08:00
Nora Trapp
dac30cf4db Don't store group threads in memory when sharing 2021-02-05 11:22:15 -08:00
Matthew Chen
645bd76bd5 Rework app readiness. 2021-02-04 09:55:39 -03:00
Matthew Chen
23dc0f021c Avoid OOM crashes in SAE. 2021-01-22 23:22:43 -03:00
Matthew Chen
0931081de1 Avoid OOM crashes in SAE. 2021-01-22 23:22:43 -03:00
Matthew Chen
81c5d61f92 Improve upload progress. 2021-01-22 10:24:36 -08:00
Nora Trapp
0223faba79 Fix a crash when sharing 2021-01-21 20:00:52 -08:00
Nora Trapp
7230dabbc8 Add support for sharing suggestions 2021-01-21 20:00:29 -08:00
Jordan Rose
7c5efec55a Consistently propagate attachment properties when cloning attachments
Previously we had two different ways attachments got cloned: through
the cloneAttachment() method, which made a temporary file with the
original attachment contents, and ad hoc after recompression or
similar. Neither preserved all the properties of the original
attachment; now, both go through a common helper function.
2021-01-19 12:14:42 -08:00
Jordan Rose
831e3c647b Encode images to PNG instead of JPEG if they have an alpha channel 2021-01-14 09:30:10 -08:00
Jordan Rose
6eb1d3cffd Compress all images as JPEG except those that are "sticker-like"
This makes for a more uniform experience and optimizes for bandwidth
when attaching a JPEG that's under our threshold but still pretty big.
Previously we'd send that along after stripping metadata, but now
we'll recompress it regardless.

Sticker-like images are opted out because they usually contain content
that's better represented in a compressed lossless format due to the
use of solid colors...and also we don't want to lose transparency if
we don't need to.

Note that isBorderless is sometimes equivalent to the "sticker-like"
check, but we don't want to rely on that here. isBorderless is a
presentation option.
2021-01-14 09:30:10 -08:00
Jordan Rose
a0c3beaa06 Resize images-as-documents and pasted images as well
Having multiple entry points for this is confusing. If we ever add
back a "send full quality" option, we'll support it everywhere.
2021-01-14 09:30:10 -08:00
Jordan Rose
2014ccc114 Fix JPEG compression to 0.6 after some investigation 2021-01-14 09:30:10 -08:00
Jordan Rose
273b86e1db Make sure to strip image metadata losslessly when possible
Uses the nigh-undocumented CGImageDestinationCopyImageSource instead
of CGImageDestinationAddImageFromSource to avoid having ImageIO
re-encode the image contents.* If that fails, falls back to the
standard resize-as-JPEG logic in all cases rather than just reporting
a failure to strip metadata.

* https://developer.apple.com/library/archive/qa/qa1895/_index.html
2021-01-13 18:07:07 -08:00
Jordan Rose
c799f663c8 Always re-encode video attachments
This is more consistent, results in smaller videos, and makes sure
we're stripping metadata.
2021-01-12 16:43:01 -08:00
Jordan Rose
20ba5aec0d Scale video attachments to 640px instead of AVFoundation's "medium"
The preset name is "640x480", but in practice it's "max longest
dimension of 640", as tested on a widescreen vertical video. This is
still better quality than "medium", which seems to be "longest
dimension of 480".
2021-01-12 16:43:01 -08:00
Jordan Rose
6ce5b0743c Change PhotoLibrary video attachments to match share sheet behavior
Previously: all videos exported using AVFoundation's "medium" quality,
falling back to "low" quality if that was still too big

Now: videos that are already <100MB mp4s are sent as is, others go
through SignalAttachment.compressVideoAsMp4. This is the same as the
share sheet behavior.

We don't actually /like/ this behavior, but now it's all controlled in
one place. The next commit will start changing it.
2021-01-12 16:43:01 -08:00
Nora Trapp
08baf57151 Allow sharing to multiple threads 2021-01-12 15:33:54 -08:00
Michelle Linington
81b06025aa IOS-999: Issues sending/receiving still webp images on iOS
Metadata stripping relies on CoreGraphics, but CoreGraphics doesn't
support WebP. When attempting to send a static WebP, we fail to send
because we fail to strip metadata.

We should account for this by checking the destination formats
CoreGraphics supports. If it doesn't support the type we're trying to
strip, we'll fall back to just converting it to png/jpeg.
2020-12-22 14:22:34 -08:00
Matthew Chen
6e9646a2f9 Try multiple quality levels when exporting video. 2020-12-18 10:54:48 -03:00
Matthew Chen
2dfd9f4b49 Respond to CR. 2020-09-02 13:44:15 -03:00
Matthew Chen
70756d0564 Animated sticker support. 2020-09-02 13:44:15 -03:00
Matthew Chen
1337bdf7ec Animated sticker support. 2020-09-02 13:44:15 -03:00
Matthew Chen
825cb06edb Animated sticker support. 2020-09-02 13:44:15 -03:00
Nora Trapp
65ed060639 Refine MentionTextView, add cut/copy/paste support 2020-07-27 14:30:52 -07:00
Nora Trapp
05d6b57616 Render memoji, bitmoji, etc. as stickers 2020-07-06 11:43:35 -07:00
Nora Trapp
d57335ec28 Forward WebP images as png to preserve any potential alpha 2020-07-02 10:07:38 -07:00
Nora Trapp
9df13c232c Fix sharing of YYImage 2020-07-02 10:06:41 -07:00
Nora Trapp
3afe10ea72 Fix forwarding of webp + heif 2020-07-01 19:39:25 -07:00
Matthew Chen
c7df10eb36 Apply CGSize(square:). 2020-04-06 11:34:21 -03:00
Matthew Chen
2734f01dcd Merge tag '3.3.0.5' 2020-01-27 12:00:09 -03:00
Matthew Chen
993dca8ec9 Remove redundant NotificationName. 2020-01-27 10:53:23 -03:00
Nora Trapp
8a9531f0fa Preserve ordering of albums saved from share sheet 2020-01-25 13:42:57 -08:00
Michael Kirk
f8aabeea76 FIX: can't share from screenshot app
fall back to UIImage provider if URL provider is not available
2020-01-22 07:55:15 -07:00
Nora Trapp
23ade7954f Add share button for media in message actions, fix message details gallery share 2019-12-16 15:39:02 -08:00
Nora Trapp
c667ef54f2 Merge branch 'release/3.0.4' 2019-12-05 16:45:59 -08:00
Nora Trapp
d2cb2b6637 Fix share sheet for iPad 2019-12-05 16:27:45 -08:00
Michael Kirk
2004f44f77 Full screen capture with higher quality preview and output. 2019-11-21 10:00:14 -07:00
Michael Kirk
6093f3aad6 better logging of filesize/resolutions 2019-11-21 10:00:14 -07:00
Matthew Chen
75f7cf6960 Add support for video trimming. 2019-10-31 17:26:38 -03:00
Matthew Chen
69d8bff212 Respond to CR. 2019-10-24 12:04:25 -03:00
Michael Kirk
f6747076df View Once Video 2019-09-26 12:39:26 -07:00