randomhost / webcamoverlay
Provides image overlay functionality for IP cam images.
Requires
- php: >=7.3.0
- randomhost/image: ~2.0
Requires (Dev)
- phpunit/phpunit: ~9.0
README
randomhost/webcamoverlay
1. Purpose
This package was developed to compensate for the lack of image overlay capabilities of some less sophisticated IP cameras. It takes the original image as uploaded by the camera from the web server and uses the GD library to modify the image on the fly before displaying it to the website visitor.
Features:
- picture watermarking with configurable image positions
- text watermarking (original image "modified" date + freely configurable text)
- configurable timed overlay image ("downtime" picture)
- image scaling
2. Example
3. Usage
A basic approach at using this package could look like this:
<?php declare(strict_types=1); use \randomhost\Image\Webcam\Overlay; require_once '/path/to/vendor/autoload.php'; $overlay = new Overlay(); $overlay->setWebcamImagePath('webcam.jpg'); $overlay->render();
This will instantiate the class, set the name of the uploaded webcam image and just render it without any overlay.
Assuming that you named this file webcam.php
, you should now be able to
access your webcam image at https://example.com/webcam.php
A more detailed example can be found in src/www/index.php
.
4. License
See LICENSE.txt for full license details.