1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

Improved support for resolution/width/height bindings (and support for image files)

This commit is contained in:
Reinhard Pointner 2017-03-25 15:32:07 +08:00
parent a7c39e81dd
commit cc34001f0f

View File

@ -444,11 +444,11 @@ public class MediaBindingBean {
@Define("dim") @Define("dim")
public List<Integer> getDimension() { public List<Integer> getDimension() {
// collect Width and Height as Integer List // collect value from Video Stream 0 or Image Stream 0
return Stream.of("Width", "Height").map(p -> { return Stream.of(StreamKind.Video, StreamKind.Image).map(k -> {
// collect value from Video Stream 0 or Image Stream 0 // collect Width and Height as Integer List
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); return Stream.of("Width", "Height").map(p -> getMediaInfo().get(k, 0, p)).filter(s -> s.length() > 0).map(Integer::new).collect(toList());
}).collect(toList()); }).filter(d -> d.size() == 2).findFirst().orElse(null);
} }
@Define("width") @Define("width")