diff --git a/modules/image/image.field.inc b/modules/image/image.field.inc index 07cc1e0..86854a1 100644 --- a/modules/image/image.field.inc +++ b/modules/image/image.field.inc @@ -356,7 +356,7 @@ function image_field_widget_process($element, &$form_state, $form) { '#type' => 'textfield', '#default_value' => isset($item['alt']) ? $item['alt'] : '', '#description' => t('This text will be used by screen readers, search engines, or when the image cannot be loaded.'), - '#maxlength' => variable_get('image_alt_length', 80), // See http://www.gawds.org/show.php?contentid=28. + '#maxlength' => IMAGE_TEXT_LENGTH_MAX, // See http://www.gawds.org/show.php?contentid=28. '#weight' => -2, '#access' => (bool) $item['fid'] && $settings['alt_field'], ); @@ -365,7 +365,7 @@ function image_field_widget_process($element, &$form_state, $form) { '#title' => t('Title'), '#default_value' => isset($item['title']) ? $item['title'] : '', '#description' => t('The title is used as a tool tip when the user hovers the mouse over the image.'), - '#maxlength' => variable_get('image_title_length', 500), + '#maxlength' => IMAGE_TEXT_LENGTH_MAX, '#weight' => -1, '#access' => (bool) $item['fid'] && $settings['title_field'], ); diff --git a/modules/image/image.install b/modules/image/image.install index 121e8c7..16f3249 100644 --- a/modules/image/image.install +++ b/modules/image/image.install @@ -121,13 +121,13 @@ function image_field_schema($field) { 'alt' => array( 'description' => "Alternative image text, for the image's 'alt' attribute.", 'type' => 'varchar', - 'length' => 128, + 'length' => IMAGE_TEXT_LENGTH_MAX, 'not null' => FALSE, ), 'title' => array( 'description' => "Image title text, for the image's 'title' attribute.", 'type' => 'varchar', - 'length' => 128, + 'length' => IMAGE_TEXT_LENGTH_MAX, 'not null' => FALSE, ), ), diff --git a/modules/image/image.module b/modules/image/image.module index d2d081c..e7f42cd 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -30,6 +30,11 @@ define('IMAGE_STORAGE_EDITABLE', IMAGE_STORAGE_NORMAL | IMAGE_STORAGE_OVERRIDE); */ define('IMAGE_STORAGE_MODULE', IMAGE_STORAGE_OVERRIDE | IMAGE_STORAGE_DEFAULT); +/** + * Image text length constant to represent maximum length for title/alt text. + */ +define('IMAGE_TEXT_LENGTH_MAX', 1024); + // Load all Field module hooks for Image. require_once DRUPAL_ROOT . '/modules/image/image.field.inc';