Skip to content

Commit

Permalink
fixed Issue #860
Browse files Browse the repository at this point in the history
  • Loading branch information
gitbrent committed Jul 24, 2022
1 parent e1d4e0c commit ae48127
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gen-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,14 @@ export function addImageDefinition(target: PresSlide, opt: ImageProps) {

// STEP 1: Set extension
// NOTE: Split to address URLs with params (eg: `path/brent.jpg?someParam=true`)
let strImgExtn =
let strImgExtn = (
strImagePath
.substring(strImagePath.lastIndexOf('/') + 1)
.split('?')[0]
.split('.')
.pop()
.split('#')[0] || 'png'
).toLowerCase()

// However, pre-encoded images can be whatever mime-type they want (and good for them!)
if (strImageData && /image\/(\w+);/.exec(strImageData) && /image\/(\w+);/.exec(strImageData).length > 0) {
Expand Down

0 comments on commit ae48127

Please # to comment.