asales Expert Licensed User Longtime User Jun 8, 2021 #1 As Erel says in this reply, we can write only the JPEG and PNG formats using B4XBitmap. In Android we have the WEBP CompressFormat too (WEBP_LOSSY and WEBP_LOSSLESS to the API level 30): Bitmap.CompressFormat | Android Developers developer.android.com Would be nice to have this in B4XBitmap to write WEBP files.
As Erel says in this reply, we can write only the JPEG and PNG formats using B4XBitmap. In Android we have the WEBP CompressFormat too (WEBP_LOSSY and WEBP_LOSSLESS to the API level 30): Bitmap.CompressFormat | Android Developers developer.android.com Would be nice to have this in B4XBitmap to write WEBP files.
Erel B4X founder Staff member Licensed User Longtime User Jun 9, 2021 #2 You can pass WEBP in B4A: Code: Dim out As OutputStream = File.OpenOutput(File.DirInternal, "1.webp", False) bmp.WriteToStream(out, 100, "WEBP") out.Close
You can pass WEBP in B4A: Code: Dim out As OutputStream = File.OpenOutput(File.DirInternal, "1.webp", False) bmp.WriteToStream(out, 100, "WEBP") out.Close
asales Expert Licensed User Longtime User Jun 10, 2021 #3 Erel said: You can pass WEBP in B4A Click to expand... Thanks Erel. I tried this before, without success, but I think that I found the problem. I checked again and the problem maybe in my device (Moto G4 with Android 7). I'm using the quality = 70 (to reduce the size to use in WhatsApp stickers) and, in this device, the app crashes. I see erros only in the unfiltered logs. If I change the quality to 100, it works. I tested the changes in the quality in another devices and don't get errors.
Erel said: You can pass WEBP in B4A Click to expand... Thanks Erel. I tried this before, without success, but I think that I found the problem. I checked again and the problem maybe in my device (Moto G4 with Android 7). I'm using the quality = 70 (to reduce the size to use in WhatsApp stickers) and, in this device, the app crashes. I see erros only in the unfiltered logs. If I change the quality to 100, it works. I tested the changes in the quality in another devices and don't get errors.
Peter Simpson Expert Licensed User Longtime User Jun 10, 2021 #4 Erel said: You can pass WEBP in B4A: Click to expand... and B4i