Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Image resize just doing nothing [Vanilla 2.1.6] [Sorry for duplication]

Hello everybody,

I'm admin of a newly-created forum with Vanilla 2.1.6. For now, we've only got through basic configuration -so, nothing much different since the installation. Default theme, default text editor (CKEditor), no random add-on or anything.

To add an image to their post, users can click on the editor's "Image button". They paste the image link and can even type a replacement text, and specific width and height for the image (typed in manually in text boxes). This is great, they can virtually resize every image they post, and my users are well-trained so I know they won't have any problem with the little manual part.

But it just doesn't work. I've tried several times. I ask for my too big image to be only 400 in width (and auto height), the in-editor preview is good, the HTML code that is generated seems good to me (<'p'><'img' alt="" src="mylink.jpg" style="height:164px; width:400px" /></'p'>, of course without the ' ), but as soon as I post, nothing is resized. And as soon as I come back to the editor, the image is back the size I choosed.
I've also tried with gifs or pngs, with very small or large sizes to be sure to notice any difference, but nothing changes in my posts -as in the other user's-.

What should I do ? Do I have to get a better plug-in / theme / ... ?)
Thanks.

Comments

  • peregrineperegrine MVP
    edited December 2014

    I haven't tested but it is probably because styles are not allowed in vanilla 2.1.6 because they can present risks of someone sabotaging your forum with oversize images or image placement.

    at your own risk.... it may fix it.

    Option A (not the best because of above issue)

    in conf/config.php

    you can add (if not present or change from TRUE to

    $Configuration['Garden']['Html']['SafeStyles'] = FALSE;

    otherwise two better solutions


    I would recommend either B or C as better alternatives,

    Option B

    • buttonbar plugin

    $Configuration['Garden']['Html']['SafeStyles'] = TRUE;

    • and the ImageUpload plugin

    or


    Option C

    • buttonbar plugin

    • Fileupload 1.8.4.1

    http://vanillaforums.org/discussion/28532/a-mod-to-file-upload-version-1-8-4-to-make-it-work-with-vanilla

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited December 2014

    option D -seemed to work for me, it may work for you.

    change it sa below. any new images should have height and width attributes instead of style.

    ckeditor

    add this to your CKEditor/config.js

     config.allowedContent = { 
           $1: {
             elements: CKEDITOR.dtd,
             attributes: true,
             styles: false,
             classes: true
         }
     };
    

    it will turn off styles and convert to width and height attributes instead of style.

    and set
    $Configuration['Garden']['Html']['SafeStyles'] = TRUE;

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.