From 16fa5270bc3592ae3ce13a12eb4eca1112614199 Mon Sep 17 00:00:00 2001 From: Fen Date: Thu, 14 Sep 2023 16:25:19 +0800 Subject: [PATCH 1/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1fc51e35..3708ce5c 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Answer provides a plugin system for developers to create custom plugins and expa We value your feedback and suggestions to improve our documentation. If you have any comments or questions, please feel free to contact us. We’re excited to see what you can create using our plugin system! -You can also check out the [officially supported plugins here](https://github.com/answerdev/plugins). +You can also check out the [plugins here](https://github.com/answerdev/plugins). ## Contributing From 18b46d217725eee9191a651b04944dc0cc23634b Mon Sep 17 00:00:00 2001 From: joyqi Date: Thu, 14 Sep 2023 16:38:11 +0800 Subject: [PATCH 2/6] fix: correct the copyright statement in the license --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 66402cde..1c1a849d 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2022 joyqi + Copyright 2022 BEAUTIFUL ONES INC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 591ec3d401e6661df646d769910b3f3498b9ac73 Mon Sep 17 00:00:00 2001 From: joyqi Date: Thu, 14 Sep 2023 17:43:58 +0800 Subject: [PATCH 3/6] Update LICENSE Co-authored-by: tison --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 1c1a849d..261eeb9e 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2022 BEAUTIFUL ONES INC + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 743ac13ba02b083cd4f10baef8d6e2bdfbf80d8b Mon Sep 17 00:00:00 2001 From: LinkinStars Date: Thu, 14 Sep 2023 15:23:22 +0800 Subject: [PATCH 4/6] feat(plugin): update plugin url --- script/plugin_list | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/plugin_list b/script/plugin_list index a7cfc670..b3ea84c2 100644 --- a/script/plugin_list +++ b/script/plugin_list @@ -1 +1 @@ -github.com/answerdev/plugins/connector/basic@latest \ No newline at end of file +github.com/answerdev/answer-basic-connector@latest \ No newline at end of file From 541c35e82737fb5fd67900c1d62a79d5d6d3a853 Mon Sep 17 00:00:00 2001 From: buttercannfly <36593447+buttercannfly@users.noreply.github.com> Date: Tue, 19 Sep 2023 15:30:56 +0800 Subject: [PATCH 5/6] fix(image): support upload jog images --- pkg/checker/file_type.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/checker/file_type.go b/pkg/checker/file_type.go index 37dfdc42..be4ad38d 100644 --- a/pkg/checker/file_type.go +++ b/pkg/checker/file_type.go @@ -12,13 +12,15 @@ func IsSupportedImageFile(file io.Reader, ext string) bool { ext = strings.TrimPrefix(ext, ".") var err error switch strings.ToUpper(ext) { - case "JPG", "JPEG": + case "JPEG": _, err = jpeg.Decode(file) case "PNG": _, err = png.Decode(file) case "ICO": // TODO: There is currently no good Golang library to parse whether the image is in ico format. return true + case "JPG": + return true default: return false } From de6a633248f925d544205c7593a6d1d7e8bc2225 Mon Sep 17 00:00:00 2001 From: buttercannfly <36593447+buttercannfly@users.noreply.github.com> Date: Tue, 19 Sep 2023 18:05:46 +0800 Subject: [PATCH 6/6] Update file_type.go --- pkg/checker/file_type.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pkg/checker/file_type.go b/pkg/checker/file_type.go index be4ad38d..71f9f2a5 100644 --- a/pkg/checker/file_type.go +++ b/pkg/checker/file_type.go @@ -1,26 +1,25 @@ package checker import ( - "image/jpeg" - "image/png" + "image" + _ "image/gif" // use init to support decode jpeg,jpg,png,gif + _ "image/jpeg" + _ "image/png" "io" "strings" ) -// IsSupportedImageFile currently answers support image type is `image/jpeg,image/jpg,image/png` +// IsSupportedImageFile currently answers support image type is `image/jpeg,image/jpg,image/png, image/gif` func IsSupportedImageFile(file io.Reader, ext string) bool { + ext = strings.TrimPrefix(ext, ".") var err error switch strings.ToUpper(ext) { - case "JPEG": - _, err = jpeg.Decode(file) - case "PNG": - _, err = png.Decode(file) + case "JPG", "JPEG", "PNG", "GIF": // only allow for `image/jpeg,image/jpg,image/png, image/gif` + _, _, err = image.Decode(file) case "ICO": // TODO: There is currently no good Golang library to parse whether the image is in ico format. return true - case "JPG": - return true default: return false }