RmagickのImageListプロパティ一覧
詳細はこちら
http://studio.imagemagick.org/RMagick/doc/imageattrs.html
使用しそうなやつ。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
<textarea class="ruby" cols="60" rows="5" name="code"> >> img = Magick::ImageList.new("public/images/rails.png") => [public/images/rails.png PNG 50x64 50x64+0+0 DirectClass 8-bit 6kb] scene=0 # 縦幅 >> img.columns => 50 # 横幅 >> img.rows => 64 # ファイルタイプ >> img.format => "PNG" # 縦幅 >> img.class_type => DirectClass=1 # 縦幅 >> img.depth => 8 # カラー総数 >> img.number_colors => 2018 # ファイルサイズ >> img.filesize => 6646 # 画像ファイル数 >> img.length => 1 # ファイルネーム >> img.filename => "public/images/rails.png" # イメージタイプ >> img.image_type => TrueColorMatteType=7 # Mine Type >> img.mime_type => "image/png" # クオリティ(JPEGのみ1~100) >> img.quality => 0 #おまけ # リサイズ(フィット) >> img.resize_to_fit(75, 75) => public/images/rails.png PNG 50x64=>59x75 59x75+0+0 DirectClass 8-bit 6kb # リサイズ(フル) >> img.resize_to_fill(75, 75) => public/images/rails.png PNG 50x64=>75x75 DirectClass 8-bit 6kb </textarea> |