From b0932b488408169ad18c72bc956905f94e64d016 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Thu, 6 Feb 2020 04:33:05 +0700 Subject: [PATCH] Fix trimming from the start (#177) --- Gifski/Gifski.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gifski/Gifski.swift b/Gifski/Gifski.swift index f766bbfe..18b50fbd 100644 --- a/Gifski/Gifski.swift +++ b/Gifski/Gifski.swift @@ -253,7 +253,7 @@ final class Gifski { bytesPerRow: UInt32(image.bytesPerRow), height: UInt32(image.height), pixels: buffer, - presentationTimestamp: result.actualTime.seconds + presentationTimestamp: max(0, result.actualTime.seconds - startTime) ) } catch { completionHandlerOnce(.failure(.addFrameFailed(error)))