开发者

RMagick: Get a list of available formats

开发者 https://www.devze.com 2023-02-25 13:59 出处:网络
With RMagick, is there any way to get a开发者_如何学Python list of all the available image formats for writing to? I want to fill a <select> tag with all of the different writable formats.Ruby 1

With RMagick, is there any way to get a开发者_如何学Python list of all the available image formats for writing to? I want to fill a <select> tag with all of the different writable formats.


Ruby 1.9.2

 Magick.formats.select {|image_format, mode_string| mode_string.include? 'w' }.keys.each do |image_format|
    puts image_format
 end

Relevant Source for RMagick

https://github.com/rmagick/rmagick/blob/master/lib/RMagick.rb#L19

Mode String Information for RMagick

http://www.google.com/codesearch/p?hl=en#q35x35fKNI0/pub/distfiles/ruby/RMagick-1.7.0.tar.gz%7CYe7iosFBC-s/RMagick-1.7.0/ext/RMagick/rmmain.c&l=239

0

精彩评论

暂无评论...
验证码 换一张
取 消