Always reencode images through canvas
This commit is contained in:
parent
dc6e6e4f00
commit
5f522c605d
1 changed files with 2 additions and 8 deletions
|
@ -140,14 +140,8 @@ export async function scaleImageToLevel(
|
||||||
MEDIA_QUALITY_LEVEL_DATA.get(level) || DEFAULT_LEVEL_DATA;
|
MEDIA_QUALITY_LEVEL_DATA.get(level) || DEFAULT_LEVEL_DATA;
|
||||||
|
|
||||||
if (fileOrBlobOrURL.size <= thresholdSize) {
|
if (fileOrBlobOrURL.size <= thresholdSize) {
|
||||||
let blob: Blob;
|
// Always encode through canvas as a temporary fix for a library bug
|
||||||
if (data.exif != null) {
|
const blob: Blob = await canvasToBlob(data.image, contentType);
|
||||||
blob = await canvasToBlob(data.image, contentType);
|
|
||||||
} else {
|
|
||||||
// If we don't have EXIF data, we can just return the original blob
|
|
||||||
// to avoid occasionally making the image larger.
|
|
||||||
blob = fileOrBlobOrURL;
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
blob,
|
blob,
|
||||||
contentType,
|
contentType,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue