Skip to content

Missing start_offset = 0 in the url. #64

@stefanheimes

Description

@stefanheimes

I want to add a image to the start of the video. So i have take a look in the documentation. See: http://cloudinary.com/documentation/video_manipulation_and_delivery#concatenate_videos_with_images
The documentation says:

start_offset (optional) set to 0 (so_0 in URLs) to concatenate the image at the beginning of the video instead of at the end.

So i try to add the start_offset = 0 but it was not in the url. So i have take a look in the code and i think i found the problem here: https://github.com/cloudinary/cloudinary_php/blob/master/src/Cloudinary.php#L440

You use the "empty"-function, per definition 0 is empty in PHP and so the function return a null.
See http://php.net/manual/en/function.empty.php#refsect1-function.empty-returnvalues

If i change the line to the following code, it works:

 if ($value === '' || $value === null) {

This are my Settings:

Array
(
    [0] => Array
        (
            [width] => 1024
            [height] => 768
            [crop] => fill
            [start_offset] => 4
            [duration] => 1.8
            [flags] => layer_apply
        )

    [1] => Array
        (
            [width] => 1024
            [height] => 768
            [overlay] => image:image_2043
            [flags] => splice
            [duration] => 3.6
        )

    [2] => Array
        (
            [start_offset] => 0
            [flags] => layer_apply
        )

    [3] => Array
        (
            [overlay] => video:audio_2585
            [duration] => 5.4
            [opacity] => 0
        )

)

and this is the wrong url, each linebreak is a replacment of the "/"

res.cloudinary.com
xxxxxxxx
video
upload
c_fill,du_1.8,fl_layer_apply,h_768,so_4,w_1024
du_3.6,fl_splice,h_768,l_image:image_2043,w_1024
fl_layer_apply
du_5.4,l_video:audio_2585,o_0
video_2593

and here with the fix:

res.cloudinary.com
xxxxxxxx
video
upload
c_fill,du_1.8,fl_layer_apply,h_768,so_4,w_1024
du_3.6,fl_splice,h_768,l_image:image_2043,w_1024
fl_layer_apply,so_0
du_5.4,l_video:audio_2585,o_0
video_2593

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions