summaryrefslogtreecommitdiffstats
path: root/example_sync.nim
blob: 08ce3e8bf908916e7b2625b5296e70bc329a3143 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import nimjpg
import asyncdispatch
import asyncfile
import json

var result: cint

if paramCount()  == 0:
  echo "Gimme a file pls"
  quit(QuitFailure)

let path = paramStr(1)

init_jpg()

if fileExists(path):
  let file = open(path)
  echo pretty(%* collect_jpg(file))
else:
  echo "Gimme an existing file pls"

deinit_jpg()