RMagickã®ä½¿ãæ¹ã®ã¡ã¢ ã©ã¤ãã©ãªã®ãã¼ã require 'RMagick' ãã¡ã¤ã«ã®èªã¿è¾¼ã¿ img = Magick::ImageList.new(path) ç»åã®ãµã¤ãº img.columns #=> æ¨ªå¹ img.rows #=> é«ã ç»åã®ãµã¤ãºãå¤æ´ãã width = 100 #æ¨ªå¹ height = 80 #é«ã image.resize(width, height) 縦横æ¯ãåºå®ãã¦ç»åã®ãµã¤ãºãå¤æ´ãã width = 100 height = (img.rows.to_f * width.to_f / img.columns.to_f).to_i img.resize(width, height) ç»åãä¿åãã img.write('/path/to/file') ç»åãå転ãã amount = 90 #è§åº¦(æè¨åã) new_img = img.
{{#tags}}- {{label}}
{{/tags}}