Piwigo Bugtracker

Piwigo bug tracker has moved to Github

This bugtracker is kept to provide history on old issues.

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003208Piwigouploadpublic2015.03.02 15:112015.03.03 15:41
Assigned To 
PlatformWindowsOSOS Version
Product Version2.7.4 
Target VersionFixed in Version 
Summary0003208: getimagesize() on php on windows returns no width and height for mp4 files
DescriptionFrom https://github.com/xbgmsharp/piwigo-videojs/issues/45 [^]

In /admin/include/functions_upload.inc.php I have changed the function pwg_image_infos($path).
This is necessary because getimagesize() on php on windows no width and height for mp4 files returns.
getimagesize() on php on windows heigth and width are empty (not 0, but empty) on Windows
Steps To ReproduceFor video upload I use the web form in the admin menu (Photos - Add), with a small video named test_9mb.mp4.
Just before the upload of the video is done the function
add_uploaded_file("./upload/buffer\test_9mb.mp4", "test_9mb.mp4", .....
is called (in /admin/include/functions_upload.inc.php).
This function calls $file_infos = pwg_image_infos("././upload/2015/02/28/20150228204355-3b12953d.mp4");
In this function is getimagesize with the mp4 video used, that does not work (see my changes in this function, I use ffmepg).
Additional Information    /* function changed by photonensammler because getimagesize() on windows returns no width and height für video files */
    /* ffmpeg must be installed !!! */

    function pwg_image_infos($path) {
        global $conf;
        $size = getimagesize($path);
        if (($size === FALSE || $size == 0) && isset($conf['vjs_sync'])) { //use ffmepg to get the size
            $ffmpeg = unserialize($conf['vjs_sync']);
            $ffmpeg_return = shell_exec($ffmpeg['ffmpeg'] . ' -i "' . $path . '" -vstats 2>&1');
            $regex_sizes = "/([0-9]{1,4})x([0-9]{1,4})/";
            preg_match($regex_sizes, $ffmpeg_return, $regs);
            $size = explode('x', $regs[0]);
        list($width, $height) = $size;
        $filesize = floor(filesize($path) / 1024);
        return array(
            'width' => $width,
            'height' => $height,
            'filesize' => $filesize,
TagsNo tags attached.
Database engine and version
PHP version
Web serverApache 1.3.x
Attached Files

- Relationships

-  Notes
xbgmsharp (reporter)
2015.03.03 15:41

I think i find a work around.
https://github.com/xbgmsharp/piwigo-videojs/commit/8396f719d105c440b260d09725a830cd65a7c1be [^]

When confirm we could close this ticket.
However it is interesting to keep in mind as it is a windows specific issue.

- Issue History
Date Modified Username Field Change
2015.03.02 15:11 xbgmsharp New Issue
2015.03.02 15:11 xbgmsharp browser => any
2015.03.02 15:11 xbgmsharp Web server => Apache 1.3.x
2015.03.03 15:41 xbgmsharp Note Added: 0007776

Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker