Where is the time going with my ImageMagick rotations?

被刻印的时光 ゝ 提交于 2019-12-25 00:37:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!