From e81ce9c487bebb24fda033a41f2ebe7b3a047352 Mon Sep 17 00:00:00 2001 From: iMike Date: Wed, 6 Apr 2022 03:25:05 +0300 Subject: [PATCH] DataExtension: add Google Storage JPEG head bytes --- Sources/ImageCode/DataExtension.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/ImageCode/DataExtension.swift b/Sources/ImageCode/DataExtension.swift index b6a4f81..cfc5664 100644 --- a/Sources/ImageCode/DataExtension.swift +++ b/Sources/ImageCode/DataExtension.swift @@ -43,6 +43,12 @@ public extension LonginusExtension where Base == Data { { return .JPEG + } else if buffer[0] == 0x52, // Google Storage JPEG + buffer[1] == 0x49, + buffer[2] == 0x46 + { + return .JPEG + } else if buffer[0] == ImageFormat.HeaderData.GIF[0], buffer[1] == ImageFormat.HeaderData.GIF[1], buffer[2] == ImageFormat.HeaderData.GIF[2]