开发者

WordPress/GD resize images first, then crop height to a multiple of 18px minus 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.

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

  1. Image is resized as normal (thumbnail, medium, large), setting max width only in WP admin.
  2. The image height is (math, round?) cropped to the closest multiple value of X (in this case 18px).
  3. Using the new height, crop again by subtracting another X value of the height (in this case 8px).

The end result would ideally be a plugin where values can be activated and edited开发者_开发知识库 for individual users in a multi-site environment.


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".

I dig this way !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜