#2070 - Uploaded jpg files error with CORRUPT_FILE

This is a spacer post for a website comment topic. The content this topic relates to: #2070 - Uploaded jpg files error with CORRUPT_FILE
If you attach a jpeg that it is happening for here I'll take a look. However,
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.
It's probably an incompatibility. JPEG support has been compiled according to php_info (GD is installed). And the file is not corrupt because it errors with every uploaded jpg no matter what, even jpgs that used to work prior to this issue.

...and other formats such as PNG work fine.

Okay I'll see if I can reproduce on your own site and run some tests.
I'm wondering if it has to do with the HTML downloader. Upon inspecting the code, it looks like Composr uses the downloader to download the image into a string of data, or something like that.

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.
Yeah, no JPEG support.

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.
0 guests and 0 members have recently viewed this.