0

maybe a broken image, it cant open in php.

but it is work in web, emm, any browser.

it work in photoshop and image viewer also.

please ask it,

1,how to do can be make it work in php also?

2,if cant resolve it, how to hidden error message?

imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 13 extraneous bytes before marker 0x22
Unsupported marker type 0x22

//my coode, even i wanna try to hidden error message, it is cant.
try {
    error_reporting(0);            
    ini_set("gd.jpeg_ignore_warning", 1);
    imagecreatefromjpeg($filename);
}(\Exception $e) {

}

try to resolve:

  1. rename with different suffix: jpg, jpeg, gif, png.

  2. run on different environment: linux, windows, php5.6, php7.1.

  3. run on different library: gd2, imagick, gmagick.

still cant resolved. please help me.

this is the pic:

enter image description here

hhniao
  • 49
  • 8
  • 1
    If you think this could be a bug in PHP itself, you should put it into the PHP bugtracker. Otherwise, clarify your question please – Nico Haase Jan 18 '18 at 08:37
  • It seems that imgur.com agrees with php: It is not a valid image. – jeroen Jan 18 '18 at 08:38
  • 1
    And how did you conclude that it isn't the image that actually _is_ corrupt? – M. Eriksson Jan 18 '18 at 08:41
  • @jeroen maybe it is not a valid image, but it can be show on web right? it can be open in photoshop and picture viewer also. so i think it, it is able to open in php also – hhniao Jan 18 '18 at 08:43
  • Some software can actually fix some issues on the fly. Specially more advanced image software. – M. Eriksson Jan 18 '18 at 08:44
  • @MagnusEriksson im not sure. maybe it is corrupt image. – hhniao Jan 18 '18 at 08:45
  • 1
    I would suggest that you check that out before blaming PHP. :-) Either way, if there _is_ a bug in PHP, then SO isn't the place to report it. – M. Eriksson Jan 18 '18 at 08:46
  • @NicoHaase, yes. i have modify the question. – hhniao Jan 18 '18 at 08:51
  • @MagnusEriksson i have change the question and modify content. im just looking for a way to resolve it. not any popurse to blaming php. im sorry. – hhniao Jan 18 '18 at 08:54
  • What do you mean? When I open the link you posted I get a message the the image cannot be displayed because it contains errors. So no, it cannot be displayed on the web. – jeroen Jan 18 '18 at 08:55
  • @jeroen it is work here. no any problem. i have try IE, chrome. yes, it is not work in firefox. but if you right click on the image and save it. it is work in image viewer. – hhniao Jan 18 '18 at 09:02
  • Again, different software handles corrupt images differently. Some software can fix (or ignore) the issue. Some software doesn't. If it doesn't work using multiple software (like you state: some browsers, PHP GD etc.), then the image is most likely the issue and there's nothing we can do about it here. – M. Eriksson Jan 18 '18 at 09:05
  • Don't use that kind of language. It's not appropriate here (no matter the context). I don't have any other fix than open it in Photoshop, re-save it and use the new file instead. A super quick google on the issue, this is an issue with `libjeg`, which many software uses. – M. Eriksson Jan 18 '18 at 09:17

0 Answers0