xref: /PHP-8.0/ext/gd/tests/bug77195.phpt (revision 4e6fbb0a)
1--TEST--
2Bug #77195 (Incorrect error handling of imagecreatefromjpeg())
3--SKIPIF--
4<?php
5if (!extension_loaded('gd')) die('skip gd extension not available');
6if (!gd_info()['JPEG Support']) die('skip JPEG support not available');
7?>
8--FILE--
9<?php
10$filename = __DIR__ . '/bug77195.jpg';
11@imagecreatefromjpeg($filename);
12imagecreatefromjpeg($filename);
13?>
14--EXPECTF--
15Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: JPEG datastream contains no image in %s on line %d
16
17Warning: imagecreatefromjpeg(): "%s" is not a valid JPEG file in %s on line %d
18