WordPress.org

Ready to get started?Download WordPress

Forums

Resize images before upload
[resolved] Force Settings in Multisite install (4 posts)

  1. mrjarbenne
    Member
    Posted 1 year ago #

    Twofold feature request.

    Easy (perhaps): is there a way for me to change the default settings for the plugin by tweaking the code? I'd like the large size to be smaller.

    Harder: Is there a way for me to block users from changing the settings once I've tweaked them in a multisite instance where I'm trying to control the upload size of multiple blogs?

    Thanks for an excellent plugin. I'll keep exploring this myself to see if I can figure it out.

    http://wordpress.org/extend/plugins/resize-images-before-upload/

  2. WPsites
    Member
    Plugin Author

    Posted 1 year ago #

    You can just edit the main plugin file around line 42

    uploader.settings['resize'] = { width: resize_width, height: resize_height, quality: ${quality} };

    And where it says "resize_width" and "resize_height" hardcode the numbers. So something like this:

    uploader.settings['resize'] = { width: 800, height: 600, quality: ${quality} };

    There are a number of "resize_width" and "resize_height" variables around that area that you will also need to modify.

    If you hardcode it in the plugin the other multisite users shouldn't be able to access the script source and make changes.

    I have a small update to the plugin that I could do with publishing. I might try and add a wp-config.php override of the image width and height so that you don't have to edit the plugin. I will give you a shout on here if I manage that.

  3. WPsites
    Member
    Plugin Author

    Posted 1 year ago #

    I have updated the plugin to version 0.6.

    You can now set the image width and height in your wp-config.php file like so:

    define( 'RIBU_RESIZE_WIDTH', 1000 ); //1000 px wide
    define( 'RIBU_RESIZE_HEIGHT', 900 ); //900 px high

    If those two definitions are in place in your wp-config.php file they override the usual media settings :)

  4. mrjarbenne
    Member
    Posted 1 year ago #

    You rock. I'll update and check it out shortly.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic