WordPress/GD首先调整图像大小,然后将高度裁剪为18px减8px的倍数 [英] WordPress/GD resize images first, then crop height to a multiple of 18px minus 8px

查看:72
本文介绍了WordPress/GD首先调整图像大小,然后将高度裁剪为18px减8px的倍数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个(很奇怪的)给你.

here's (a strange) one for you.

我正在WordPress网站上工作,重要的是让图像位于18px的基线网格上,该图像的总图像尺寸始终是18px的倍数,高度额外增加了8px.这主要是布局问题,要使图像与文本很好地配合播放.

I'm working on WordPress site where it's important to have images sit on a baseline grid of 18px, where total image dimensions are always multiples of 18px, with the height cropped by an extra 8px. This is mostly a layout thing and to have images play nicely with text.

我正在尝试弄清楚如何将WP/GD功能连接到以下位置:

I am trying to figure out how to hook into WP/GD functionality where:

  1. 将图像调整为正常大小(缩略图,中,大),仅在WP管理员中设置最大宽度.
  2. 图像高度(算术,舍入?)被裁剪为最接近X的倍数(在本例中为18px).
  3. 使用新的高度,通过减去高度的另一个X值(在本例中为8px)再次进行裁剪.

理想的最终结果是使用一个插件,可以在多站点环境中为单个用户激活和编辑值.

The end result would ideally be a plugin where values can be activated and edited for individual users in a multi-site environment.

进行了搜索,但没有一个明智的选择.

Have searched and searched, but none the wiser.

任何想法或(付费)帮助都很棒,非常感谢!

Any ideas or (paid) help would be fabulous, many thanks!

F.

推荐答案

我正在为网站寻求相同的行为.我发现了几个插件 http://wordpress.org/extend/plugins/resize-at-上传/ http://wordpress.org/extend/plugins/resize -on-upload/,它表明我们可以向"wp_handle_upload"添加操作.

i'm seeking the same behavior for a website. I found several plugins http://wordpress.org/extend/plugins/resize-at-upload/ or http://wordpress.org/extend/plugins/resize-on-upload/ which show that we can add an action to "wp_handle_upload".

我这样挖!

这篇关于WordPress/GD首先调整图像大小,然后将高度裁剪为18px减8px的倍数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆