LoginSignup
4
4

More than 5 years have passed since last update.

MacPortsでインストールしたnginxのimage_filterを有効にする

Posted at

Webサービスで画像をカコイイ感じにリサイズ&クロップしたいなぁと色々調べていたら
こちらの記事でnginx+image_filterが良い感じに紹介されていました。

cloudrop / 簡単!リアルタイム画像変換をNginxだけで行う方法

nginx標準ではimage_filterが無効になっていて、有効にするには再ビルドが必要とのことでしたので
MacPortsでインストールするnginxのimage_filterを有効化する方法を調べてみました。

  1. GD2 (libgd) のインストールする
terminal
> sudo port install gd2
  1. MacPorts/nginxのビルド設定にimage_filterを有効化するためのオプションを追記
terminal
> sudo port edit nginx
variant image description {Enable image_filter} {
    configure.args-append   --with-http_image_filter_module
}
  1. MacPortsでnginxをインストール
terminal
> sudo port install nginx +image +ssl

これで上手くいきました!

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4