发布时间: 2022-08-04 02:03:00
可以使用ffmpeg
更专业的是 inkscape
Dir.glob('*.svg').each do |file| puts "== processing file: #{file}" inkscape = '/mnt/d/softwares/Inkscape/bin/inkscape.exe' command = "#{inkscape} -o #{file.sub('.svg', '')}.png -w 1080 #{file}" `#{command}` end
mogrify -format jpg MY-PNG-FILE.png
Dir.glob('*.png').each do |file| puts "== processing file: #{file}" command = "mogrify -format jpg #{file}" `#{command}` endBack