开发者

WordPress/GD resize images first, then crop height to a multiple of 18px minus 8px

开发者 https://www.devze.com 2023-02-08 06:33 出处:网络
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.

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

精彩评论

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