Package com.kernelcrew.moodapp.utils
Class PhotoUtils
java.lang.Object
com.kernelcrew.moodapp.utils.PhotoUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompressPhoto
(Bitmap photo) Compress a Bitmap photo into a WEBP encoded byte array.static Bitmap
decodePhoto
(List<Integer> byteList) Decode a WEBP-encoded image into a bitmap.
-
Constructor Details
-
PhotoUtils
public PhotoUtils()
-
-
Method Details
-
compressPhoto
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
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
-