fix ordering of preprocessors

This commit is contained in:
Jason Miller
2020-12-09 11:22:33 -05:00
parent ee8ea539e7
commit b8574b228a

View File

@@ -130,14 +130,14 @@ async function preprocessImage(
let processedData = data;
const { rotate, flip, crop } = preprocessorState;
if (rotate.rotate !== 0) {
processedData = await workerBridge.rotate(signal, processedData, rotate);
}
if (flip && (flip.horizontal || flip.vertical)) {
processedData = await workerBridge.flip(signal, processedData, flip);
}
if (rotate.rotate !== 0) {
processedData = await workerBridge.rotate(signal, processedData, rotate);
}
if (crop && (crop.left || crop.top || crop.right || crop.bottom)) {
processedData = await workerBridge.crop(signal, processedData, crop);
}
@@ -385,7 +385,6 @@ export default class Compress extends Component<Props, State> {
private onTransformUpdated = ({
preprocessorState,
}: { preprocessorState?: PreprocessorState } = {}) => {
console.log('onTransformUpdated', preprocessorState);
if (preprocessorState) {
this.onPreprocessorChange(preprocessorState);
}