Class CropController
In: app/controllers/crop_controller.rb
app/controllers/crop_controller2.rb
app/controllers/crop_controller1.rb
Parent: ApplicationController

Methods

Constants

WorkFile = 'temp.jpg'
WorkFile = 'temp.jpg'
WorkFile = 'temp.jpg'

Public Instance methods

[Source]

     # File app/controllers/crop_controller1.rb, line 116
116:         def backspace
117:         
118:                 session[:state]=0
119:                 session[:title]='select which side to cut'
120:                 session[:pic]=session[:motherpic]
121:                 session[:freeze]=nil
122:                 redirect_to :action => "index"
123:         end

[Source]

    # File app/controllers/crop_controller2.rb, line 57
57:         def backspace
58: 
59:                 session[:state]=0
60:                 session[:selected_item]=0
61:                 session[:title]='select which side to cut'
62:                 session[:pic]=session[:motherpic]
63:                 session[:freeze]=nil
64:                 redirect_to :action => "index"
65:         end

[Source]

     # File app/controllers/crop_controller1.rb, line 90
 90:                 def bottomcrop(path,cropfile,percentcrop)
 91:                         path = path.chomp
 92:                         cropfile = cropfile.chomp
 93:                         percentcrop = (100-percentcrop.to_i)/100.0
 94:                         picwidth = 560 ;  #width of the pic (in pixels)
 95:                         picheight = 400;  #height of the pic (pixels)
 96:                         widthchanged = (picwidth*percentcrop)  #new width (based on the percentage specified by the 
 97:                         #user)
 98:                         heightchanged = (picheight*percentcrop) #new height (based on the percentage of cropping 
 99:                         #specified by the user)
100:                         if File.exists? (cropfile)
101:                                         logger.info("filepresent:#{cropfile}exists")
102:                         else
103:                         img =Magick::Image.read(path).first
104:                         img = img.scale(540,400)
105:                 
106:                         img.crop(NorthWestGravity,picwidth,heightchanged).write(cropfile)    
107:                         end  
108:                 end

[Source]

    # File app/controllers/crop_controller2.rb, line 37
37:         def crp(path,cropfile,width,height,percentcrop,gravity)
38:                 path = path.chomp
39:                 cropfile = cropfile.chomp
40:                 percentcrop = (100-percentcrop.to_i)/100
41:                 if File.exists?(cropfile)
42:                         logger.info("filepresent:#{cropfile}exists")
43:                 else
44:                         img=Magick::Image.read(path).first
45:                         img=img.scale(560,400).crop(gravity,width,height).write(cropfile)
46:                 end
47:         end

[Source]

     # File app/controllers/crop_controller.rb, line 11
 11:         def designers
 12: Co-Designer:<a href="http://anmolanand.wordpress.com/">
 13: Anmol Anand</a>
 14:         end
 15:         def get_mainfile
 16:                 session[:mainfile]
 17:         end
 18: 
 19:         def start_choices
 20:                 ['left','right','top','bottom']
 21:         end
 22: 
 23:         def get_choices
 24:                 session[:choices]=
 25:                  ['left','right','top','bottom']
 26:         end
 27:         def get_selected_item
 28:                 session[:selected_item]
 29:         end
 30: 
 31:         def get_motherpic
 32:                 session[:motherpic]
 33:         end
 34: 
 35:         def get_pic
 36:                 session[:pic]
 37:         end
 38:         def get_crop_percentage
 39:                 session[:crop_percentage]=((get_selected_item )* ("#{get_stepsize}".to_i)) % 100
 40: 
 41:                 session[:crop_percentage]
 42:         end
 43:         def first_time
 44:                 session[:motherpic]=session[:pic]=get_selected_pic
 45:                 session[:selected_item]=0
 46:                 session[:freeze]=nil
 47:                 session[:choices]=nil
 48:                 #session[:separator]=','
 49:                 #session[:crop_percentage] ||= 10     #session[:stepsize].to_i
 50:                 #state 0 => we are choosing what to change
 51:                 #state 1 => we have chosen what to change
 52:                 session[:state]=0
 53:                 session[:title]='select which side to cut'
 54:                 redirect_to :action => "index"
 55:         end
 56: 
 57:         def crp(path,cropfile,width,height,gravity)
 58: #               logger.info("path : #{path}")
 59: #               logger.info("crop : #{cropfile}")
 60: #               logger.info("width : #{width}")
 61: #               logger.info("height : #{height}")
 62: #               logger.info("gravity : #{gravity}")
 63: 
 64: 
 65:                 width=width.to_i
 66:                 height=height.to_i
 67:                 path = path.chomp
 68:                 cropfile = cropfile.chomp
 69:                 if File.exists?(cropfile)
 70: #                       logger.info("filepresent:#{cropfile}exists")
 71:                 else
 72:                         img=Magick::Image.read(path).first
 73:                         img=img.scale(560,400)
 74:                         img.crop(gravity,width,height).write(cropfile)
 75:                 end
 76:         end
 77: 
 78:         def selected(str)
 79:                 session[:motherpic]= get_pic
 80:         end
 81: 
 82:         def get_freeze
 83:                 session[:freeze] ||= get_selected_item        #session[:selected_item]
 84:         end
 85: 
 86:         def backspace
 87:                 session[:state]=0
 88:                 session[:selected_item]=0
 89:                 session[:title]='select which side to cut'
 90:                 session[:pic]=get_motherpic   #session[:motherpic]
 91:                 session[:freeze]=nil
 92:                 redirect_to :action => "index"
 93:         end
 94: 
 95:         def process_choice selected_choice
 96:                 if session[:state]==1
 97:                         session[:state]=0
 98:                         session[:selected_item]=0
 99:                         session[:freeze]=nil
100:                         session[:title]='select which side to cut'
101:                         session[:motherpic]=get_pic     #session[:pic]
102:                 else
103:                         session[:state]=1
104:                         session[:title]="crop#{get_crop_percentage}%"+get_choices[get_freeze % get_choices_size]
105: #                       logger.info("freeze:#{session[:freeze]}")
106:                 end
107:                         #logger.info("sel_state:#{session[:state]}")
108:                         #get_choices[get_freeze%session[:choices].size]
109:                         #logger.info("freeze:#{session[:freeze]}")
110:                         logger.info("sel_state:#{session[:state]}")
111: #                       logger.info("croppercent:#{get_crop_percentage}")
112:         end
113: 
114:         def updownevent
115: #               logger.info("reached updownevent")
116:                 if session[:state]==1
117:                         session[:crop_percentage]+=(get_stepsize).to_i
118:                         tempchoice = get_choices
119:                         choice=tempchoice[get_freeze % tempchoice.size]
120:                         logger.info("choice:#{choice}")
121:                         st = (Dir.pwd).chomp("/public")+"/public/images/"
122:                         dir= Dir.pwd
123: #                    logger.info("st : #{st}")

124: 
125:                         session[:mainfile]=  if session[:motherpic]=~/home/
126:                                                         session[:motherpic]
127:                                                 else
128:                                                         st+session[:motherpic]
129:                                                 end
130: 
131:                         picwidth = 560 ;  #width of the pic (in pixels)

132:                         picheight = 400;  #height of the pic (pixels)

133:                         #session[:crop_percentage]=(get_selected_item % 9 + 1)* 10

134:                         #session[:crop_percentage]=session[:crop_percentage]+session[:stepsize].to_i

135:                         #percentcrop=session[:crop_percentage]

136:                         percentcrop=get_crop_percentage
137: 
138:                         percentcrop = (100-percentcrop.to_i)
139:                         #percentcrop = 50

140:                         pwidth = ((picwidth)*percentcrop.to_i)/100
141:                         pheight=((picheight)*percentcrop.to_i)/100
142: #                               logger.info("percentcrop : #{percentcrop}")

143: #                               logger.info("crop_percentage :

144: #{session[:crop_percentage]}")

145: #                               logger.info("pwidth : #{pwidth}")

146: #                               logger.info("pheight : #{pheight}")

147:                         case choice
148:                                 when "left"
149:                                         filename="#{get_mainfile}".gsub(/\./,"cl#{get_crop_percentage}"+".")
150: #                                       logger.info("mainfile:#{get_mainfile}")

151:                                         session[:pic]=filename
152:                                         session[:title]="crop#{get_crop_percentage}%"+get_choices[get_freeze % get_choices_size]
153:                                         crp("#{get_mainfile}",filename,pwidth,picheight,NorthEastGravity)
154:                                  when "right"
155:                                         filename="#{get_mainfile}".gsub(/\./,"cr#{get_crop_percentage}"+".")
156:                                         session[:pic]=filename
157:                                            session[:title]="crop#{get_crop_percentage}%"+get_choices[get_freeze % get_choices_size]
158:                                         crp("#{get_mainfile}",filename,pwidth,picheight,NorthWestGravity)
159:                                         #logger.info("mainfile1:#{get_selected_pic}")

160: 
161:                                when "top"
162: 
163:                                         filename="#{get_mainfile}".gsub(/\./,"ct#{get_crop_percentage}"+".")
164:                                         session[:pic]=filename
165:                                         session[:title]="crop#{get_crop_percentage}%"+get_choices[get_freeze % get_choices_size]
166:                                          crp ("#{get_mainfile}",filename,picwidth,pheight,SouthEastGravity)
167: 
168:                                 when "bottom"
169:                                         filename="#{get_mainfile}".gsub(/\./,"cb#{get_crop_percentage}" +".")
170:                                         session[:pic]=filename
171:                                         session[:title]="crop#{get_crop_percentage}%" + get_choices[get_freeze %  get_choices_size]
172:                                         crp("#{get_mainfile}",filename,picwidth,pheight,NorthWestGravity)
173:                         end
174:         end

[Source]

     # File app/controllers/crop_controller1.rb, line 246
246:         def extras
247:                logger.info("reached extras")
248:                 if session[:state]==1
249:                         @selected_item = session[:freeze]%get_choices.size
250:                 end
251:                 if session[:pic].match("(/images/.*)$")
252:                         @picfile=$1
253:                 else
254:                         @picfile=session[:pic]
255:                 end
256:                 logger.info("mypic: #{@picfile}")
257:         end

[Source]

     # File app/controllers/crop_controller2.rb, line 143
143:         def extras
144:                logger.info("reached extras")
145:                 if session[:state]==1
146:                         @selected_item = session[:freeze]%get_choices_size
147:                 end
148:                 if session[:pic].match("(/images/.*)$")
149:                         @picfile=$1
150:                 else
151:                         @picfile=session[:pic]
152:                 end
153:                 logger.info("mypic: #{@picfile}")
154:         end

[Source]

    # File app/controllers/crop_controller1.rb, line 16
16:         def first_time
17:                 
18: session[:motherpic]=session[:pic]=get_selected_pic
19:                 session[:selected_item]=0
20:                 session[:freeze]=nil
21:                 session[:separator]=','
22:                 session[:crop_percentage]=0
23:                 #state 0 => we are choosing what to change
24:                 #state 1 => we have chosen what to change
25:                 session[:state]=0
26:                 session[:title]='select which side to cut'
27: 
28:         #session[:expiry]=
29: #'<meta http-equiv="Expires" content="0" />'
30:                         #so that any older copy of temp.jpg in the cache is not used
31:                 redirect_to :action => "index"
32:         end

[Source]

    # File app/controllers/crop_controller2.rb, line 22
22:         def first_time
23:                 session[:motherpic]=
24:                         session[:pic]=get_selected_pic
25:                 session[:selected_item]=0
26:                 session[:freeze]=nil
27:                 session[:choices]=nil
28:                 #session[:separator]=','
29:                 session[:crop_percentage]=session[:stepsize].to_i
30:                 #state 0 => we are choosing what to change
31:                 #state 1 => we have chosen what to change
32:                 session[:state]=0
33:                 session[:title]='select which side to cut'
34:                 redirect_to :action => "index"
35:         end

[Source]

    # File app/controllers/crop_controller1.rb, line 12
12:         def get_choices
13:                    session[:choices]=['left','right','top','bottom']
14:         end

[Source]

    # File app/controllers/crop_controller2.rb, line 17
17:         def get_choices
18:                 session[:choices]=
19:                 ['left','right','top','bottom']
20:         end

[Source]

    # File app/controllers/crop_controller2.rb, line 53
53:         def get_freeze
54:                 session[:freeze] ||= session[:selected_item]
55:         end

[Source]

     # File app/controllers/crop_controller1.rb, line 112
112:         def get_freeze
113:                 session[:freeze] ||= session[:selected_item]
114:         end

[Source]

    # File app/controllers/crop_controller1.rb, line 8
 8:         def get_selected_pic
 9:                 session[:picfile] ||= "yes.jpeg"
10:         end

[Source]

    # File app/controllers/crop_controller.rb, line 8
 8:         def get_selected_pic
 9:                 session[:picfile] ||= "yes.jpeg"
10:         end

[Source]

    # File app/controllers/crop_controller2.rb, line 8
 8:         def get_selected_pic
 9:                 session[:picfile] ||= "yes.jpeg"
10:         end

[Source]

    # File app/controllers/crop_controller1.rb, line 33
33:                 def leftcrop (path,cropfile,percentcrop)
34:                         path = path.chomp
35:                         cropfile = cropfile.chomp
36:                         percentcrop = (100-percentcrop.to_i)/100.0
37:                         picwidth = 560 ;  #width of the pic (in pixels)
38:                         picheight = 400;  #height of the pic (pixels)
39:                         widthchanged = (picwidth*percentcrop)  #new width (based on the percentage specified 
40:                         #by the user)
41:                         heightchanged = (picheight*percentcrop) #new height (based on the percentage of cropping 
42:                         #specified by the user)
43:                         logger.info("path:#{path},percentage:#{@crop_percentage}")
44:                         if File.exists? (cropfile)
45:                                         logger.info("filepresent:#{cropfile}exists")       
46:                         else
47:                         img =Magick::Image.read(path).first
48:                         img = img.scale(540,400)
49:                         img.crop(NorthEastGravity,widthchanged,picheight).write(cropfile)
50:         
51:                         end
52:                 end

[Source]

    # File app/controllers/crop_controller2.rb, line 67
67:         def process_choice selected_choice
68: 
69:                 if session[:state]==1
70:                         session[:state]=0
71:                         session[:selected_item]=0
72:                         session[:freeze]=nil
73:                         session[:title]='select which side to cut'
74:                         session[:motherpic]=session[:pic]
75:                 else
76:                         session[:state]=1
77:                         session[:title]=
78: "crop#{session[:crop_percentage]}%"+get_choices[get_freeze%get_choices_size]
79:                         logger.info("freeze:#{session[:freeze]}")
80:                 end
81:                         #logger.info("sel_state:#{session[:state]}")
82:                         #get_choices[get_freeze%session[:choices].size]
83:                         #logger.info("freeze:#{session[:freeze]}")
84:                         logger.info("sel_state:#{session[:state]}")
85:                         logger.info("croppercent:#{session[:crop_percentage]}")
86:         end

[Source]

     # File app/controllers/crop_controller1.rb, line 125
125:         def process_choice selected_choice
126: 
127:                 if session[:state]==1
128:                         session[:state]=0
129:                         session[:freeze]=nil
130:                 session[:title]='select which side to cut'
131:                 session[:motherpic]=session[:pic]
132:                 else
133:                         session[:state]=1
134:                                 
135: session[:title]="crop#{session[:crop_percentage]}%"+
136:                 get_choices[get_freeze%session[:choices].size]
137:         logger.info("freeze:#{session[:freeze]}")
138:         
139:                 end
140:                 logger.info("sel_state:#{session[:state]}")
141:                 logger.info("croppercent:#{session[:crop_percentage]}")
142: 
143:         end

[Source]

    # File app/controllers/crop_controller1.rb, line 53
53:                 def rightcrop(path,cropfile,percentcrop)
54:                         path = path.chomp
55:                         cropfile = cropfile.chomp
56:                         percentcrop = (100-percentcrop.to_i)/100.0
57:                         picwidth = 560 ;  #width of the pic (in pixels)
58:                         picheight = 400;  #height of the pic (pixels)
59:                         widthchanged = (picwidth*percentcrop)  #new width (based on the percentage specified by the 
60:                         #user)
61:                         heightchanged = (picheight*percentcrop) #new height (based on the percentage of cropping 
62:                         #specified by the user)
63:                         if File.exists? (cropfile)
64:                                         logger.info("filepresent:#{cropfile}exists")
65:                         else
66:                         img =Magick::Image.read(path).first
67:                         img = img.scale(540,400)
68:                         img.crop(NorthWestGravity,widthchanged,picheight).write(cropfile)
69:                         end
70:                 end

[Source]

    # File app/controllers/crop_controller2.rb, line 49
49:         def selected(str)
50:                 session[:motherpic]= session[:pic]
51:         end

[Source]

     # File app/controllers/crop_controller1.rb, line 109
109: def selected(str)
110: session[:otherpic]= session[:pic]
111: end

[Source]

    # File app/controllers/crop_controller2.rb, line 13
13:         def start_choices
14:                 ['left','right','top','bottom']
15:         end

[Source]

    # File app/controllers/crop_controller1.rb, line 71
71:                 def topcrop(path,cropfile,percentcrop)
72:                         path = path.chomp
73:                         cropfile = cropfile.chomp
74:                         percentcrop = (100-percentcrop.to_i)/100.0
75:                         picwidth = 560 ;  #width of the pic (in pixels)
76:                         picheight = 400;  #height of the pic (pixels)
77:                         widthchanged = (picwidth*percentcrop)  #new width (based on the percentage specified by the 
78:                         #user)
79:                         heightchanged = (picheight*percentcrop) #new height (based on the percentage of 
80:                         #cropping specified by the user)
81:                         if File.exists? (cropfile)
82:                                         logger.info("filepresent:#{cropfile}exists")
83:                         else
84:                         img =Magick::Image.read(path).first
85:                         img = img.scale(540,400)
86:                         img.crop(SouthEastGravity,picwidth,heightchanged).write(cropfile)
87:                         #img.crop(SouthEastGravity,picwidth,heightchanged).write(cropfile)
88:                         end  
89:                 end

[Source]

     # File app/controllers/crop_controller1.rb, line 146
146:         def updownevent
147:                 logger.info("reached updownevent")
148:                 if session[:state]==1
149:                         
150: 
151:                         session[:crop_percentage]=(get_selected_item % 9 + 1 ) * 10
152: 
153:                         tempchoice = get_choices
154:                         choice=tempchoice[get_freeze % tempchoice.size]
155:                         logger.info("choice:#{choice}")
156:                         case choice
157:                        when "left"
158:                 filename= 
159: "#{session[:motherpic]}".gsub(/\./,"cl#{session[:crop_percentage]}"+".")
160:                         mainfile=Dir.pwd+"/images/#{session[:motherpic]}"
161:                         
162:                         newfile= Dir.pwd+"/images/"+filename
163:                                                       
164:                         
165:                                 session[:pic]=newfile
166:                         session[:title]="crop#{session[:crop_percentage]}%"+
167:                                 get_choices[get_freeze%session[:choices].size]
168: 
169:                         leftcrop(mainfile,newfile,session[:crop_percentage])
170: 
171:                         logger.info("newfile:#{newfile}")
172:                   
173: #logger.info("mainfile1:#{get_selected_pic}")
174:                    
175: #logger.info("mainfile:#{session]=infile]}")
176:                         #logger.info("cropercentage:#{@cropercentage}")
177:                         #logger.info("selected pic:#{get_selected_pic}")
178:                         #logger.info("croping pic:#{session[:pic]}")
179: 
180:                 when "right"
181:                                               
182:         filename=
183: "#{session[:motherpic]}".gsub(/\./,"cr#{session[:crop_percentage]}"+".")
184:                         mainfile=
185: Dir.pwd+"/images/#{session[:motherpic]}"
186: 
187:                         newfile=Dir.pwd+"/images/"+filename
188: 
189:                                 session[:pic]=newfile
190: 
191: 
192:                         session[:title]="crop#{session[:crop_percentage]}%"+get_choices[get_freeze%session[:choices].size]
193:                         rightcrop(mainfile,newfile,session[:crop_percentage])
194:                         logger.info("newfile:#{newfile}")
195:                         #logger.info("mainfile1:#{get_selected_pic}")
196:                         #logger.info("mainfile:#{session[:mainfile]}")
197:                         #logger.info("cropercentage:#{@cropercentage}")
198:                         #logger.info("selected pic:#{get_selected_pic}")
199:                        # logger.info("croping pic:#{session[:pic]}")
200:                         
201:                         when "top"
202:                         
203:                        
204: filename="#{session[:motherpic]}".gsub(/\./,"ct#{session[:crop_percentage]}"+".")
205:                         
206: mainfile=Dir.pwd+"/images/#{session[:motherpic]}"
207: 
208:                        newfile= Dir.pwd+"/images/"+filename
209: 
210:                         
211:                         session[:pic]=newfile
212: 
213:                         session[:title]="crop#{session[:crop_percentage]}%"+get_choices[get_freeze%session[:choices].size]
214: 
215:                         topcrop(mainfile,newfile,session[:crop_percentage])
216:                         logger.info("newfile:#{newfile}")
217:                         #logger.info("mainfile1:#{get_selected_pic}")
218:                         #logger.info("mainfile:#{session[:mainfile]}")
219:                         #logger.info("cropercentage:#{@cropercentage}")
220:                         #logger.info("selected pic:#{get_selected_pic}")
221:                         #logger.info("croping pic:#{session[:pic]}")
222:                         
223:                         when "bottom"
224: 
225:                         
226:                 filename ="#{session[:motherpic]}".gsub(/\./,"cb#{session[:crop_percentage]}"+".")
227:                        mainfile=Dir.pwd+"/images/#{session[:motherpic]}"
228: 
229:                        newfile=Dir.pwd+"/images/"+filename
230: 
231: 
232:                              session[:pic]=newfile
233: 
234:                      session[:title]="crop#{session[:crop_percentage]}%"+get_choices[get_freeze%session[:choices].size]
235: 
236: bottomcrop(session[:mainfile],session[:newfile],session[:crop_percentage])
237:                         logger.info("newfile:#{newfile}")
238:                         #logger.info("mainfile1:#{get_selected_pic}")
239:                         #logger.info("mainfile:#{session[:mainfile]}")
240:                         #logger.info("cropercentage:#{@cropercentage}")
241:                         #logger.info("selected pic:#{get_selected_pic}")
242:                         #logger.info("croping pic:#{session[:pic]}")
243:                         end
244:                 end
245:         end

[Source]

     # File app/controllers/crop_controller2.rb, line 88
 88:         def updownevent
 89:                 logger.info("reached updownevent")
 90:                 if session[:state]==1
 91:                         #session[:crop_percentage]=(get_selected_item % 9 +1)*10
 92:                         session[:crop_percentage]=
 93: session[:crop_percentage]+session[:stepsize].to_i
 94:                         tempchoice = get_choices
 95:                         choice=tempchoice[get_freeze % tempchoice.size]
 96:                         logger.info("choice:#{choice}")
 97: st=
 98: Dir.pwd+"/images/"session[:mainfile]=
 99:                         if session[:motherpic]=~/home/
100:                                 session[:motherpic]                         
101:                                                 else      
102:                                                         st+session[:motherpic]
103:                                                 end
104: 
105:                         picwidth = 560 ;  #width of the pic (in pixels)
106:                         picheight = 400;  #height of the pic (pixels)
107:                         width = (picwidth*session[:crop_percentage])
108:                         height=(picheight*session[:crop_percentage])
109:                         case choice
110:                               when "left"
111:                                         filename=
112: "#{session[:mainfile]}".gsub(/\./,"cl#{session[:crop_percentage]}"+".")
113:                                         logger.info("mainfile:#{session[:mainfile]}")
114:                                         session[:pic]=filename
115:                                         session[:title]=
116: "crop#{session[:crop_percentage]}%"+get_choices[get_freeze%session[:choices].size]
117:                                         crp(session[:mainfile],
118:                                                 filename,width,
119:                         picheight,"#{session[:crop_percentage]}",
120:                                         NorthEastGravity)
121:                                  when "right"
122:                                         filename="#{session[:mainfile]}".gsub(/\./,"cr#{session[:crop_percentage]}"+".")
123:                                         session[:pic]=filename
124:                                         session[:title]="crop#{session[:crop_percentage]}%"+get_choices[get_freeze%get_choices_size]
125:                                         crp(session[:mainfile],filename,width,picheight,"#{session[:crop_percentage]}",NorthWestGravity)
126:                                         #logger.info("mainfile1:#{get_selected_pic}")
127:                                         
128:                              when "top"
129:                                         filename="#{session[:mainfile]}".gsub(/\./,"ct#{session[:crop_percentage]}"+".")
130:                                         session[:pic]=filename
131:                                         session[:title]="crop#{session[:crop_percentage]}%"+get_choices[get_freeze%get_choices_size]
132:                                         crp(session[:mainfile],filename,picwidth,height,"#{session[:crop_percentage]}",SouthEastGravity)
133: 
134:                                 when "bottom"
135:                                         filename="#{session[:mainfile]}".gsub(/\./,"cb#{session[:crop_percentage]}"+".")
136:                                         session[:pic]=filename
137:                                         session[:title]="crop#{session[:crop_percentage]}%"+get_choices[get_freeze%get_choices_size]
138:                                         crp(session[:mainfile],filename,picwidth,height,"#{session[:crop_percentage]}",NorthWestGravity)
139:                         end
140:                 end
141:         end

[Validate]