mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 17:26:37 +02:00
🐛 Fix issue on fressian blob encoding.
This commit is contained in:
parent
8e4338c1c9
commit
ff4d3cfeac
1 changed files with 29 additions and 7 deletions
|
@ -10,16 +10,18 @@
|
||||||
[app.common.geom.point :as gpt]
|
[app.common.geom.point :as gpt]
|
||||||
[clojure.data.fressian :as fres])
|
[clojure.data.fressian :as fres])
|
||||||
(:import
|
(:import
|
||||||
clojure.lang.Ratio
|
|
||||||
org.fressian.handlers.WriteHandler
|
|
||||||
org.fressian.handlers.ReadHandler
|
|
||||||
org.fressian.Writer
|
|
||||||
org.fressian.Reader
|
|
||||||
org.fressian.StreamingWriter
|
|
||||||
app.common.geom.matrix.Matrix
|
app.common.geom.matrix.Matrix
|
||||||
app.common.geom.point.Point
|
app.common.geom.point.Point
|
||||||
|
clojure.lang.Ratio
|
||||||
java.io.ByteArrayInputStream
|
java.io.ByteArrayInputStream
|
||||||
java.io.ByteArrayOutputStream))
|
java.io.ByteArrayOutputStream
|
||||||
|
java.time.Instant
|
||||||
|
java.time.OffsetDateTime
|
||||||
|
org.fressian.Reader
|
||||||
|
org.fressian.StreamingWriter
|
||||||
|
org.fressian.Writer
|
||||||
|
org.fressian.handlers.ReadHandler
|
||||||
|
org.fressian.handlers.WriteHandler))
|
||||||
|
|
||||||
;; --- MISC
|
;; --- MISC
|
||||||
|
|
||||||
|
@ -92,6 +94,20 @@
|
||||||
(.-e ^Matrix o)
|
(.-e ^Matrix o)
|
||||||
(.-f ^Matrix o)))))}
|
(.-f ^Matrix o)))))}
|
||||||
|
|
||||||
|
Instant
|
||||||
|
{"java/instant"
|
||||||
|
(reify WriteHandler
|
||||||
|
(write [_ w ch]
|
||||||
|
(.writeTag w "java/instant" 1)
|
||||||
|
(.writeInt w (.toEpochMilli ^Instant ch))))}
|
||||||
|
|
||||||
|
OffsetDateTime
|
||||||
|
{"java/instant"
|
||||||
|
(reify WriteHandler
|
||||||
|
(write [_ w ch]
|
||||||
|
(.writeTag w "java/instant" 1)
|
||||||
|
(.writeInt w (.toEpochMilli ^Instant (.toInstant ^OffsetDateTime ch)))))}
|
||||||
|
|
||||||
Ratio
|
Ratio
|
||||||
{"ratio"
|
{"ratio"
|
||||||
(reify WriteHandler
|
(reify WriteHandler
|
||||||
|
@ -181,6 +197,12 @@
|
||||||
(read [_ rdr _ _]
|
(read [_ rdr _ _]
|
||||||
(char (.readObject rdr))))
|
(char (.readObject rdr))))
|
||||||
|
|
||||||
|
"java/instant"
|
||||||
|
(reify ReadHandler
|
||||||
|
(read [_ rdr _ _]
|
||||||
|
(Instant/ofEpochMilli (.readInt rdr))))
|
||||||
|
|
||||||
|
|
||||||
"clj/ratio"
|
"clj/ratio"
|
||||||
(reify ReadHandler
|
(reify ReadHandler
|
||||||
(read [_ rdr _ _]
|
(read [_ rdr _ _]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue