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
This commit is contained in:
Lorenzo Blasa
2022-11-24 07:14:55 -08:00
committed by Facebook GitHub Bot
parent 89740f7e0a
commit 43f44652f4
2 changed files with 2 additions and 2 deletions

View File

@@ -115,7 +115,7 @@ class TreeObserverManager(val context: Context) {
} else { } else {
val stream = ByteArrayOutputStream() val stream = ByteArrayOutputStream()
val base64Stream = Base64OutputStream(stream, Base64.DEFAULT) 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() val snapshot = stream.toString()
serialized = serialized =
Json.encodeToString( Json.encodeToString(

View File

@@ -212,7 +212,7 @@ function Visualization2DNode({
<NodeBorder hovered={isHovered} tags={node.tags}></NodeBorder> <NodeBorder hovered={isHovered} tags={node.tags}></NodeBorder>
{snapshot && ( {snapshot && (
<img <img
src={'data:image/jpeg;base64,' + snapshot} src={'data:image/png;base64,' + snapshot}
style={{maxWidth: '100%'}} style={{maxWidth: '100%'}}
/> />
)} )}