Notifications
Clear all

Paid Addons Support Forum Only

Please note, that here we only support Paid Addons issues and questions.

gVectors Support staff works from 6am to 6pm (GMT+0)

All questions related to wpForo and wpDiscuz free plugins should be asked in the corresponding plugin support forum:

 

wpDiscuz Support Forum wpForo Support Forum

[Solved] Keep origina image sizes


Venkat Mangudi
Posts: 8
Customer
Topic starter
(@venkat-mangudi)
Member
Joined: 6 months ago

Can you tell me where this option is and how to add that hook? 

With my limited knowledge, I changed the file 

 

wpforo-advanced-attachments/wpf-third-party/file-uploader/UploadHandler.php

and modified the following line 

 $image_quality = isset($options['jpeg_quality']) ?
                    $options['jpeg_quality'] : 100; //Removed compression - 

 

But that did not upload the full size image, it still reduced a 2.38MB file to 208kb or so.

6 Replies
Tom
Posts: 3719
 Tom
Admin
(@tomson)
Support Team
Joined: 6 years ago

@venkat-mangudi,

Please don't do any changes in the code directly and revert all your changes.

When you upload an image it's cooped and the thumbnail of that image is displayed on the post to avoid loading of large images. So please explain what exactly you're looking for?

 

Venkat Mangudi
Posts: 8
Customer
Topic starter
(@venkat-mangudi)
Member
Joined: 6 months ago

Use case: I need to allow the users to upload images in the forums. However, the images are being compressed and the quality as seen online is sub-par. How can I turn off the compression feature in the add-on?

1 Reply
Tom
 Tom
Admin
(@tomson)
Joined: 6 years ago

Support Team
Posts: 3719

@venkat-mangudi,

put this code in the functions.php file of your current active theme:

add_filter('wpforoattach_uploader_class_options', function($options){
   $options['image_versions']['']['jpeg_quality'] = 100;
   $options['image_versions']['']['max_height'] = 1920;
   $options['image_versions']['thumbnail']['jpeg_quality'] = 100;
   return $options;
});
Venkat Mangudi
Posts: 8
Customer
Topic starter
(@venkat-mangudi)
Member
Joined: 6 months ago

Thank you, Tom. I am on a wordpress.com hosted site. Not super-technical on PHP though. Can you point to me where I can edit this file?

You assistance is much appreciated.

1 Reply
Tom
 Tom
Admin
(@tomson)
Joined: 6 years ago

Support Team
Posts: 3719
Venkat Mangudi
Posts: 8
Customer
Topic starter
(@venkat-mangudi)
Member
Joined: 6 months ago

Thank you, Tom. That worked well. 

Share:
Scroll to top