Piwigo / piwigo-videojs

Videojs port for piwigo. Play your videos on your web gallery!
http://piwigo.org/ext/extension_view.php?eid=610
GNU General Public License v3.0
63 stars 45 forks source link

Unsupported operand types #179

Open adonix-dev opened 2 years ago

adonix-dev commented 2 years ago

Hi,

I got an issue when accessing the VideoJS tab of a video. image

PHP Page says : ./admin.php?page=plugin&section=piwigo-videojs/admin/admin_photo.php&image_id=74 Fatal error: Uncaught Error: Unsupported operand types in /var/www/html/piwigo/plugins/piwigo-videojs/include/exiftool.php:58 Stack trace: #0 /var/www/html/piwigo/plugins/piwigo-videojs/admin/admin_photo.php(109): include() #1 /var/www/html/piwigo/admin/plugin.php(53): include_once('/var/www/html/p...') #2 /var/www/html/piwigo/admin.php(298): include('/var/www/html/p...') #3 {main} thrown in /var/www/html/piwigo/plugins/piwigo-videojs/include/exiftool.php on line 58

flth commented 2 years ago

easy fix for this. open plugins/piwigo-videojs/include/exiftool.php, go to line 58 which looks like $exif['duration'] = round($general['Duration']*1000, 0); and replace it with $exif['duration'] = round((int)$general['Duration']*1000, 0);

tested with Piwigo 12.2.0 and PHP 8.0

RenaeMacLeod commented 9 months ago

This worked for me, thanks! Just need to work around the read-only nature of my directories.