问题
I need to rotate an image from my Ruby/Rails application and I've been using ImageMagick through the RMagick gem. I've tried both the command line tool (i.e. convert) and the API (e.g. Magick::Image#rotate) and in both cases the performance is more than 50 times worse than the corresponding Java operation in java.awt.geom.AffineTransform, per https://code.google.com/p/zxing/issues/detail?id=1745#c21 and the corresponding response (i.e. more than a second vs. 10s of milliseconds).
I've tried to step through the code in the RMagick gem using pry, but I can't "penetrate" the Image#rotate function from the debugger.
Although I've only tried rotate through the API, I've tried the convert command tool with and without -affine ... -transform and the results have not been significantly different.
Any help would be appreciated.
来源:https://stackoverflow.com/questions/21372096/where-is-the-time-going-with-my-imagemagick-rotations