Class PhotoUtils

java.lang.Object
com.kernelcrew.moodapp.utils.PhotoUtils

public class PhotoUtils extends Object
  • Constructor Details

    • PhotoUtils

      public PhotoUtils()
  • Method Details

    • compressPhoto

      public static List<Integer> compressPhoto(@NonNull Bitmap photo)
      Compress a Bitmap photo into a WEBP encoded byte array. The byte array is returned as a List<Integer> to be compatible with Firestore serialization.
      Parameters:
      photo - Photo to complete
      Returns:
      Encoded byte array
    • decodePhoto

      public static Bitmap decodePhoto(@NonNull List<Integer> byteList)
      Decode a WEBP-encoded image into a bitmap. Takes the byte list as a List<Integer> to be compatible with Firestore.
      Parameters:
      byteList - List of bytes encoding the WEBP image
      Returns:
      Decoded image as a Bitmap