From 43f44652f43de1cfb5786c73cab04abb10bde498 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Thu, 24 Nov 2022 07:14:55 -0800 Subject: [PATCH] Change snapshots format to png Summary: There was an issue whereas snapshots were not properly rendered on retina devices. After running a few tests, the issue seems to be solved by changing the snapshot format from jpeg to png. Reviewed By: antonk52 Differential Revision: D41520939 fbshipit-source-id: 1563fe89162e41f71418357a7e58caaf46581f04 --- .../flipper/plugins/uidebugger/observers/TreeObserverManager.kt | 2 +- .../plugins/public/ui-debugger/components/Visualization2D.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/facebook/flipper/plugins/uidebugger/observers/TreeObserverManager.kt b/android/src/main/java/com/facebook/flipper/plugins/uidebugger/observers/TreeObserverManager.kt index f5e1adfc8..3e974358a 100644 --- a/android/src/main/java/com/facebook/flipper/plugins/uidebugger/observers/TreeObserverManager.kt +++ b/android/src/main/java/com/facebook/flipper/plugins/uidebugger/observers/TreeObserverManager.kt @@ -115,7 +115,7 @@ class TreeObserverManager(val context: Context) { } else { val stream = ByteArrayOutputStream() val base64Stream = Base64OutputStream(stream, Base64.DEFAULT) - treeUpdate.snapshot.bitmap?.compress(Bitmap.CompressFormat.JPEG, 100, base64Stream) + treeUpdate.snapshot.bitmap?.compress(Bitmap.CompressFormat.PNG, 100, base64Stream) val snapshot = stream.toString() serialized = Json.encodeToString( diff --git a/desktop/plugins/public/ui-debugger/components/Visualization2D.tsx b/desktop/plugins/public/ui-debugger/components/Visualization2D.tsx index 40d0cc704..e034a812f 100644 --- a/desktop/plugins/public/ui-debugger/components/Visualization2D.tsx +++ b/desktop/plugins/public/ui-debugger/components/Visualization2D.tsx @@ -212,7 +212,7 @@ function Visualization2DNode({ {snapshot && ( )}