在 Drupal 7 中调整客户端的图像大小



是否有任何模块与图像/文件字段模块集成,允许我在Drupal 7中调整客户端的图像大小?我的客户有非常大的图像,我希望他在客户端调整它们的大小......

谢谢!

为 Drupal 安装 Plupload 模块

编辑文件 plupload.module

'resize' => array('width' => '320', 'height' => '240', 'quality' => '90'),添加到 #plupload_settings。

例:

$element['filefield_plupload']['pud'] = array(
      '#type' => 'plupload',
      '#title' => t('Select one or more files to upload'),
      // Even though filefield does validation on submit, this is required for
      // client side validation as well as proper file munging during upload.
      '#upload_validators' => $element['#upload_validators'],
      '#plupload_settings' => array(
          'cardinality' => $field['cardinality'],
          'resize' => array('width' => '320', 'height' => '240', 'quality' => '90'),

参考:Drupal 问题:上传客户端调整大小选项

Plupload具有该功能:

允许您使用HTML5 Gears,Silverlight,Flash,BrowserPlus或普通表单上传文件,提供一些独特的功能,例如上传进度,图像大小调整和分块上传。

非常方便的是,Drupal的Plupload模块已经存在。

最新更新