Drupal - 图像调整大小

Drupal - Image resize

在我的自定义模块中,我使用以下代码来显示图像。图像样式 "user_profile_image" 具有值 50、50。

它给我 html 这样的。

我不想在浏览器中使用 height="50" width="50" 调整图像大小。

我可以在服务器上调整它的大小,以便在客户端不需要高度和宽度属性吗?

print theme('image_style', array('path' => $res_value->_field_data['users_node_uid']['entity']->picture->uri, 'style_name' => 'user_profile_image'));

图像样式自动将您的样式(缩放、比例和裁剪..)应用于图像并将其存储在 drupal 文件位置的单独文件夹下。 它不是你想的 HTML 调整大小的图像。为了验证这个删除高度和宽度属性,你可以发现显示没有变化。

图像 url 包含 styles/<image-style-name>

例如:http://dummydomain.com/styles/thumbnail/testimg.jpg