Coder Social home page Coder Social logo

ploythan93 / pollexor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from square/pollexor

0.0 2.0 0.0 651 KB

Java client for the Thumbor image service which allows you to build URIs in an expressive fashion using a fluent API.

Home Page: http://square.github.io/pollexor/

License: Apache License 2.0

Shell 3.06% Java 95.25% CSS 1.70%

pollexor's Introduction

Pollexor - Java Thumbor client by Square

Java client for the Thumbor image service which allows you to build URIs in an expressive fashion using a fluent API.

This library is also fully compatible with the Android platform.

Download

Download the latest JAR or grab via Maven:

<dependency>
  <groupId>com.squareup</groupId>
  <artifactId>pollexor<artifactId>
  <version>2.0.2</version>
</dependency>

or Gradle:

compile 'com.squareup:pollexor:2.0.2'

Snapshots of the development version are available in Sonatype's snapshots repository.

Examples

// Without encryption:
Thumbor thumbor = Thumbor.create("http://example.com/");

// With encryption:
Thumbor thumbor = Thumbor.create("http://example.com/", "key");
thumbor.buildImage("http://example.com/image.png")
    .resize(48, 48)
    .toUrl()
// Produces: /unsafe/48x48/example.com/image.png

thumbor.buildImage("http://example.com/image.png")
    .crop(10, 10, 90, 90)
    .resize(40, 40)
    .smart()
    .toUrl()
// Produces: /unsafe/10x10:90x90/smart/40x40/example.com/image.png

thumbor.buildImage("http://example.com/image.png")
    .crop(5, 5, 195, 195)
    .resize(95, 95)
    .align(BOTTOM, RIGHT)
    .toUrl()
// Produces: /unsafe/5x5:195x195/right/bottom/95x95/example.com/image.png

thumbor.buildImage("http://example.com/background.png")
    .resize(200, 100)
    .filter(
        roundCorner(10),
        watermark(thumbor.buildImage("http://example.com/overlay1.png").resize(200, 100)),
        watermark(thumbor.buildImage("http://example.com/overlay2.png").resize(50, 50), 75, 25),
        quality(85)
    )
    .toUrl()
// Produces: /unsafe/200x100/filters:round_corner(10,255,255,255):watermark(/unsafe/200x100/example.com/overlay1.png,0,0,0):watermark(/unsafe/50x50/example.com/overlay2.png,75,25,0):quality(85)/example.com/background.png

Note: If you are using a version of Thumbor older than 3.0 you must call legacy() to ensure the encryption used will be supported by the server.

License

Copyright 2012 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

pollexor's People

Contributors

jakewharton avatar edenman avatar danielheckrath avatar swankjesse avatar mcharmas avatar niqo01 avatar tasontag avatar

Watchers

James Cloos avatar  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.