piwigo-videojs
piwigo-videojs copied to clipboard
Use height instead of width
From Issue #8
I just tested and I think it would be better to scale by the height instead of the width.
For a 640x480 video and a 720p Max setting , you get a 1280x960 displayed wich is because to fit a 4:3 into a 16:9 canvas, you have to use the height as a reference.
For 16;9 video I agree that the current code would work.
So maybe something like :
$MAX_HEIGHT = intval( 9 * ($MAX_WIDTH/ 16 )); $width = intval($MAX_HEIGHT * ( $width / $height )); $height = $MAX_HEIGHT;
Thanks for your hard work.
The new code commit use the height instead of the width. Please test and feedback prior to release.
Could please test and feedback prior to release. http://piwigo.org/forum/viewtopic.php?id=24500