forked from MapComplete/MapComplete
Scripts: support .png-uploads in imgur-to-panoramax script
This commit is contained in:
parent
3c90d33b9d
commit
a0feed3695
2 changed files with 14 additions and 7 deletions
|
@ -95,7 +95,7 @@ export class Imgur extends ImageProvider {
|
|||
withResponse?: (obj) => void
|
||||
): Promise<LicenseInfo> {
|
||||
const url = providedImage.url
|
||||
const hash = url.substr("https://i.imgur.com/".length).split(/\.jpe?g/i)[0]
|
||||
const hash = url.substr("https://i.imgur.com/".length).split(/(\.jpe?g)|(\.png)/i)[0]
|
||||
|
||||
const apiUrl = "https://api.imgur.com/3/image/" + hash
|
||||
const response = await Utils.downloadJsonCached<{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue