Render images in a conversation true-to-size.

Previously, we were always rendering images as squares. Instead of doing
that, we now render them as close to true-to-size as possible (within
reasonable min/max width/height boundaries).
This commit is contained in:
Greyson Parrelli
2018-03-20 11:27:11 -07:00
committed by Moxie Marlinspike
parent 9f8b4cf892
commit ea374735e1
25 changed files with 376 additions and 55 deletions

View File

@@ -12,15 +12,15 @@ public class UriAttachment extends Attachment {
public UriAttachment(@NonNull Uri uri, @NonNull String contentType, int transferState, long size,
@Nullable String fileName, boolean voiceNote)
{
this(uri, uri, contentType, transferState, size, fileName, null, voiceNote);
this(uri, uri, contentType, transferState, size, 0, 0, fileName, null, voiceNote);
}
public UriAttachment(@NonNull Uri dataUri, @Nullable Uri thumbnailUri,
@NonNull String contentType, int transferState, long size,
@NonNull String contentType, int transferState, long size, int width, int height,
@Nullable String fileName, @Nullable String fastPreflightId,
boolean voiceNote)
{
super(contentType, transferState, size, fileName, null, null, null, null, fastPreflightId, voiceNote, 0, 0);
super(contentType, transferState, size, fileName, null, null, null, null, fastPreflightId, voiceNote, width, height);
this.dataUri = dataUri;
this.thumbnailUri = thumbnailUri;
}