500 Error with admin-ajax.php  

Page 2 / 2

webgrimm
Posts: 8
Customer
(@webgrimm)
Member
Joined: 10 months ago

Cant upload images with Media Uploader. admin-ajax.php throw a 500 error

PHP-Logfile:

[09-Jun-2019 07:54:06 UTC] PHP Fatal error: Uncaught Error: Call to undefined function exif_read_data() in X:\www\wp-content\plugins\wpdiscuz-media-uploader\includes\class.WMUHelper.php:461
Stack trace:
#0 X:\www\wp-content\plugins\wpdiscuz-media-uploader\class.WpdiscuzMediaUploader.php(480): WMUHelper->imageFixOrientation('X:\\xxx\\php5...')
#1 X:\www\wp-content\plugins\wpdiscuz-media-uploader\class.WpdiscuzMediaUploader.php(452): WpdiscuzMediaUploader->uploadSingleFile('wmu_images', 109, 'attachment_imag...', 0, 'test.jpg')
#2 X:\www\wp-includes\class-wp-hook.php(288): WpdiscuzMediaUploader->uploadFiles(109)
#3 X:\www\wp-includes\class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#4 X:\www\wp-includes\plugin.php(465): WP_Hook->do_action(Array)
#5 X:\www\wp-includes\comment.php(2134): do_action('comment_post', 109, 0, Array)
#6 X:\www\wp-con in X:\www\wp-content\plugins\wpdiscuz-media-uploader\includes\class.WMUHelper.php on line 461

12 Replies
webgrimm
Posts: 8
Customer
(@webgrimm)
Member
Joined: 10 months ago

Have testet, it's a problem of jpg-files

Have transformed a jpg to png (see my last post) and it worked

Reply
4 Replies
Astghik
Admin
(@astghik)
Joined: 2 years ago

Support Team
Posts: 2668

Yes @webgrimm, I see. 

I've already asked the add-on developers about the issue. They are going to check it. Please wait for a while I'll update the topic asap. 

Reply
Astghik
Admin
(@astghik)
Joined: 2 years ago

Support Team
Posts: 2668

@webgrimm,

Could you please provide us the admin login details for deeper support? 

Reply
webgrimm
Customer
(@webgrimm)
Joined: 10 months ago

Member
Posts: 8

Have made a copy of the Website.

Your Email adress for Admin-account?

Reply
Astghik
Admin
(@astghik)
Joined: 2 years ago

Support Team
Posts: 2668

ok @webgrimm,

please send the login details to info[at]gvectors.com email address. 

Reply
Astghik
Posts: 2668
Admin
(@astghik)
Support Team
Joined: 2 years ago

@webgrimm,

Please follow the steps below:

1. Open the class.WMUHelper.php file in /wp-content/plugins/wpdiscuz-media-uploader/includes/ folder

2. go to line 460 line

3. Find the imageFixOrientation function and replace with the following one: 

public function imageFixOrientation($filename) {
if (function_exists('exif_read_data')) {
$exif = exif_read_data($filename);
if (!empty($exif['Orientation'])) {
$image = imagecreatefromjpeg($filename);
switch ($exif['Orientation']) {
case 3:
$image = imagerotate($image, 180, 0);
break;
case 6:
$image = imagerotate($image, -90, 0);
break;
case 8:
$image = imagerotate($image, 90, 0);
break;
}
imagejpeg($image, $filename, 90);
}
}
}

I'd also recommend you install the exif library, as the wpDiscuz Media Uploader add-on uses exif library so as to allow images to be uploaded in the right way. For example, if you take a photo with IOS it rotates when you publish the comments.

Reply
Page 2 / 2
Share: