Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
17d80642
Commit
17d80642
authored
Jun 24, 2015
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #517 from mgomezch/diagrams-binary-readfile
Use readFile from ByteString to read binary files
parents
cb55d6b1
df38a542
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
Diagrams.hs
...ll-display/ihaskell-diagrams/IHaskell/Display/Diagrams.hs
+3
-3
Animation.hs
.../ihaskell-diagrams/IHaskell/Display/Diagrams/Animation.hs
+2
-2
No files found.
ihaskell-display/ihaskell-diagrams/IHaskell/Display/Diagrams.hs
View file @
17d80642
...
...
@@ -34,11 +34,11 @@ diagramData renderable format = do
renderCairo
filename
(
mkSizeSpec2D
(
Just
imgWidth
)
(
Just
imgHeight
))
renderable
-- Convert to base64.
imgData
<-
readFile
filename
imgData
<-
Char
.
readFile
filename
let
value
=
case
format
of
PNG
->
png
(
floor
imgWidth
)
(
floor
imgHeight
)
$
base64
(
Char
.
pack
imgData
)
SVG
->
svg
imgData
PNG
->
png
(
floor
imgWidth
)
(
floor
imgHeight
)
$
base64
imgData
SVG
->
svg
(
Char
.
unpack
imgData
)
return
value
...
...
ihaskell-display/ihaskell-diagrams/IHaskell/Display/Diagrams/Animation.hs
View file @
17d80642
...
...
@@ -48,8 +48,8 @@ animationData renderable = do
mainRender
(
diagOpts
,
gifOpts
)
frameSet
-- Convert to ascii represented base64 encoding
imgData
<-
readFile
filename
return
.
T
.
unpack
.
base64
.
CBS
.
pack
$
imgData
imgData
<-
CBS
.
readFile
filename
return
.
T
.
unpack
.
base64
$
imgData
-- Rendering hint.
animation
::
Animation
Cairo
V2
Double
->
Animation
Cairo
V2
Double
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment