mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Merge pull request #7451 from hayaksi1/fix/7059-relax-image-compression
Relax image compression so photos and screenshots keep more detail
This commit is contained in:
+2
-2
@@ -62,10 +62,10 @@ class AndroidMediaPreProcessor(
|
|||||||
/**
|
/**
|
||||||
* Used for calculating `inSampleSize` for bitmaps.
|
* Used for calculating `inSampleSize` for bitmaps.
|
||||||
*
|
*
|
||||||
* *Note*: Ideally, this should result in images of up to (but not included) 1280x1280 being sent. However, images with very different width and height
|
* *Note*: Ideally, this should result in images of up to (but not included) 2560x2560 being sent. However, images with very different width and height
|
||||||
* values may surpass this limit. (i.e.: an image of `480x3000px` would have `inSampleSize=1` and be sent as is).
|
* values may surpass this limit. (i.e.: an image of `480x3000px` would have `inSampleSize=1` and be sent as is).
|
||||||
*/
|
*/
|
||||||
private const val IMAGE_SCALE_REF_SIZE = 640
|
private const val IMAGE_SCALE_REF_SIZE = 1280
|
||||||
|
|
||||||
private val notCompressibleImageTypes = listOf(MimeTypes.Gif, MimeTypes.WebP)
|
private val notCompressibleImageTypes = listOf(MimeTypes.Gif, MimeTypes.WebP)
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -255,10 +255,10 @@ class AndroidMediaPreProcessorTest : RobolectricTest() {
|
|||||||
assertThat(info.thumbnailFile).isNotNull()
|
assertThat(info.thumbnailFile).isNotNull()
|
||||||
assertThat(info.imageInfo).isEqualTo(
|
assertThat(info.imageInfo).isEqualTo(
|
||||||
ImageInfo(
|
ImageInfo(
|
||||||
height = 979,
|
height = 1958,
|
||||||
width = 3006,
|
width = 6012,
|
||||||
mimetype = MimeTypes.Jpeg,
|
mimetype = MimeTypes.Jpeg,
|
||||||
size = 84_845,
|
size = 682_492,
|
||||||
ThumbnailInfo(height = 244, width = 751, mimetype = MimeTypes.Jpeg, size = 7_178),
|
ThumbnailInfo(height = 244, width = 751, mimetype = MimeTypes.Jpeg, size = 7_178),
|
||||||
thumbnailSource = null,
|
thumbnailSource = null,
|
||||||
blurhash = "K07gBzX=j_D4xZjoaSe,s:"
|
blurhash = "K07gBzX=j_D4xZjoaSe,s:"
|
||||||
@@ -280,10 +280,10 @@ class AndroidMediaPreProcessorTest : RobolectricTest() {
|
|||||||
assertThat(info.thumbnailFile).isNull()
|
assertThat(info.thumbnailFile).isNull()
|
||||||
assertThat(info.imageInfo).isEqualTo(
|
assertThat(info.imageInfo).isEqualTo(
|
||||||
ImageInfo(
|
ImageInfo(
|
||||||
height = 979,
|
height = 1_958,
|
||||||
width = 3_006,
|
width = 6_012,
|
||||||
mimetype = MimeTypes.Jpeg,
|
mimetype = MimeTypes.Jpeg,
|
||||||
size = 84_845,
|
size = 682_492,
|
||||||
thumbnailInfo = null,
|
thumbnailInfo = null,
|
||||||
thumbnailSource = null,
|
thumbnailSource = null,
|
||||||
blurhash = null,
|
blurhash = null,
|
||||||
|
|||||||
Reference in New Issue
Block a user