Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
in Plugins by
edited by

This plugin resize image uploaded by CKEditor compulsorily. Refer to readme in download-file for detailed usage.



Why this plugin is needs:

Although Q2A can restrict uploads by capacity, it is troublesome to resize high resolution photograph, such as digital camera. Also, It is effective in arranging with same size picture from which size is different. Q2A saves upload-file to DB(blob). Compression of picture prevents hypertrophy of DB. 

Caution / Restriction

Hack of WYSIWYG Editor plugin is required for this plug-in. 

Best regards.

Q2A version: 1.6, 1.7
on the local machine works well on a dedicated server is not running. in what could be the problem?
Is error message displayed on the file path of upload dialog?
no errors on the site. uploaded picture is not visible. Table qa_blobs image BLOB - 0 Bytes. most likely need to set permissions on files

Replace copy() line of qa-wysiwyg-upload.php to below.
$copied = copy($oldfile, $newfile);
if (!$copied) {
    echo 'Copy error occurred!';

3 Answers

0 votes

Hi there

Thanks for your nice sharing.I am looking for a powerful image processing tool which supports to resize image directly.

I have installed another image tool before.It can only zoom image.I want to know that if there is a free trial for new users.

thanks a lot.

+2 votes
I've searched qa-wysiwyg-upload.php for the line to be modified but it does not appear in there - any thoughts?

                    $blobid=qa_db_blob_create(file_get_contents($file['tmp_name']), $extension, @$file['name'], $userid, $cookieid, qa_remote_ip_address());

This is the entire file:

class qa_wysiwyg_upload
    public function match_request($request)
        return ($request == 'wysiwyg-editor-upload');

    public function process_request($request)
        $message = '';
        $url = '';

        if (is_array($_FILES) && count($_FILES)) {
            if (!qa_opt('wysiwyg_editor_upload_images'))
                $message = qa_lang('users/no_permission');

            require_once QA_INCLUDE_DIR.'app/upload.php';

            $upload = qa_upload_file_one(
                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

            $message = @$upload['error'];
            $url = @$upload['bloburl'];

        echo "<script>window.parent.CKEDITOR.tools.callFunction(".qa_js(qa_get('CKEditorFuncNum')).
            ", ".qa_js($url).", ".qa_js($message).");</script>";

        return null;
edited by
This plugin (hack) is very old. Upload logic of editor was changed largely in Q2A V1.6. Logic of Q2A also seems to have become a little intelligent. Anyway, there is a need to remake plugin.

Does this plugin is still necessary for you (Q2A)?
It is because width is hard-coded to 600 pixels?
I updated plugin. Re-download and refer to hack.txt.
0 votes
I can not download the plugin, broken link