diff --git a/src/Controller/OcrController.php b/src/Controller/OcrController.php index 232d69c6..a5e952b7 100644 --- a/src/Controller/OcrController.php +++ b/src/Controller/OcrController.php @@ -113,7 +113,10 @@ private function setup(): void { static::$params['langs'] = $this->getLangs( $this->request ); static::$params['image_hosts'] = $this->engine->getImageHosts(); $crop = $this->request->query->get( 'crop' ); - if ( !is_array( $crop ) ) { + if ( !is_array( $crop ) + || isset( $crop['width'] ) && !$crop['width'] + || isset( $crop['height'] ) && !$crop['height'] + ) { $crop = []; } static::$params['crop'] = array_map( 'intval', $crop );