v0.4.0: scroll log, worker slots, disk skip, color gradient, parallel export
This commit is contained in:
@@ -83,11 +83,27 @@ func (*CgoBridge) IsCancelled() bool {
|
||||
}
|
||||
|
||||
func (*CgoBridge) ExportPreview(assetID, outputDir string, targetSize, index int) (ExportResult, error) {
|
||||
return exportPreviewWithSlotTest(assetID, outputDir, targetSize, index, -1)
|
||||
}
|
||||
|
||||
func (*CgoBridge) ExportOriginal(assetID, outputDir string, index int) (ExportResult, error) {
|
||||
return exportOriginalWithSlotTest(assetID, outputDir, index, -1)
|
||||
}
|
||||
|
||||
func (*CgoBridge) ExportPreviewWithSlot(assetID, outputDir string, targetSize, index, slotIndex int) (ExportResult, error) {
|
||||
return exportPreviewWithSlotTest(assetID, outputDir, targetSize, index, slotIndex)
|
||||
}
|
||||
|
||||
func (*CgoBridge) ExportOriginalWithSlot(assetID, outputDir string, index, slotIndex int) (ExportResult, error) {
|
||||
return exportOriginalWithSlotTest(assetID, outputDir, index, slotIndex)
|
||||
}
|
||||
|
||||
func exportPreviewWithSlotTest(assetID, outputDir string, targetSize, index, slotIndex int) (ExportResult, error) {
|
||||
cid := C.CString(assetID)
|
||||
defer C.free(unsafe.Pointer(cid))
|
||||
cdir := C.CString(outputDir)
|
||||
defer C.free(unsafe.Pointer(cdir))
|
||||
cs := C.photos_export_preview_json(cid, cdir, C.int(targetSize), C.int(index))
|
||||
cs := C.photos_export_preview_json(cid, cdir, C.int(targetSize), C.int(index), C.int(slotIndex))
|
||||
if cs == nil {
|
||||
return ExportResult{}, errBridgeNil
|
||||
}
|
||||
@@ -95,15 +111,29 @@ func (*CgoBridge) ExportPreview(assetID, outputDir string, targetSize, index int
|
||||
return ParseExportResultJSON(C.GoString(cs))
|
||||
}
|
||||
|
||||
func (*CgoBridge) ExportOriginal(assetID, outputDir string, index int) (ExportResult, error) {
|
||||
func exportOriginalWithSlotTest(assetID, outputDir string, index, slotIndex int) (ExportResult, error) {
|
||||
cid := C.CString(assetID)
|
||||
defer C.free(unsafe.Pointer(cid))
|
||||
cdir := C.CString(outputDir)
|
||||
defer C.free(unsafe.Pointer(cdir))
|
||||
cs := C.photos_export_original_json(cid, cdir, C.int(index))
|
||||
cs := C.photos_export_original_json(cid, cdir, C.int(index), C.int(slotIndex))
|
||||
if cs == nil {
|
||||
return ExportResult{}, errBridgeNil
|
||||
}
|
||||
defer C.photos_free_string(cs)
|
||||
return ParseExportResultJSON(C.GoString(cs))
|
||||
}
|
||||
|
||||
type ExportProgressSlot struct {
|
||||
Active bool
|
||||
Progress float64
|
||||
BytesDone int64
|
||||
BytesTotal int64
|
||||
}
|
||||
|
||||
func GetProgressSlots() []ExportProgressSlot {
|
||||
return nil
|
||||
}
|
||||
|
||||
func ResetProgressSlots() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user