Recoverable Error Corrupt Jpeg Data
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about corrupt jpeg data opencv hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges
Corrupt Jpeg Data 57 Extraneous Bytes Before Marker 0xd9
Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each ini_set ('gd.jpeg_ignore_warning', 1); other. Join them; it only takes a minute: Sign up PHP File Upload corrupted JPEGS up vote 3 down vote favorite 1 We have a web app using Andrew Valums ajax file uploader, if we kick off 5 - corrupt jpeg data extraneous bytes before marker 10 image uploads at once, more often then not at least 2 or 3 will result in the same gd error "Corrupt JPEG data" Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 47 extraneous bytes before marker 0xd9 in .... However this did not happen on our old test server, or local development box's, only on our new production server. The file size on the server is the same as the original on my local machine,
Corrupt Jpeg Data Premature End Of Data Segment
so it completes the upload but I think the data is being corrupted by the server. I can "fix" the broken files by deleting them and uploading again, or manually uploading via FTP We had a shared host on Godaddy and just have started to have this issue on a new box (that I set up, so probably explains a lot :) CentOS 5.5+, Apache 2.2.3, PHP 5.2.10 You can see some example good and bad picture here. http://174.127.115.220/temp/pics.zip When I BinDiffed them I see a consistent pattern the corruption is always 64 byte blocks, and while the distance between corrupted blocks is not constant the number 4356 comes up a lot. I really think we can rule out the Internet as error checking and retransmission with TCP is pretty reliable, further there seems to be no difference between browser versions, or if I turn anti-virus and firewalls off. So I'm picking configuration of Apache / PHP? php file-upload jpeg corruption share|improve this question edited Jul 10 '11 at 23:13 Blender 155k23229323 asked Jul 10 '11 at 23:07 dave.zap 260211 1 I probably can't help you here, but this is a good question. Nice work. –rockerest Jul 10 '11 at 23:10 This might not be a solution, but have you tried a different webserver? There's always nginx and lighttpd. –Blender Jul 10 '11 at 23:13 Ye
Sign in Pricing Blog Support Search GitHub This repository Watch 193 Star 4,222 Fork 577 Intervention/image Code Issues 83 Pull requests 13 Projects 0 Pulse Graphs New issue imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file #21 Closed altrim opened this Issue Jul 14, 2013 · 10 comments Labels None yet Milestone No milestone Assignees No one assigned 4 participants altrim commented Jul 14, http://stackoverflow.com/questions/6644339/php-file-upload-corrupted-jpegs 2013 I am using this package with laravel and for some files that I am trying to resize it happens randomly I get this error: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file" Stack Frame /Applications/MAMP/htdocs/laravelweb/vendor/intervention/image/src/Intervention/Image/Image.php case IMG_PNG: case 3: $this->resource = imagecreatefrompng($path); break; case IMG_JPG: case 2: $this->resource = imagecreatefromjpeg($path); https://github.com/Intervention/image/issues/21 break; Intervention member olivervogel commented Jul 14, 2013 Please send me a link to one of these files, so I can fix it. altrim commented Jul 14, 2013 I am testing with local personal images, I don't have link to an image that might help. It has something to do with damaged JPEG files. After I optimize the image with ImageOptim the error goes away. Intervention member olivervogel commented Jul 15, 2013 I can't reproduce this error without such a damaged JPEG file. But I think you can suppress this error output with ini_set('gd.jpeg_ignore_warning', true); altrim commented Jul 15, 2013 Hey I found a damaged image, you can take a look at this link for the image http://www.gobiernohuejotzingo.gob.mx/img/noticias/123/123-7EJU0GUFYS.JPG Intervention member olivervogel commented Jul 15, 2013 Thank you for the test image. I did a little research and it seems that GD can't handle this kind of damaged images. However, I managed to read and resize your ima
UTC Modified: 2012-08-12 08:35 UTC From: php at maisqi dot com Assigned: Status: Not a bug Package: GD related PHP Version: 5.3.6 OS: https://bugs.php.net/bug.php?id=54940 Windows XP 32 Private report: No CVE-ID: View Add Comment Developer Edit [2011-05-27 14:10 UTC] php at maisqi dot com Description: ------------ I noticed that imagecreatefromjpeg() failed loading some JPEGs. I thought the files were corrupt, but then I successfully opened them on The Gimp. I noticed that if I opened one of those files on The Gimp corrupt jpeg and just saved it (without doing any modifications), imagecreatefromjpeg() would open the saved file with no problems. So, It's clear that some JPEGs are a little different from the others and that The Gimp fixes them on saving. imagecreatefromjpeg() issues the following warnings: Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 200 extraneous bytes before corrupt jpeg data marker 0xc4 in exp.php on line 3 Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '954.jpg' is not a valid JPEG file in exp.php on line 3 PS: I've found bug 39918 similar to this. The problems seam to be related but not the same. The first warnings looks like issued by a lower level function and states that the error is recoverable. Test script: ---------------