MojoMagick 的文檔中 號(hào)稱 更快,更簡(jiǎn)單并且沒有內(nèi)存泄露。但是目前還很簡(jiǎn)單

          文檔描述如下:
          引用
          cience releases MojoMagick, an Ruby language image library “that does very little” ™. There are several useful image tools that “do a lot” - MojoMagick is designed to just a few things:

          * Be fast
          * Don’t leak memory
          * Make simple ImageMagick tasks, simple as Ruby tasks
          * Permit direct access to ImageMagick for complex tasks (i.e. get out of your way)
          * Provide a central access to ImageMagick for good code architecture
          * Easy to extend
          * Limit memory accessible to ImageMagick (where desired)

          That’s what it does. It’s packaged as a Rails plugin, but does not require Rails to run. If there’s any interest, I’ll make it a gem (just ask).




          安裝
          ruby script/plugin install svn://svn.misuse.org/science/mojo_magick/trunk
          


          使用

          #獲取圖片的尺寸 (假設(shè)圖片為 "120wx222h")
          dimensions = MojoMagick::get_image_size(test_image)
          # ==> dimensions now holds a hash: {:height => 120, :width => 222}
          


          # 調(diào)整圖片大小
          MojoMagick::resize('/img/test.jpg', '/img/test2.jpg', {:width=>100, :height=>200})
          


          呵呵,沒了,這個(gè)東西才0.0.1,也許下一個(gè)版本會(huì)有更多的功能出現(xiàn)。

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           

          posts - 7, comments - 7, trackbacks - 0, articles - 12

          Copyright © 東方求敗

          主站蜘蛛池模板: 云龙县| 霞浦县| 富民县| 门源| 福贡县| 乌恰县| 灵川县| 永昌县| 慈利县| 开江县| 军事| 敖汉旗| 万载县| 进贤县| 上犹县| 鄱阳县| 宣汉县| 麻江县| 尼木县| 钟祥市| 余庆县| 宜昌市| 临邑县| 利津县| 光山县| 新兴县| 漳浦县| 营口市| 卓尼县| 兴业县| 罗田县| 林口县| 丽江市| 嘉荫县| 英山县| 贡嘎县| 黄大仙区| 尼木县| 榆林市| 珲春市| 汝城县|