Code Monkey home page Code Monkey logo

avatar-demo's Introduction

用户头像生成示例

Live Demo

本示例的目的是仿造 GitHub 一样能动态生成各种尺寸的用户头像。该示例采用 Nginximage_filter 模块来生成不同尺寸的头像。

我们将通过以下地址格式访问 64、128 和 180 像素的用户头像。

http://avatar.example.com/u/10086?s=64
http://avatar.example.com/u/10086?s=128
http://avatar.example.com/u/10086?s=180

安装

PHP 5 以上版本,项目根目录有一个 Nginx 配置示例,可参考使用,另外 storage/avatar 目录是用户头像上传后的存储位置,所以必须有可写权限。

UI 部分是参考别人做好的头像示例

截图预览

后记

如需了解更多有关 image_filter 的使用示例,可参考我的 wiki

读者实际上也可以尝试使用 ngx_small_light 第三方模块来生成头像,更多信息可查询图片缩略图

avatar-demo's People

Contributors

aisuhua avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.