For some reason, mini_magick is attempting to process temp files that do not have valid extensions, which is causing
the underlying image magick commands to fail. This doesn't seem to have any impact on the results of the processing
but it's unsightly and confusing in my test scripts.
This article clearly articulates what's going on:
http://marsorange.com/articles/2006/07/17/of-mogrify-ruby-tempfile-dynamic-class-definitions
Borrowing some of the code from this article, it turns out to be a relatively easy fix to put back into the original
codebase. I'll post my suggested changes to your code in here. These changes continue pass your unit tests, at least
on my WinXP box:
Add this class into the module MiniMagick:
#code start
class ImgTempFile < Tempfile
def make_tmpname(basename, n)
sprintf('%s%d-%d', basename, $$, n)
end
end
#code end
Change this line:
tmp = Tempfile.new("minimagic")
To:
tmp = ImgTempFile.new("minimagic")
All annoying non-fatal warning messages go away!
By the way, here's an example of one of these annoying messages:
mogrify: unable to open module file `C:\apps\lib\ImageMagick-6.2.9-Q8\modules\coders\IM_MOD_RL_0_.dll': No such file
or directory.
I hope this helps. My name is Steve Midgley and feel free to contact me at "public" AT "misuse"
D OT "o r g"
Thanks for a great piece of code!
|