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

png图片可以压缩输出jpg,输出png却失败(未压缩) #26

Open
sjg20010414 opened this issue Jul 24, 2020 · 2 comments
Open

Comments

@sjg20010414
Copy link

sjg20010414 commented Jul 24, 2020

bsp_7

上面的文件(约5MB),用类似下面的代码压缩失败(上传后发现没有压缩):

                                                       compressAccurately(file, {
								size: 1000, // _self.imageSizeLimits[_self.islIndex],
								//accuracy: 0.9,
								type: 'image/png'
							}).then(res => {
								let blobUrl = URL.createObjectURL(res)
								this.imagesTemp.push(blobUrl)
								this.extensionDict[blobUrl] = 'png' // extension  // 压缩后上传丢失后缀
							})

但把 type: 'image/png' 改成 type: 'image/jpeg' 是可以正常压缩的

环境:Windows 10 (最近更新7月)、浏览器 HBuilderX 2.7.14 内置浏览器

@zarttash-zafar
Copy link

Hi @sjg20010414 did you find any solution? i am facing the same issue.

@fengliye
Copy link

有一说一 确实 不知道为啥输出不了png

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

No branches or pull requests

3 participants