Rmagickã使ã£ã¦ç¸¦æ¨ªã®æ¯çããã©ãã©ã®ç»åãããæ£æ¹å½¢ã®ãµã ãã¤ã«ãåãåºãRubyã®ãµã³ãã«ã½ã¼ã¹ã§ãã以åã¯å¤§ããªç»åã縮å°ããã ãã§ããããä»åã¯ç¸¦ã»æ¨ªã®ä¸¡æ¹ãäºå®ã®ãµã¤ãºä»¥ä¸ãªãåãåºãã¦æ£æ¹å½¢ããããããå°ããå ´åã¯ç©ºç½ã§åãã¦ç»åãæ¡å¤§ããªãããã«èª¿æ´ã ð ã½ã¼ã¹ã³ã¼ããµã³ãã«ã½ã¼ã¹ã§ã¯æ¬¡ã®ãã¨ããã¦ãã¾ãã (1) ãµã³ãã«ã®ç»åããã¦ã³ãã¼ã (2) Rmagickã使ã£ã¦æ£æ¹å½¢ã®ãµã ãã¤ã«ç»åãåãåºã (3) ./data/ãã©ã«ãã«ãµã ãã¤ã«ç»åãä¿å require 'rubygems' require 'open-uri' require 'rmagick' # gem install rmagick def shrink_to_fill(image, width, height) image.resize_to_fill!(width, height)
ç»åå¦çãè¡ãã³ãã³ãããã±ã¼ã¸ã® ImageMagick ãå©ç¨ã㦠PDF ãã¡ã¤ã«ãããµã ãã¤ã«ç»åãä½æããã 以ä¸ã®ããã« convert ã³ãã³ãã使ã PDF ãã¡ã¤ã«ã®æåã®ãã¼ã¸ã®ãµã ãã¤ã«ãä½ããã¨ãã§ããã $ convert -resize 180x180 input.pdf[0] output.jpg -resize ãªãã·ã§ã³ã§ç¸¦æ¨ªã©ã¡ããã®æ大ãµã¤ãºï¼ç¸¦æ¨ªæ¯ã¯ä¿æãããï¼ãæå®ããPDF ãã¡ã¤ã«åã®å¾ã« [0] ãä»ãããã¨ã§æåã®ãã¼ã¸ããµã ãã¤ã«åããããæå®ããã æå¾ã«åºåç»åã®æ¡å¼µåãä»ãããã¡ã¤ã«åãæå®ããã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}