|
|
| |||||||
| |||||||||
巻き戻し中。
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2014-03-23(日) なれる! [長年日記]
_ SEも11巻
まで読んだ。。。
それにしても、巻が進むごとに「あぁ、あるあるあ。。。。OTL」
ってなるのだけど(;・∀・)
特にね、11巻の「儲かる案件との抱き合わせ」って営業でも分からずに損なところだけ喜んで取ってきてる場合があるからねぇ、現実に。。。
_
image_gallery
4.0.1で動かなかったの、何とかしてみた。
・キャッシュは毎回ディレクトリごと消す
を結構忘れて嵌るなど。
あと、キャッシュまっさらだと読み込んだ値がnilやゼロで色々起きたりするので、image-gallery.rbを
120 #### uekusa 20140323 ####
121 # if @image_keys = ""
122 # @image_num = 0
123 # else
124 @image_num = @image_keys.length
125 # end
126 #########################
で最初だけゼロを明示したり、recent_image.rbも
253 #### uekusa 20140323 ####
254 # if keys != nil
255 #########################
256 keys.each do |key|
257 image = @recent_image_hash[key]
258 next if name_filter != nil and image.file.match(name_filter) == nil
259 next if title_filter != nil and image.title.match(title_filter) == nil
260 images.push(image)
261 if items != 0
262 throw :exit if items == images.length
263 end
264 #### uekusa 20140323 ####
265 # end
266 #########################
267 end
268 }
こんな感じで最初はnullだと処理飛ばしたり。
ついでに、サイズ取得で除算エラーが出たので、
270 result = %Q[<div class="recentimage">\n]
271 images.each do |image|
272 #### uekusa 20140323 ####
273 if image.height.to_i != 0 and image.width.to_i != 0
274 #########################
275 if image.height.to_i > image.width.to_i
276 sizestr = %Q[width="#{width*image.width.to_i/image.height.to_i}" height="#{width}"]
277 else
278 sizestr = %Q[width="#{width}" height="#{width*image.height.to_i/image.width.to_i}"]
279 end
280 #### uekusa 20140323 ####
281 else
282 sizestr = 0
283 end
284 #########################
こんな感じで値が取れなきゃ「0」を明示してみたり。
[ツッコミを入れる]
| Tweets by RC31E | |||||||||
| |||||||||
| |||||||||


