#2070 - Uploaded jpg files error with CORRUPT_FILE
| Identifier | #2070 |
|---|---|
| Issue type | Major issue (breaks an entire feature) |
| Title | Uploaded jpg files error with CORRUPT_FILE |
| Status | Closed (no changes needed) |
| Handling member | Chris Graham |
| Addon | galleries |
| Description | When uploading a jpg image to my 9.0.21 Composr, users get the CORRUPT_FILE error. However, when double-checking the URL of the picture, the picture was created fine (I think. I can't verify the resizing was successful). |
| Steps to reproduce | 1. Go to add image in an image-accepting media gallery. 2. Upload a jpg image 3. Save it. 4. It errors with CORRUPT_FILE |
| Additional information | This didn't seem to happen in 9.0.20 so this might be a 9.0.21 bug.
The failure happens during the _convert_image function. If you need a stack trace, please let me know. |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Comments
a) I cannot reproduce
b) There are no code changes in .21 around images or uploading that could cause it
I suspect either it is an incompatibility somewhere, JPEG support not being compiled into your PHP version, or the files really corrupt. There is a reasonable chance that GD is less tolerant of corrupt images than a browser will be, and that things such as CMYK images may not work on it but may work on some browsers.
...and other formats such as PNG work fine.
Since my site doesn't fully support CURL anymore for some odd reason, despite CURL being compiled and trying to run it with different versions and configurations of PHP, I wonder if it's falling back to fsock, and somehow fsock is improperly downloading JPGs.
I ran a test command via Commandr...
:require_code('files');echo gettype(imagecreatefromstring(http_download_file('https://lovinity.org/uploads/galleries/Untitled.jpg')));:
And got...
PHP WARNING [2] imagecreatefromstring() [<a href='http://www.php.net/manual/en/function.imagecreatefromstring.php'>function.imagecreatefromstring.php</a>]: No JPEG support in this PHP build
PHP-info confirms. JPEG support is there for EXIF, but not GD.