GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: A lightweight and flexible website management system.
Homepage: http://webby.rubyforge.org/
Clone URL: git://github.com/TwP/webby.git
Fixing the TeX to image conversion routine so that it works with 
ImageMagick 6.4  Something broke with the 6.4 release, and so I had to 
futz with the convert command till I got it working again. I have no idea 
if this is backwards compatible with ImageMagick 6.3
Tim Pease (author)
Thu Jul 31 09:42:33 -0700 2008
commit  43fc5dc973a83b68d8119c90cd9f79759aeb09ce
tree    d62924acaa5fc0ade2e8b8bde0b530ab5745c319
parent  4f0397be3cdd6416317332cbde5ae41325935b91
...
97
98
99
100
101
102
103
 
 
 
104
105
106
...
126
127
128
129
130
 
 
131
132
133
...
97
98
99
 
 
 
 
100
101
102
103
104
105
...
125
126
127
 
 
128
129
130
131
132
0
@@ -97,10 +97,9 @@ module TexImgHelper
0
       %x[pdflatex -interaction=batchmode out.tex &> #{dev_null}]
0
 
0
       convert = "\\( -density #{res} out.pdf -trim +repage \\) "
0
- convert << "\\( +clone -fuzz 100% -fill #{fg} -opaque black \\) "
0
- convert << "+swap -compose copy-opacity -composite "
0
- convert << "\\( +clone -fuzz 100% -fill #{bg} -opaque white +matte \\) "
0
- convert << "+swap -compose over -composite #{out_file}"
0
+ convert << "\\( -clone 0 -negate -background #{fg} -channel A -combine \\) "
0
+ convert << "\\( -clone 0 -background #{bg} -channel A -combine \\) "
0
+ convert << "-delete 0 -compose dst-over -composite #{out_file}"
0
       %x[convert #{convert} &> #{dev_null}]
0
     ensure
0
       Dir.chdir(pwd)
0
@@ -126,8 +125,8 @@ end # module TexImgHelper
0
 
0
 %x[pdflatex --version 2>&1]
0
 if 0 == $?.exitstatus
0
- %x[convert --version 2>&1]
0
- if 0 == $?.exitstatus
0
+ %x[convert --help 2>&1]
0
+ if (0..1).include?($?.exitstatus)
0
     register(TexImgHelper)
0
   end
0
 end

Comments

    No one has commented yet.