mirror of https://github.com/status-im/nimqml.git
feat: specify tmp dir for images
This commit is contained in:
parent
e557c6118f
commit
2f26af684a
|
@ -10,6 +10,8 @@ template debugMsg(typeName: string, procName: string) =
|
|||
message &= procName
|
||||
debugMsg(message)
|
||||
|
||||
import os
|
||||
|
||||
include "nimqml/private/dotherside.nim"
|
||||
include "nimqml/private/nimqmltypes.nim"
|
||||
include "nimqml/private/qmetaobject.nim"
|
||||
|
@ -37,5 +39,6 @@ proc signal_handler*(receiver: pointer, signal: cstring, slot: cstring) =
|
|||
if(dosqobj.isNil == false):
|
||||
dos_signal(receiver, signal, slot)
|
||||
|
||||
proc image_resizer*(imagePath: string, maxSize: int = 2000): string =
|
||||
result = $dos_image_resizer(imagePath.cstring, maxSize.cint)
|
||||
proc image_resizer*(imagePath: string, maxSize: int = 2000, tmpDir: string): string =
|
||||
discard existsOrCreateDir(tmpDir)
|
||||
result = $dos_image_resizer(imagePath.cstring, maxSize.cint, tmpDir)
|
||||
|
|
|
@ -303,4 +303,4 @@ proc dos_qabstracttablemodel_create(modelPtr: NimQAbstractTableModel,
|
|||
proc dos_qabstracttablemodel_parent(modelPtr: DosQAbstractTableModel, index: DosQModelIndex): DosQModelIndex {.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_qabstracttablemodel_index(modelPtr: DosQAbstractTableModel, row: cint, column: cint, parent: DosQModelIndex): DosQModelIndex {.cdecl, dynlib: dynLibName, importc.}
|
||||
|
||||
proc dos_image_resizer(imagePath: cstring, maxSize: cint): cstring {.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_image_resizer(imagePath: cstring, maxSize: cint, tmpDirPath: cstring): cstring {.cdecl, dynlib: dynLibName, importc.}
|
||||
|
|
Loading…
Reference in New Issue