开发者

Rails Pictures sort date

In Exifr for rails (im using this fork https://github.com/picuous/exifr ) how do i sort out the pictures according to date this is how to get the date

EXIFR::JPEG.new('IMG_6841.JP开发者_Go百科G').date_time           # => Fri Feb 09 16:48:54 +0100 2007

if im too vague let me know how to help


If you have all the pictures as a list just use Ruby's normal sort function (or sort!, if you want it in-place), so:

images.sort! { |img1, img2| img1.date_time <=> img2.date_time }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜