diff --git a/examples/dracula.gif b/examples/dracula.gif new file mode 100644 index 0000000..bb3143e Binary files /dev/null and b/examples/dracula.gif differ diff --git a/spec/graphtests.yaml b/spec/graphtests.yaml index c4ade4e..0184d04 100644 --- a/spec/graphtests.yaml +++ b/spec/graphtests.yaml @@ -188,6 +188,12 @@ _skipcompare: true _skiperrors: true input: "files/video-3dpmic.mp4" +- + _name: gif_to_mp4 + _graph: 'passthrough.mp4' + _skipcompare: true + _skiperrors: true + input: "files/dracula.gif" - _name: regcheck_nocontenttype_queryparams _graph: passthrough.jpg diff --git a/src/imgflo.coffee b/src/imgflo.coffee index 2ba6338..3e7703c 100644 --- a/src/imgflo.coffee +++ b/src/imgflo.coffee @@ -40,7 +40,7 @@ enrichGraphDefinition = (graph, publicOnly) -> minimum: 100 graph.inports.video_framerate = process: 'save' - port: 'framerate' + port: 'frame-rate' metadata: description: "Frames per second in output video" type: 'number' @@ -49,6 +49,7 @@ enrichGraphDefinition = (graph, publicOnly) -> minimum: 1 supportedVideoTypes = ['mp4'] +supportedVideoInputTypes = ['mp4', 'gif'] supportedTypes = ['jpg', 'jpeg', 'png', null].concat(supportedVideoTypes) extractMetadata = (stdout) -> @@ -83,8 +84,11 @@ class ImgfloProcessor extends common.Processor @installdir = installdir process: (outputFile, outputType, graph, iips, inputFile, inputType, callback) -> - return callback new errors.UnsupportedImageType inputType, supportedTypes if inputType not in supportedTypes return callback new errors.UnsupportedImageType outputType, supportedTypes if outputType not in supportedTypes + if typeIsVideo outputType + return callback new errors.UnsupportedImageType inputType, supportedTypes if inputType not in supportedVideoInputTypes + else + return callback new errors.UnsupportedImageType inputType, supportedTypes if inputType not in supportedTypes return callback new Error 'Requested graph has no "output" outport defined' if not graph.outports?.output g = prepareImgfloGraph graph, iips, inputFile, outputFile, inputType, outputType