Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

SS24, howto prevent TinyMCE from scaling/recalculating images?


Go to End


5 Posts   3637 Views

Avatar
patte

Community Member, 63 Posts

3 June 2010 at 4:03am

Hey guys,

does anyone know a solution to prevent TinyMCE from scaling images? And why does TinyMCE limit the image size to 600px per default??? Thats really strange. Using the correct size the images get recalculated which is not good in any way of quality..
Any ideas?

Thanks much

patte?

Avatar
swaiba

Forum Moderator, 1899 Posts

4 June 2010 at 8:06pm

Yeah someone here noticed this... I am going to raise a ticket...

in the meantime there is a solution....

cms/code/ThumbnailStripField.php

change...

if($width > 600) {
	$height *= (600 / $width);
	$width = 600;
}
if($height > 600) {
	$width *= (600 / $height);
	$height = 600;
}

to.... (or some other larger number)
if($width > 1000) {
	$height *= (1000/ $width);
	$width = 1000;
}
if($height > 1000) {
	$width *= (1000/ $height);
	$height = 1000;
}

Barry

Avatar
patte

Community Member, 63 Posts

7 June 2010 at 8:08pm

Hi Barry,

a perfect workaround ;-)

Thanks
patte

Avatar
schellmax

Community Member, 126 Posts

14 August 2010 at 2:49am

just stumbled upon this again, had already posted a hack 2 years ago... (http://silverstripe.org/archive/show/37117?start=0#post70790)

ticket & nice solution by 'rino' to be found here:
http://open.silverstripe.org/ticket/4926

Avatar
JonoM

Community Member, 130 Posts

8 March 2013 at 8:42am

That ticket contains the perfect solution - allows you to set i.e. ThumbnailStripField::setEditorMaxWidth(800); in _config.php. (SS 2.x)

Such a simple and useful addition posted 3 years ago - what a shame it was never picked up for core!