mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-11 18:56:21 +00:00
added identicons
This commit is contained in:
@@ -54,8 +54,9 @@ docker run -d -p 8080:80 --name=pictshare ghcr.io/hascheksolutions/pictshare
|
|||||||
|
|
||||||
Then open http://localhost:8080 in your browser
|
Then open http://localhost:8080 in your browser
|
||||||
|
|
||||||
## New Features in v2
|
## New Features
|
||||||
|
|
||||||
|
- Generate identicons based on strings in the URL [example1](https://pictshare.net/identicon/example1) [example2](https://pictshare.net/identicon/example2)
|
||||||
- Generate placeholder images by specifying the size in the URL. [example](https://pictshare.net/placeholder/555x250/color-white-blue)
|
- Generate placeholder images by specifying the size in the URL. [example](https://pictshare.net/placeholder/555x250/color-white-blue)
|
||||||
- Added support for external storage
|
- Added support for external storage
|
||||||
- [Encryption of files in external storage](/rtfm/ENCRYPTION.md)
|
- [Encryption of files in external storage](/rtfm/ENCRYPTION.md)
|
||||||
|
|||||||
38
content-controllers/identicon/identicon.controller.php
Normal file
38
content-controllers/identicon/identicon.controller.php
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Bitverse\Identicon\Identicon;
|
||||||
|
use Bitverse\Identicon\Color\Color;
|
||||||
|
use Bitverse\Identicon\Generator\RingsGenerator;
|
||||||
|
use Bitverse\Identicon\Preprocessor\MD5Preprocessor;
|
||||||
|
|
||||||
|
class IdenticonController implements ContentController
|
||||||
|
{
|
||||||
|
public const ctype = 'dynamic';
|
||||||
|
|
||||||
|
//returns all extensions registered by this type of content
|
||||||
|
public function getRegisteredExtensions(){return array('identicon');}
|
||||||
|
|
||||||
|
public function handleHash($hash,$url)
|
||||||
|
{
|
||||||
|
unset($url[array_search('identicon',$url)]);
|
||||||
|
$url = array_values($url);
|
||||||
|
|
||||||
|
|
||||||
|
$generator = new RingsGenerator();
|
||||||
|
$generator->setBackgroundColor(Color::parseHex('#EEEEEE'));
|
||||||
|
|
||||||
|
$identicon = new Identicon(new MD5Preprocessor(), $generator);
|
||||||
|
|
||||||
|
$icon = $identicon->getIcon($url[0]);
|
||||||
|
|
||||||
|
header('Content-type: image/svg+xml');
|
||||||
|
echo $icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handleUpload($tmpfile,$hash=false)
|
||||||
|
{
|
||||||
|
return array('status'=>'err','hash'=>$hash,'reason'=>'Cannot upload to Identicons');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"require": {
|
"require": {
|
||||||
"aws/aws-sdk-php": "^3.33"
|
"aws/aws-sdk-php": "^3.33",
|
||||||
|
"bitverse/identicon": "^1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
45
lib/composer.lock
generated
45
lib/composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "ef2729074d82a701a7df40571d9210ea",
|
"content-hash": "55774a7c38a82a511932ca4321acb7f8",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "aws/aws-sdk-php",
|
"name": "aws/aws-sdk-php",
|
||||||
@@ -91,6 +91,49 @@
|
|||||||
},
|
},
|
||||||
"time": "2017-08-21T20:34:30+00:00"
|
"time": "2017-08-21T20:34:30+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "bitverse/identicon",
|
||||||
|
"version": "1.1.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/bitverseio/identicon.git",
|
||||||
|
"reference": "65a50a5a8bd86b3591795937f9652b2e9075626c"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/bitverseio/identicon/zipball/65a50a5a8bd86b3591795937f9652b2e9075626c",
|
||||||
|
"reference": "65a50a5a8bd86b3591795937f9652b2e9075626c",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.4.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^5.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {
|
||||||
|
"": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Kuba Birecki",
|
||||||
|
"email": "kuba.birecki@bitverse.io"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A PHP library for generating identicons.",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/bitverseio/identicon/issues",
|
||||||
|
"source": "https://github.com/bitverseio/identicon/tree/master"
|
||||||
|
},
|
||||||
|
"time": "2015-11-01T21:19:42+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/guzzle",
|
"name": "guzzlehttp/guzzle",
|
||||||
"version": "6.5.8",
|
"version": "6.5.8",
|
||||||
|
|||||||
Reference in New Issue
Block a user