kopia lustrzana https://github.com/ryukoposting/Signal-Android
Treat SVGs as document attachments.
rodzic
4ae129d2af
commit
b94624fd5a
|
@ -73,6 +73,7 @@ import org.thoughtcrime.securesms.sharing.ShareActivity;
|
||||||
import org.thoughtcrime.securesms.util.AttachmentUtil;
|
import org.thoughtcrime.securesms.util.AttachmentUtil;
|
||||||
import org.thoughtcrime.securesms.util.DateUtils;
|
import org.thoughtcrime.securesms.util.DateUtils;
|
||||||
import org.thoughtcrime.securesms.util.FullscreenHelper;
|
import org.thoughtcrime.securesms.util.FullscreenHelper;
|
||||||
|
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||||
import org.thoughtcrime.securesms.util.SaveAttachmentTask;
|
import org.thoughtcrime.securesms.util.SaveAttachmentTask;
|
||||||
import org.thoughtcrime.securesms.util.SaveAttachmentTask.Attachment;
|
import org.thoughtcrime.securesms.util.SaveAttachmentTask.Attachment;
|
||||||
import org.thoughtcrime.securesms.util.StorageUtil;
|
import org.thoughtcrime.securesms.util.StorageUtil;
|
||||||
|
@ -534,7 +535,7 @@ public final class MediaPreviewActivity extends PassphraseRequiredActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isContentTypeSupported(final String contentType) {
|
public static boolean isContentTypeSupported(final String contentType) {
|
||||||
return contentType != null && (contentType.startsWith("image/") || contentType.startsWith("video/"));
|
return MediaUtil.isImageType(contentType) || MediaUtil.isVideoType(contentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -293,7 +293,7 @@ public class MediaUtil {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return contentType.startsWith("image/") ||
|
return (contentType.startsWith("image/") && !contentType.equals("image/svg+xml")) ||
|
||||||
contentType.equals(MediaStore.Images.Media.CONTENT_TYPE);
|
contentType.equals(MediaStore.Images.Media.CONTENT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,10 @@ final class MemoryFileDescriptorProxy {
|
||||||
try {
|
try {
|
||||||
InputStream inputStream = memoryFile.getInputStream();
|
InputStream inputStream = memoryFile.getInputStream();
|
||||||
if(inputStream.skip(offset) != offset){
|
if(inputStream.skip(offset) != offset){
|
||||||
|
if (offset > memoryFile.length()) {
|
||||||
|
throw new ErrnoException("onRead", OsConstants.EIO);
|
||||||
|
}
|
||||||
|
|
||||||
throw new AssertionError();
|
throw new AssertionError();
|
||||||
}
|
}
|
||||||
return inputStream.read(data, 0, size);
|
return inputStream.read(data, 0, size);
|
||||||
|
|
Ładowanie…
Reference in New Issue