firegate666 / imageuploader
Utility to support image uploading and base64 encoded images in tags
Installs: 14 752
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.4
- ext-gd: *
This package is not auto-updated.
Last update: 2025-01-04 19:42:47 UTC
README
Print base 64 encoded img tag
Upload an image file and print it as base64 encoded image
HTML
<form method="post" enctype="multipart/form-data">
<input type="file" name="uploaded_image" />
</form>
PHP
$uploader = new ImageUploader($_FILES);
$base_64_encoded = $uploader->getBase64EncodedImageData('uploaded_image');
$width = $uploader->getWidth('uploaded_image');
$height = $uploader->getHeight('uploaded_image');
print '<img src="' . $base_64_encoded . '" width=" . $width . " height=" . $height . " />'