WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] You can resize images in Chrome/Safari/Webkit (6 posts)

  1. korythewebguy
    Member
    Posted 1 year ago #

    Over the years, I've seen a lot of posts (here and on other message boards) about the inability to "live resize" images in the WordPress Visual Editor (TinyMCE) when using Chrome, or a WebKit-based browser.

    I figured someone had posted a solution to this by now, but after talking to a colleague who had searched the WordPress forums and Google for hours and come to accept this wasn't possible, I decided it was high time to post the solution myself.

    YES, you CAN get working image resize handles in Chrome, and be able to change the size of your images just like you can in Firefox and IE.

    Just add the following to your theme's functions.php file:

    function tinymce_editor_settings($settings) {
    	$settings['webkit_fake_resize'] = 1;
    	return $settings;
    }
    add_filter('tiny_mce_before_init', 'tinymce_editor_settings');

    Voila! You can now size/resize images in Chrome (and other Webkit-based browsers, like Safari) just like you can in other browsers.

    Enjoy! :-)

  2. jamesdbruner
    Member
    Posted 1 year ago #

    I loved this, so I made it into a tiny little plugin and added you as an author/contributor (I hope that's alright). You can see/download it here: http://wordpress.org/extend/plugins/image-resize-for-chrome-and-safari/

  3. WPwebbouw
    Member
    Posted 1 year ago #

    Well, I will probably be the only one who's bothered. But what mr. James Bruner has done here is, in my honest opinion, just plain and shameless plagiarism.

    The plugin is EXACTLY the code the OP has posted here above, but the plugin code mentions proudly mr. James Bruner as the author and the owner of the copyright for this piece of code he just copy/pasted from here. His email addres is proudly mentioned and his website even twice.

    The readme.txt mentions only the nickname korythewebguy as the second contributor AFTER (of course) jamesdbruner. There is even a donate link to - again - the website of mr. Bruner.

    You should have given the OP proper credits within the plugin description and humbly excuse yourself for posting his code unaltered.

    </rant off>

    e-

  4. jamesdbruner
    Member
    Posted 1 year ago #

    Without knowing Korytheweb guys email address or website, I was just trying to spread kory's awesome function! Nowhere do I claim that it's my code or do I ask for donations... Though I'll try to make it more apparent that Kory made it and not I.

  5. korythewebguy
    Member
    Posted 1 year ago #

    I appreciate your concern, WPwebbouw - Quite honestly, though, I found the $settings['webkit_fake_resize'] = 1; snippet on some blog (for which I cannot remember the name) on the Internet, and expanded upon it slightly by adding the filter function.

    I also didn't have anything to do with authoring/contributing to the the TinyMCE JS function(s) which $settings['webkit_fake_resize'] = 1; enables that makes the Webkit-magic happen.

    As I see it, the nature of all WordPress-related code is that it stands on the shoulders of the GNU General Public License, so while I could put my name/pseudonym to something, in actuality the only credit I can take is the effort put into it; the code itself is really not mine in any way.

    I'm really just happy that I could offer something to the community that is benefiting others :-) Whether that just makes things a little easier to use and/or puts a few dollars in their pocket, either way I'm glad it did something for someone somewhere.

  6. codecandid
    Member
    Posted 5 months ago #

    Yea the whole "plagiarism" / "copyright" argument is a endless battle and complete waste of time in my opinion. Look at the feud last year with Evanto/Wordpress. I'm not really sure how it ended, but I think Evanto ended up open sourcing most of what they were doing. On the other hand it also sucks because websites like wplocker and themeko can get away with ripping people off by posting premium themes on there site for free since its all suppose to be open-source. Anyway, to get on with my point of posting, this is definitely a great function. The upcoming wordpress actually has this built in I believe. For advice to anyone trying to add/remove features to tinymce I highly recommend taking a look at wp-includes/class-wp-editor.php where you can find 'webkit_fake_resize' => false on line 347 as well as all your other available options. While you shouldn't change this file directly you can easily change it with this plugin here. To those who are using the dev version of wordpress, you'll find that a ton of things in old tinymce plugins are deprecated now. This plugin is awesome though because you don't have to search or add 30 different plugins to get the editor how you want it. If you go to here you can download every feature tinymce offers. YOu can even create your own theme here.

Topic Closed

This topic has been closed to new replies.

About this Topic