WordPress – Postie パッチメモ その2


I don’t like the way Postie resizes images. It only lets you specify the maximum width. What this does is result in images that are in landscape mode ending up a lot smaller than images that are in portrait mode. Aesthetically, it’s not a good look. I’ve posted the changes I made to fix this at: http://thejoshis.org/donutello/?p=6


This can be done easier by changing only the DetermineScale as so… The width you set in the options is the max width or height. It won’t enlarge images that are smaller than that.

function DetermineScale($width,$height, $max_width, $max_height) {
$max_dim = ($width > $height) ? $width : $height;
return ($max_dim > $max_width) ? ($max_width/$max_dim) : 1;

すばらしい!! 先人たちの知恵に感謝。


メールアドレスが公開されることはありません。 * が付いている欄は必須項目です