Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Undefined array key "resolution" #217

Open
Groofertje opened this issue Dec 22, 2023 · 2 comments
Open

Warning: Undefined array key "resolution" #217

Groofertje opened this issue Dec 22, 2023 · 2 comments

Comments

@Groofertje
Copy link

Environment
Piwigo 14
Installed on 21 Dec 2023
Operating system: Debian GNU/Linux 12 (bookworm)
VideoJS

Warning: Undefined array key "resolution" in /mnt/DataDisk/www/public/piwigo/_data/templates_c/p6jhns^692b93885e2371fdf3d39260b560f744055a947d_0.file.admin_config.tpl.php on line 268

@leonkiriliuk
Copy link

leonkiriliuk commented Dec 22, 2023

Here's how I fixed it on Debian 12 with Piwigo 14
The Piwigo team really needs to take over this plugin and own it. Not supporting video in 2023 is a crime; videos at this point are as important as images!

  1. Start with the most up-to-date repo: https://github.com/klaoun/piwigo-videojs
  • click CODE and download as zip
  • replace all the files in piwigo/plugins/piwigo-videojs with that content
  1. Fix deprecated float to int casting:
  • edit include/function_frame.php and modify these lines at about the end of the file:
  // add source to band
  imagecopy($imgBand, $srcImage, (int)3*$const, (int)(3/2)*$const, 0, 0, (int)$srcWidth, (int)$srcHeight);

and this:

/**
 * create a rectangle with round corners
 * http://www.php.net/manual/fr/function.imagefilledrectangle.php#42815
 */
function imagefilledroundrectangle(&$img, $x1, $y1, $x2, $y2, $color, $radius)
{ 
  imagefilledrectangle($img, (int)$x1+$radius, (int)$y1, (int)$x2-$radius, (int)$y2, (int)$color);

  if ($radius > 0)
  {
    imagefilledrectangle($img, (int)$x1, (int)$y1+$radius, (int)$x2, (int)$y2-$radius, (int)$color);
    imagefilledellipse($img, (int)$x1+$radius, (int)$y1+$radius, (int)$radius*2, (int)$radius*2, (int)$color);
    imagefilledellipse($img, (int)$x2-$radius, (int)$y1+$radius, (int)$radius*2, (int)$radius*2, (int)$color);
    imagefilledellipse($img, (int)$x1+$radius, (int)$y2-$radius, (int)$radius*2, (int)$radius*2, (int)$color);
    imagefilledellipse($img, (int)$x2-$radius, (int)$y2-$radius, (int)$radius*2, (int)$radius*2, (int)$color);
  }
}
  1. If you want to add iPhone video support (MOV files) apply the following code changes as well:

https://github.com/Piwigo/piwigo-videojs/pull/163

Good luck!

P.S. THIS IS IMPORTANT: Before you start using the new code, go to admin -> Plugins -> click the ... on top of VideoJS3 and select "Restore". This will reset the settings of this plugin and get rid of all the errors.

@Groofertje
Copy link
Author

Groofertje commented Dec 23, 2023 via email

RomainGiraud added a commit to RomainGiraud/piwigo-videojs that referenced this issue Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants