Giter Site home page Giter Site logo

codedoga / thumbor-toy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from plouc/thumbor-toy

0.0 0.0 0.0 1.58 MB

A reactjs based app to play with thumbor filters/resize

Home Page: http://plouc.github.io/thumbor-toy/

License: MIT License

JavaScript 77.73% CSS 21.98% HTML 0.29%

thumbor-toy's Introduction

thumbor-toy

Want to see it in action ? check the demo

Install

Dependencies install

npm install

Configuration

Create a config.js file with the config for your application, for instance:

module.exports = {
    common: {
        // This is optional, allowing you to select a mode from the settings and switch config accordingly
        modes: [{
            value: 'common',
            label: 'Basic'
        },{
            value: 'advanced',
            label: 'Advanced'
        }],

        // This is an optional config, to provide resizing ratios
        presetsResize: [{
            label:  '4/3',
            width:  432,
            height: 326
        }, {
            label:  '16/9',
            width:  462,
            height: 260
        }, {
            label:  '16/7',
            width:  474,
            height: 209
        }],

        // This is an optional config, to provide sample images pre-filtered & resized
        presetImages: [{
            label: 'Image 1',
            data: {
                server:  'http://server1.com/',
                image:   'image1.jpg',
                resize:  {
                    active: true,
                    width:  600,
                    height: 600,
                    smart:  true,
                    debug:  false,
                    fit:    false,
                },
                filters: [{
                    type: 'watermark',
                    settings: {
                        image:        'watermark.png',
                        x:            10,
                        y:            10,
                        transparency: 0,
                    }
                }]
            }
        }],

        // server base url ; this can also take an array such as: [{label: 'server1', 'url': 'http://server1.com'}, {label: 'server2', 'url': 'http://server2.com'}]
        source: {
            servers: [
                {
                    label: 'server1',
                    url: 'http://my.thumbor.server/',
                }
            ]
        },

        // available filters
        filters: [
            'blur',
            'noise',
            'watermark',
            'brightness',
            'grayscale'
        ],

        // available images
        images: [
            { label: 'first image',        src: 'image1.png' },
            { label: 'second image',       src: 'image2.png' }
        ],

        // available watermark images
        watermarkImages: [
            { label: 'copyright watermark', src: 'watermark.png' },
        ]
    },
    advanced: {
        source: {
            servers: [
                {
                    label: 'server 2',
                    url: 'http://my.other.thumbor.server/',
                }
            ]
        }
    }
};

Compile assets

gulp

thumbor-toy's People

Contributors

plouc avatar bladrak avatar gmarchand 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.