Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
1.3k views
in Q2A Core by
Images on my website are blurry. Does not matter what was the quality of the original picture. After uploading pics to the website, their quality dramatically decreases. Do you guys know what might be the issue? How to fix it?

Here is the example: https://unixhow.com/2825/kak-soxranit-pravila-iptables-v-ubuntu

Appreciate any suggestions.
Q2A version: 1.8.2
by
+1
Your images have a style attribute on them setting the width larger than the image. Is that something you've added?
by
edited by
+1
This is a good find, thanks!  I am using a custom-built theme. I guess it's a question to my  coder( who created the CSS for me)?
by
No. It should probably be your editor inserting a default width attribute
by
Actually, nothing helps. I guess I have to find another editor. Maybe there is a plugin which allows to enlarge picture once you click on it?

3 Answers

0 votes
by

i have the same problem , i uesd 

Markdown Editor For Q2A plugin. 

do you slove this problem ? 
+1 vote
by
edited by

I'm also facing this problem and it is coming due to the image resize option of the editor. The below lines are from "qa-wysiwyg-upload.php". Changing the "600" to a larger value allows wider image upload and the width of that can be reduced retaining the image quality. But while uploading if width is restricted to 600, image is of poor quality. Not sure if this is due to a conversion to jpeg. 

 $upload = qa_upload_file_one(
                                qa_opt('wysiwyg_editor_upload_max_size'),
                                qa_get('qa_only_image') || !qa_opt('wysiwyg_editor_upload_all'),
                                qa_get('qa_only_image') ? 600 : null, // max width if it's an image upload
                                null // no max height
                        );

Since the problem is on this Q2A site as well the difference in quality is not very visible above. This is the expected image quality. https://gateoverflow.in/?qa=blob&qa_blobid=4526366670613214476

+1 vote
by
Q2A converts all uploaded images into base64 BLOBs.  There is no image upload folder to store your raw images as the binary object is converted and stored into the database in binary (or into a folder if you specify). The image returns as a blob though converting to base64 shouldn't experience quality loss.

During the upload, Q2A resizes the image so that's probably where the quality loss happens.  Also, it compresses all images into JPG so you won't be able to upload PNG, GIF, or SVG.
by
See this image on our Q2A site: https://gateoverflow.in/?qa=blob&qa_blobid=4526366670613214476

It is PNG only. I guess compression to JPG happens only when width is larger than the given width (600px).
...