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

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

Views

Download

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
by
Simple yet useful plugin..!
by
I release V1.0 (Fix save/default button name/id)
by
I release V1.0.1 (Fix bug when upload non image [update hack.txt only])
by
on the local machine works well on a dedicated server is not running. in what could be the problem?
by
Is error message displayed on the file path of upload dialog?
by
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
by
See)
http://stackoverflow.com/questions/5572251/php-copy-function-failed-to-open-stream-permission-denied

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

3 Answers

0 votes
by

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
by
I've searched qa-wysiwyg-upload.php for the line to be modified but it does not appear in there - any thoughts?

Find:
                    $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_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
            );

            $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;
    }
}
by
edited by
+1
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?
by
I updated plugin. Re-download and refer to hack.txt.
0 votes
by
I can not download the plugin, broken link
...