From cc34001f0f1bb26428420df246266fbacc36146a Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 25 Mar 2017 15:32:07 +0800 Subject: [PATCH] Improved support for resolution/width/height bindings (and support for image files) --- source/net/filebot/format/MediaBindingBean.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/net/filebot/format/MediaBindingBean.java b/source/net/filebot/format/MediaBindingBean.java index 7c674564..871aa596 100644 --- a/source/net/filebot/format/MediaBindingBean.java +++ b/source/net/filebot/format/MediaBindingBean.java @@ -444,11 +444,11 @@ public class MediaBindingBean { @Define("dim") public List getDimension() { - // collect Width and Height as Integer List - return Stream.of("Width", "Height").map(p -> { - // collect value from Video Stream 0 or Image Stream 0 - return Stream.of(StreamKind.Video, StreamKind.Image).map(k -> getMediaInfo().get(k, 0, p)).filter(s -> s.length() > 0).map(Integer::new).findFirst().orElse(0); - }).collect(toList()); + // collect value from Video Stream 0 or Image Stream 0 + return Stream.of(StreamKind.Video, StreamKind.Image).map(k -> { + // collect Width and Height as Integer List + return Stream.of("Width", "Height").map(p -> getMediaInfo().get(k, 0, p)).filter(s -> s.length() > 0).map(Integer::new).collect(toList()); + }).filter(d -> d.size() == 2).findFirst().orElse(null); } @Define("width")