fix: prevent image uploader converting every image to jpeg (#1262)
This commit is contained in:
1 parent
db7711869f
commit
23127318dc
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -45,7 +45,7 @@ export async function getCroppedImg(imageSrc: string, pixelCrop: Area): Promise<
|
||||
// on very low ratios, the quality of the resize becomes awful. For this reason the resizeRatio is limited to 0.75
|
||||
if (resizeRatio <= 0.75) {
|
||||
// With a smaller image, thus improved ratio. Keep doing this until the resizeRatio > 0.75.
|
||||
return getCroppedImg(canvas.toDataURL("image/jpeg"), {
|
||||
return getCroppedImg(canvas.toDataURL("image/png"), {
|
||||
width: canvas.width,
|
||||
height: canvas.height,
|
||||
x: 0,
|
||||
@@ -53,5 +53,5 @@ export async function getCroppedImg(imageSrc: string, pixelCrop: Area): Promise<
|
||||
});
|
||||
}
|
||||
|
||||
return canvas.toDataURL("image/jpeg");
|
||||
return canvas.toDataURL("image/png");
|
||||
}
|
||||
Reference in new issue
Block a user