Hi All, I have a question here: How to Speed up image processing of Paperclip in Acceptance Tests When running capybara feature specs I can see lots of Slow factory notices which are populated byfactory_girl. These Slow factory things heavy slow down the feature specs, I think, even feature specs are intrinsic slow specs. Then I had some inspect and found out most of the Slow factory was caused bypaperclip. We had model using paperclip here: FactoryGirl.define do factory :asset do image Rails.root.join(''spec/fixtures/sample.jpg'').open endend So I wonder if there''s a way like test mode for paperclip to speed up tests. I have simple solution here: Just copy the original file instead of actually crop it. The stackoverflow link: http://stackoverflow.com/questions/18605203/speed-up-image-processing-of-paperclip-in-acceptance-tests -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b4655458-7c60-44d0-a12a-78813bcb0387%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Tamara Temple
2013-Sep-05 04:23 UTC
Re: Speed up image processing of Paperclip in Acceptance Tests
On Sep 4, 2013, at 12:41 AM, Ryan <ryancheung.go-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All, > > I have a question here: How to Speed up image processing of Paperclip in Acceptance Tests > > When running capybara feature specs I can see lots of Slow factory notices which are populated byfactory_girl. These Slow factory things heavy slow down the feature specs, I think, even feature specs are intrinsic slow specs. Then I had some inspect and found out most of the Slow factory was caused bypaperclip. We had model using paperclip here: > > FactoryGirl.define do > > factory > :asset do > > image > Rails.root.join(''spec/fixtures/sample.jpg''). > open > > end > end > So I wonder if there''s a way like test mode for paperclip to speed up tests. I have simple solution here: Just copy the original file instead of actually crop it. > > The stackoverflow link: http://stackoverflow.com/questions/18605203/speed-up-image-processing-of-paperclip-in-acceptance-testsWondering also, how many times do you test the same paths with this? Maybe judicious use of before(:all) for some tests might speed things up as well? Another though (not really knowing if this makes sense) — if your image is 1x1 pixels does it do anything? You really should not need to test the actual image rendering bits more than once or twice in your whole suite. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5668BACF-F264-4675-86C4-434CC850B2B3%40gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Dsad D.
2013-Dec-03 02:44 UTC
Re: Speed up image processing of Paperclip in Acceptance Tests
Speed up image processing by using a easy to use image scaling, image resizing, image cropping or image flipping pulgins. Adopt the simplest apis and sample codes in this tutorial. http://www.rasteredge.com/how-to/asp-net-imaging/imaging-processing/ -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c56bdc6a2c2620f2ce8b20d84dc5ec6f%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.