Skip to content

Commit 24065be

Browse files
committed
fix: only mutate if changed
1 parent 5f0b85f commit 24065be

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/shared/converters/image-converter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ class ImageConverter extends Converter {
130130
}
131131

132132
// Allow preprocessing of the image before the conversion
133-
fileItem.file = await applyFilters( 'cimo.convertImage.prepare', fileItem.file, outputFormat, options )
133+
const updatedFile = await applyFilters( 'cimo.convertImage.prepare', fileItem.file, outputFormat, options )
134+
if ( updatedFile ) {
135+
fileItem.file = updatedFile
136+
}
134137

135138
return new Promise( ( resolve, reject ) => {
136139
const img = new Image()

0 commit comments

Comments
 (0)