Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎸 add support for svg #74

Merged
merged 1 commit into from
Dec 19, 2020
Merged

feat: 🎸 add support for svg #74

merged 1 commit into from
Dec 19, 2020

Conversation

kkyeer
Copy link
Contributor

@kkyeer kkyeer commented Dec 15, 2020

add support for svg image while choosing files

add support for svg image while choosing files
@upupming
Copy link
Member

@kkyeer Have you checked all supported formats by picgo core?

@kkyeer
Copy link
Contributor Author

kkyeer commented Dec 16, 2020

@kkyeer Have you checked all supported formats by picgo core?

According to Mozilla's list, there should be at least 5 types more: .jfif, .pjpeg, .pjp, .avif, .apng, should I add them all or give users an option to choose file freely?
Besides, I think whether a file type is supported is up to user's markdown renderer,am I right ?
@upupming

@upupming
Copy link
Member

@kkyeer

  1. .svg is not supported by all uploaders, for example, SM.MS doesn't support .svg but tcyun does support .svg. I think we should report an error message to the user if they uploaded an image file with a type not supported by the current uploader. Could you please add this error message, too?

image

  1. As for .jfif, .pjpeg, .pjp, .avif, .apng, I think it is not necessary to add them because we seldom use them.

@kkyeer
Copy link
Contributor Author

kkyeer commented Dec 16, 2020

  1. There is already a working message chain to display see error message returned by suppliers as showed below.But SM.MS's api server did not give a reasonable error message,nor there api docs.

图片

2. As VsCode do not support "all files" if given file suffix filters, it is currently impossible to let user choose freely . 3. To achieve that,either override error message with unreliable manner in plugins( no accurate api doc),or add a new feature for plugins to list support image types ,then extension can iterate over this list. @upupming how do your sugguest to procceed?

@upupming
Copy link
Member

@kkyeer Great point, here is my suggestion:
I think the best way is to let the uploader define all supported file types, but there is no such an API such as picgo.getSupportedImageTypes to get all supported file types by uploader. I think we can keep the hard-coded file types by now, and make a PR to PicGo-Core to add this API. After the next release of PicGo-Core, we can update our code to use the new API.

@upupming
Copy link
Member

@Spades-S Did you have any comment on this, I think it looks good to me, can we merge it?

@upupming upupming merged commit ad88ef1 into PicGo:dev Dec 19, 2020
@kkyeer kkyeer deleted the feature/svg branch December 19, 2020 09:28
Spades-S added a commit that referenced this pull request Jul 26, 2021
* 📦 Chore: add bump version (#32)

* 📦 Chore: add picgo bump version

* 📦 Chore: substitute npm with yarn

* 📦 Chore: move pre-commit to husky for using by `git cz`

* 📦 Chore: finish azure pipeline & remove appveyor

* 🔙 Revert: fix mistake in test script

* 📝 Docs: make readme tidier

* 📝 Docs: revert to details/summary tags

* 📝 Docs: update license

* 📝 Docs: add upupming to license

* 📝 Docs: currect azure project name (#33)

* ⬆️ Upgrade: picgo to 1.3.6

fix bugs when upload images from clipboard in Windows 7

ISSUES CLOSED: #34

* 🎉 Release: 2.0.4

* 🐛 Fix: add tencent cos path option

* 🔨 Refactor: code structure, message consistency, fix settings changing issue, out-of-box format(#36)

* 🔨 Refactor: code structure

* 🐛 Fix: picgo -> vspicgo, prettier fix

* 🐛 Fix: on load -> before upload plugin

* 🎨 Style: log -> data

* 🐛 Fix: get config, editor each time

* 🎨 Style: message consistency

* 🐛 Fix: qiniu.area enum -> string

* 🐛 Fix: update picgo on settings changed

* ✨ Feature: out-of-box format

* 🔙 Revert: still using enum for qiniu area

* 🔨 Refactor: singleton pattern for `picgo`

* 🐛 Fix: add tencent cos path option

* 🔨 Refactor: replace require with fs

* 📝 Docs: readme.md

add summary tag in details tag aimed at PicGo-electorn users

* 📝 Docs: fix custom upload name & custom output format docs

* 📝 Docs: update issue templates

* 📝 Docs: code format

* ✅ Test: add basic testes (#42)

* ✅ Test: add basic testes

* 🐛 Fix: import -> require

* 🐛 Fix: build

* 📦 Chore: add coveralls env

* ✨ Feature: test report on command line

* Update package.json

* 🐛 Fix: coverage

* ✨ Feature: report to coveralls

* 🐛 Fix: use sed to fix lcov.info's relative path

* ⬆️ Upgrade: fix querystringify vulnerability

* 🐛 Fix: azure pipeline + coveralls

see
https://github.com/dylan-smith/node-coveralls/blob/10e327653aa0f2f382efee3af800beae0aabaac5/lib/getOptions.js

* 📦 Chore: azure -> github actions

* ✨ Feature(package.json): support sm.ms V2

upgrade dependencies, support sm.ms V2

ISSUES CLOSED: #57

* 📦 Chore: replace tslint with eslint

* 📦 Chore(.vscode): update .vscode

* 🎨 Style: run codestyle:fix

* 📝 Docs: update docs: README.md, CHANGELOG.md

* 📝 Docs: update README.md

* ✅ Test(test): refactor unit tests

* 📦 Chore: add coverage collector

* build(deps): bump lodash from 4.17.15 to 4.17.19 (#68)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump decompress from 4.2.0 to 4.2.1 (#71)

Bumps [decompress](https://github.com/kevva/decompress) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/kevva/decompress/releases)
- [Commits](kevva/decompress@v4.2.0...v4.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump ini from 1.3.5 to 1.3.7 (#73)

Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: 🎸 add support for svg (#74)

add support for svg image while choosing files

* 🐛 Fix(ci): github actions use yarn to lock versions (#77)

* 🐛 Fix(clipboard): set `PICGO_ENV` to `CLI`, fixes #75 (#78)

* 🐛 Fix(clipboard): set `PICGO_ENV` to `CLI`, fixes #75

also update picgo core
add failed message

* 🐛 Fix(version): 2.0.4 -> 2.1.0

* 📦 Chore(deps): update deps

* 📦 Chore(bundle): add webpack

* 🐛 Fix(proxy): add proxy config, fixes #79

* ⬆️ Upgrade: update picgo core

* 📦 Chore: migrate to standardjs (#83)

* 🚧 WIP(code style): migrate to standardjs

* 🐛 Fix(upload): upload events off

* ✅ Test: fix test configuration

* 📦 Chore: add console for message

* 🐛 Fix: show message should not block following operations

* ⬆️ Upgrade(core): upgrade dependencies (#92)

Co-authored-by: Yiming Li <yimingli.cs@gmail.com>

* 🎉 Release: v2.1.1

* 🐛 Fix(dep): bundle picgo-core to dist

* 🎉 Release: v2.1.2

Co-authored-by: Li Yiming <upupming@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kkyeer <kkyeer@gmail.com>
Co-authored-by: Yiming Li <yimingli.cs@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants