Forum

Thread tagged as: Problem, Redactor

Redactor not cropping images

Hello all,

Well I've just stumbled across Redactor. It's a great little editor for clients. Thanks for including it in Perch.

I am however having an issue with it cropping images correctly. It's always cropping them to 640px wide even though I'm specifying the imagewidth to be 400px. Why might this be?

<perch:content id="main_text" type="textarea" label="Main Text Area" html="true" editor="redactor" imagecrop="true" width="400" height="500" bucket="Text Area Images" />

Whilst testing it I switched editors to markitup and the images were cropping correctly. So it seems to be something to do with Redactor. Any ideas?

Also, a bonus question. Is there a way of removing some options from Redactor like "Heading 1" or the alignment button.

Thanks for your help.

Here's my diagnostic report:


PERCH INFORMATION Perch: 2.7.4 Production mode: Production (100) Installed apps: content (2.7.4), assets (2.7.4), categories (2.7.4), perch_gallery (2.8.5), perch_shop_paypal (1.2), perch_blog (4.0.3) DB driver: PDO DB tables: perch2_blog_authors, perch2_blog_categories, perch2_blog_comments, perch2_blog_posts, perch2_blog_posts_to_categories, perch2_blog_posts_to_tags, perch2_blog_sections, perch2_blog_tags, perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users Users: 1 App runtimes: <?php $apps_list = array( 'content', 'perch_blog', 'perch_gallery', 'perch_shop', 'categories', ); ?> Scheduled tasks for perch_blog: delete_spam_comments (1440 mins) Editor plug-ins: ckeditor, redactor, markitup H1: 13c0ded1e4d7d4b4f05e81d5fe7007a8 L1: faf518fb59072a0455766d6b389283fd headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 0 content_collapseList: 1 lang: en-gb update_2.4.9: done latest_version: 2.5.3 on_sale_version: 2.7.4 update_2.7.4: done perch_blog_post_url: /blog/post.php?s={postSlug} perch_blog_update: 4.0 PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: btpsrvco_allplay PERCH_DB_SERVER: localhost PERCH_DB_DATABASE: btpsrvco_allplay PERCH_DB_PREFIX: perch2_ PERCH_TZ: Europe/London PERCH_EMAIL_FROM: andy@andybrowndesign.com PERCH_EMAIL_FROM_NAME: Andy Brown PERCH_LOGINPATH: /perch PERCH_PATH: /mnt/storage/home/b_tpsrvco/public_html/allplay/perch PERCH_CORE: /mnt/storage/home/b_tpsrvco/public_html/allplay/perch/core PERCH_RESFILEPATH: /mnt/storage/home/b_tpsrvco/public_html/allplay/perch/resources PERCH_RESPATH: /perch/resources PERCH_HTML5: 1 PERCH_RUNWAY: PERCH_ERROR_MODE: DIE PERCH_DATE_LONG: %d %B %Y PERCH_DATE_SHORT: %d %b %Y PERCH_TIME_SHORT: %H:%M PERCH_TIME_LONG: %H:%M:%S PERCH_DEBUG: PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /mnt/storage/home/b_tpsrvco/public_html/allplay/perch/templates PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_RWD: PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: HOSTING SETTINGS PHP: 5.4.35 Zend: 2.4.0 OS: Linux SAPI: cgi-fcgi Safe mode: not detected MySQL client: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $ MySQL server: 5.5.40-cll Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, calendar, ctype, curl, dom, hash, filter, ftp, gd, gettext, SPL, iconv, session, json, mbstring, mcrypt, standard, mysql, mysqli, mysqlnd, Phar, posix, Reflection, imap, SimpleXML, soap, sockets, exif, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, cgi-fcgi, PDO, pdo_sqlite, pdo_mysql, ionCube Loader GD: Yes ImageMagick: No PHP max upload size: 400M PHP max form post size: 8M PHP memory limit: 32M Total max uploadable file size: 8M Resource folder writeable: Yes Session timeout: 24 minutes Native JSON: Yes Filter functions: Yes Transliteration functions: No DOCUMENT_ROOT: /mnt/storage/home/b_tpsrvco/public_html/allplay GATEWAY_INTERFACE: CGI/1.1 HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 HTTP_ACCEPT_ENCODING: gzip, deflate, sdch HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8 HTTP_CONNECTION: keep-alive HTTP_COOKIE: cmsa=1; cmssb=0; PHPSESSID=c644ef09b891eec8b57563093fc695c0 HTTP_HOST: allplay.tpsrv.co.uk HTTP_REFERER: https://allplay.tpsrv.co.uk/perch/core/settings/diagnostics/ HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 PATH: /bin:/usr/bin QUERY_STRING: extended REDIRECT_STATUS: 200 REMOTE_ADDR: 31.185.199.175 REMOTE_PORT: 60545 REQUEST_METHOD: GET REQUEST_URI: /perch/core/settings/diagnostics/?extended SCRIPT_FILENAME: /mnt/storage/home/b_tpsrvco/public_html/allplay/perch/core/settings/diagnostics/index.php SCRIPT_NAME: /perch/core/settings/diagnostics/index.php SERVER_ADDR: 172.31.26.223 SERVER_ADMIN: webmaster@allplay.tpsrv.co.uk SERVER_NAME: allplay.tpsrv.co.uk SERVER_PORT: 80 SERVER_PROTOCOL: HTTP/1.1 SERVER_SOFTWARE: Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1e-fips mod_bwlimited/1.4 UNIQUE_ID: VJM3aKwfGt8AAEIidQoAAAAN PHP_SELF: /perch/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1418934120.23 REQUEST_TIME: 1418934120 argc: 1
Andy Brown

Andy Brown 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Try:

<perch:content id="main_text" type="textarea" label="Main Text Area" html="true" editor="redactor" imagecrop="true" imagewidth="400" imageheight="500" bucket="Text Area Images" />

Hi Drew,

Thanks for taking a look.

I forgot to mention I tried imagewidth & imageheight as well. But I tried your code too and no luck. Still doesn't resize it beyond 640px wide.

Andy

Is this just a bug then?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm taking a look into it and let you know.

Thanks Drew. It's not hugely urgent so don't worry too much. I may not get onto it now until after Christmas.

Just looked in there myself and found the bug.

In perch/addons/plugins/editors/redactor/_config.inc it says:

'upload Fields' in the Redactor constructor, but should say 'uploadImageFields'

Drew McLellan

Drew McLellan 2638 points
Perch Support

Looks like they changed the API with v10. Annoying!

Thanks for the info, I'll get it fixed in our version.

Thanks for figuring that all out guys. Much appreciated.

Have a good Christmas break.

Andy

Hi again Drew,

Do you know when you're planning on fixing this bug?

I've just started a new site with new Perch and Redactor and it still seems to be there.

Thanks,

Andy

Drew McLellan

Drew McLellan 2638 points
Perch Support

I fixed it immediately, but I don't think it's been released yet. I'll check.

Hey Drew,

Has this been fixed?

Thank,

Andy

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, are you not seeing an improvement?

I get complete fail with redactor ... all apps and perch up-to-date. devolving to ckeditor.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Ian, the thing to do would be to start your own thread explaining what problem you are seeing with Redactor. It's very popular so not everything is getting "complete fail" :) We can probably help you out!

Include your Diagnostics Report, and your template in a new thread and we'll take a look.

Thanks, Ok see new thread...