summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Pässler <milan@petabyte.dev>2021-03-13 13:10:02 +0100
committerMilan Pässler <milan@petabyte.dev>2021-03-13 13:10:02 +0100
commit6543530ab3297bbc052deaffc710d6c301ccefbe (patch)
tree2f90a492e3f409e28ac3d0bb3369e653b8b874c2
parent0a9ec93260308a3f95117f3a19b1300fe79d5797 (diff)
downloadnimjpg-6543530ab3297bbc052deaffc710d6c301ccefbe.tar.gz
nimjpg-6543530ab3297bbc052deaffc710d6c301ccefbe.tar.bz2
nimjpg-6543530ab3297bbc052deaffc710d6c301ccefbe.zip
commit utils file
-rw-r--r--exif.nim2
-rw-r--r--utils.nim7
2 files changed, 7 insertions, 2 deletions
diff --git a/exif.nim b/exif.nim
index 775e6e4..e5e7210 100644
--- a/exif.nim
+++ b/exif.nim
@@ -11,8 +11,6 @@ proc deinit_exif*() =
dealloc(buf)
proc collect_exif_data*(ed: ptr ExifData): Table[string, string] {.gcsafe.} =
- #result = initTable[string, string]()
-
proc process_entries(entry: ptr ExifEntry , callback_data: pointer) {.cdecl.} =
let name = exif_tag_get_name(entry.tag)
let val = exif_entry_get_value(entry, buf, 2000)
diff --git a/utils.nim b/utils.nim
new file mode 100644
index 0000000..76f8d02
--- /dev/null
+++ b/utils.nim
@@ -0,0 +1,7 @@
+template debug*(x: varargs[untyped]) =
+ if not defined(release):
+ echo(x)
+
+template error*(x: varargs[untyped]) =
+ echo(x)
+ quit(1)