Skip to main content
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
Notice removed Canonical answer required by Patrick Kenny
Bounty Ended with Logan's answer chosen by Patrick Kenny
Tweeted twitter.com/#!/StackDrupal/status/560746695135604736
Notice added Canonical answer required by Patrick Kenny
Bounty Started worth 50 reputation by Patrick Kenny
Source Link
Patrick Kenny
  • 29.4k
  • 19
  • 139
  • 316

How can I remove the "The image was resized to fit within the maximum allowed dimensions..." message without hacking core?

By default, Drupal prints out a notification message that images exceeding the maximum dimensions were resized. I want to disable this message.

The relevant line is located in file_validate_image_resolution():

  drupal_set_message(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', array('%dimensions' => $maximum_dimensions)));

Obviously, the quick way to do this is to put two little slashes right before the line. But I am trying to do this without hacking core. I copied the entire function into MYMODULE_file_validate_image_resolution(), then commented the lines out, but this had no effect. What's the right way to do this?