Jump to content

Prevent image resizing in PW CKEditor image dialog


DrQuincy
 Share

Recommended Posts

I can see in the Page Edit Image config there is an option to stop Skip width attributes on image tags but although it doesn't set width="" on inserted images it does still allow the size to be set in the dialog. Also, if you resize it it creates a new image on the server:

pw-generated-image.thumb.png.ac8fb85ecc3d34b05467b571b9b994e2.png

I basically don't want any image resizing doing and no variations created. So what I want ideally is these options hiding:

pw-image-buttons.thumb.jpg.fd63747f710ec38d95dadd54bb7c49cb.jpg

I just want it as simple as possible and prefer to handle sizing outside of the editor (the Images field already uses client-size resizing).

Is this possible?

Link to comment
Share on other sites

For anyone that is interested in doing the same this seems to have worked. Place this in admin.php, before the controller.php line:

$config->styles->add('/assets/css/custom.css');

And then add this in your new custom.css file:

form#selected_image_settings p#wrap_info span#action_icons span { display: none; }

form#selected_image_settings p#wrap_info span#action_icons span#description_action { display: block; }

span#selected_image_pixels,
span#selected_image_checkboxes { display: none; }


Now you just get the image description button.

Make sure you check the Skip width attributes on image tags in the Page Edit Image config or set width and height to auto in your main site CSS.

I will test it out a bit more but seems to be working fine for now.

 

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...