Guest User

Untitled

a guest
Jan 22nd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. ?[32mCommand?[0m :: convert "C:/Users/Anand/AppData/Local/Temp/120120924-3568-tx
  2. 2bxy.jpg[0]" -crop 103x103+0+0 -auto-orient "C:/Users/Anand/AppData/Local/Temp/1
  3. 20120924-3568-tx2bxy20120924-3568-16dij9c"
  4. ?[32mCommand?[0m :: file -b --mime "C:/Users/Anand/AppData/Local/Temp/120120924-
  5. 3568-tx2bxy20120924-3568-16dij9c"
  6. [paperclip] Error while determining content type: Cocaine::CommandNotFoundError
  7. ?[32mCommand?[0m :: identify -format %wx%h "C:/Users/Anand/AppData/Local/Temp/12
  8. 0120924-3568-tx2bxy.jpg[0]"
  9. ?[1m?[36m (0.0ms)?[0m ?[1mrollback transaction?[0m
  10. Completed 500 Internal Server Error in 145552ms
  11.  
  12. NoMethodError (undefined method `exitstatus' for nil:NilClass):
  13. app/models/user.rb:14:in `reprocess_photo'
  14. app/models/user.rb:14:in `reprocess_photo'
  15. app/models/user.rb:14:in `reprocess_photo'
  16. app/models/user.rb:14:in `reprocess_photo'
  17. app/models/user.rb:14:in `reprocess_photo'
  18. app/models/user.rb:14:in `reprocess_photo'
  19. app/models/user.rb:14:in `reprocess_photo'
  20. app/controllers/users_controller.rb:67:in `block in update'
  21. app/controllers/users_controller.rb:66:in `update'
  22.  
  23.  
  24. Rendered E:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/action_dispa
  25. tch/middleware/templates/rescues/_trace.erb (10.0ms)
  26. Rendered E:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/action_dispa
  27. tch/middleware/templates/rescues/_request_and_response.erb (1.0ms)
  28. Rendered E:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/action_dispa
  29. tch/middleware/templates/rescues/diagnostics.erb within rescues/layout (51.0ms)
  30. Exiting
  31.  
  32. class User < ActiveRecord::Base
  33. attr_accessible :name,:photo,:crop_x,:crop_y,:crop_w,:crop_h
  34. has_attached_file :photo,:styles => {:small=>"100x100#",:large=>"500x500>"},:processors => [:cropper]
  35. attr_accessor :crop_x,:crop_y,:crop_w,:crop_h
  36. after_update :reprocess_photo,:if=>:cropping?
  37.  
  38. def cropping?
  39. !crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank?
  40. end
  41.  
  42. private
  43.  
  44. def reprocess_photo
  45. photo.reprocess!
  46. end
  47.  
  48. end
  49.  
  50. module Paperclip
  51. class Cropper < Thumbnail
  52. def transformation_command
  53. if crop_command
  54. #this generates command :
  55. #this is right #convert "C:/Users/Anand/AppData/Local/Temp/1.jpg[0]" -crop 102x102+0+0 -auto-orient "C:/Users/Anand/AppData/Local/Temp/120120924-2336-qbzroo20120924-2336-1jqbiiv.jpg"
  56. crop_command + super.first.sub(/ -crop S+/, '')
  57. else
  58. super
  59. end
  60. end
  61.  
  62. def crop_command
  63. target = @attachment.instance
  64. if target.cropping?
  65. " -crop #{target.crop_w}x#{target.crop_h}+#{target.crop_x}+#{target.crop_y} "
  66. end
  67. end
  68. end
  69. end
  70.  
  71. Paperclip.options[:swallow_stderr] = false
  72. Paperclip.options[:command_path] = "C:/Program Files/ImageMagick-6.7.9-Q16/"
  73.  
  74. Paperclip.options[:command_path] = "C:/Program Files/ImageMagick-6.7.9-Q16/"
  75.  
  76. Paperclip.options[:command_path] = 'C:/PROGRA~1/IMAGEM~1.0-Q'
Add Comment
Please, Sign In to add comment