The picture provided is very large (about 8 megapixels) and contains noise from the monitor screen, which makes it difficult to recognize. When the recognition process does not fit within the allotted time, the web server issues a 502 error.
Ways to solve the problem:
- Reduce the size of the image (even 20% of the original will be enough)
- Use the flag allow_decreased_image = true, then the server will try to recognize the reduced image
Below is the code that recognizes the image in about 15 seconds:
$request = new Aspose\BarCode\Requests\PostBarCodeRecognizeFromUrlorContentRequest();
$request->image = new SplFileObject('code1675463252196920156963dd8a54c1757.jpg');
$request->preset = Aspose\BarCode\Model\PresetType::HighPerformance;
$request->type = Aspose\BarCode\Model\DecodeBarcodeType::VIN;
$request->checksum_validation = Aspose\BarCode\Model\ChecksumValidation::On;
$request->allow_decreased_image = true;
$result = $api->PostBarCodeRecognizeFromUrlorContent($request);
print_r($result);
Hope this helps