参考:https://amon.org/randombg 实证未遂。缺少文件。
参考:https://amon.org/rotatebg 实证成功。
【介绍】
官网:https://picsum.photos/
源码:https://github.com/DMarby/picsum-photos
图库:https://picsum.photos/images
讨论:https://www.v2ex.com/t/168131
【部署】
先安装必要的包:
npm link async npm link sharp npm link moment
临时创建源码中缺少的文件夹和文件:
/opt/unsplash-it/images.json /opt/photos/metadata.json
执行命令:
node index.js
【用法】
Put your image size (width & height) after our URL and you’ll get a placeholder.
To get a square image, just put the size you want.
Random image
https://picsum.photos/200/300/?random
Grayscale
Use the /g/ path to greyscale the image.
https://picsum.photos/g/200/300
List images
Specific Image
Get a specific image by appending ?image to the end of the url.
https://picsum.photos/200/300?image=0
Blurred image
Get a blurred image by appending ?blur to the end of the url.
https://picsum.photos/200/300/?blur
Crop Gravity
Select the cropping gravity by adding ?gravity to the end of the url.
Valid options are: north, east, south, west, center