lib/httpthumbnailer/thumbnail_specs.rb in httpthumbnailer-0.0.13 vs lib/httpthumbnailer/thumbnail_specs.rb in httpthumbnailer-0.0.14
- old
+ new
@@ -22,7 +22,21 @@
ts << ThumbnailSpec.new(method, width, height, format, opts)
end
ts
end
+
+ def biggest_spec
+ max_field = -1
+ max_spec = nil
+ each do |spec|
+ field = spec.width * spec.height
+ if max_field < field
+ max_field = field
+ max_spec = spec
+ end
+ end
+
+ max_spec
+ end
end