Skip to content

Support high-quality image uploading #13

Description

@akiomik

Currently:

  • Converted to bitmap
  • Resize image if necessary
  • Compress bitmap as jpeg
  • Upload jpeg

Expected:

  • Resize or compress if the size is larger than 1000px or 300KB
  • Upload in its original format

fun convertToUploadableImage(source: ImageDecoder.Source): ByteArray {
val bitmap = resizeImage(ImageDecoder.decodeBitmap(source))
val stream = ByteArrayOutputStream()
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream)
return stream.toByteArray()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions