Giter VIP home page Giter VIP logo

imageserver's Introduction

Image Server

An image server toolkit in Go (Golang)

GoDoc Build Status Go Report Card

⚠️ This repository is not maintained anymore.

Features

Examples

Demos

These demos use the "advanced" example.

Click the images to see the URL parameters.

Resize

Options Result
width=200
(preserve aspect ratio)
height=200
(preserve aspect ratio)
width=200&height=200
(change aspect ratio)
width=200&height=200&mode=fit
(fit in 200x200)
width=200&height=200&mode=fill
(fill 200x200 and crop)

Rotate

Options Result
rotation=90
(counterclockwise)
rotation=45&background=ffaa88
(background)

Crop

Format: min_x,min_y|max_x,max_y

Options Result
crop=556,111|2156,1711
crop=956,511|1756,1311
crop=1252,799|1460,1022

Animated GIF

Original Resized
Animated
Spaceship

Gamma correction (more info)

Original Disabled Enabled
Dalai Gamma
Gray squares
Random
Rings
Rules / sucks

Resampling

Resampling Rings Large
Nearest neighbor
Box
Linear
Cubic
Lanczos

Quality

JPEG quality Result
5%
10%
50%

Convert (JPEG to GIF)

Backward compatibility

There is no backward compatibility promises. If you want to use it, vendor it. It's always OK to change things to make things better. The API is not 100% correct in the first commit.

imageserver's People

Contributors

dependabot[bot] avatar dotneet avatar opsidao avatar pierrre avatar shawnps avatar testwill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imageserver's Issues

Strange cache implementation

When we use cache (memory, redis, both of them), and run GOMAXPROCS=2, we see next:

  1. 50 request per second
  2. 8 core 100% loading

Then, we turn off cache and see:

  1. 8000 request per second
  2. 8 core 50% loading

???

How to run advanced demo

when i use advanced demo to run is ok,
but browse the url like localhost:8080/image/1.jpg
the result is : invalid param "path": unknown image "image/1.jpg"
so,please tell me how to use advanced demo
if i want to use graphicsmagick,how to use
thank you!

Newbie Scaling problem/question

Hi Pierrre,

I'm a golang/devops newbie.

I have a Node JS web-application and chatbot that uses this repository as the golang image server to handle all the images processing (with file cache system).

The image server is deployed in 2 instances and load balanced.

I predict that my current setup serves/handles about ......... 500,000 to 1,000,000 images/requests per day in various sizes ... Hard to tell what the number is exactly.

About 3 weeks ago, I noticed that a lot of my images were loading extremely slow and turning up broken. At that point I upgraded both my instances from micro to 1 vCPU, 3.75 GB mem. That actually solved the problem easily.

Fast forward to now, I'm starting to notice some slow loading images again and saw the broken images issue once or twice only.

Could I please get some advice and tips from you for dev-ops and scaling?

I have never really had to handle scaling before and I'm not sure how and what data to look at to measure if my instances' resources are sufficient.

For example, this may sound really dumb but when I look at the monitoring section in Google Cloud Platform, the CPU only peaks at 3% to 4% max, and I'm unsure if I'm looking at the right numbers.

Thank you kindly in advance.

build dependencies

do you have a script to install the graphicsmagick ?
I could not see one in the travis file, so wondering how to have an automated setup

Question about file cache

When I use the file cache option, IF my instance runs out of space, what will hapepn? Does your server automatically delete files to free up disk space?

unexpected directory layout

System Info

  • OS: Windows10
  • Go version: go1.10.1 windows/amd64
  • GOPATH: C:\projects
  • GOROOT: C:\Go\
  • DEP: dep
  • PROJECT NAME: image

Expected Bahavior

Server started

Actual Behavior

unexpected directory layout:
import path: github.com/pierrre/imageserver
root: C:\projects\src
dir: C:\projects\src\image\vendor\github.com\pierrre\imageserver
expand root: C:\projects\src
expand dir: C:\projects\src\image\vendor\github.com\pierrre\imageserver
separator: \

Description

I tried your demo https://github.com/pierrre/imageserver/blob/master/examples/simple/simple.go with dep instead of go get, and this error happend when I tried to testrun.

This only happens when I use dep, and imageserver is under vendor folder.
It works when I use go get, but I don't see why it doesn't work anymore when I use dep.

AWS S3 support

First off, kudos for the awesome work.

Is there a way to use this with S3 bucket ? Something like a CDN server.

Example flow:

  1. When user goes to:

http://localhost/path/to/s3/file.jpg?width=100&height=200

  1. The server then downloads the file from S3, applies the given transformations and outputs the final image's buffer in response.

internal server error

Hi! Thanks for this repo, I'm trying to learn Go so maybe it's my fault but I'm struggling with an error.

I cloned the repo in the folder where I have Go projects and I can run:
go run simple.go and this is working:
http://localhost:8080/?source=https://www.google.co.uk/images/srpr/logo11w.png

But if I try to add a parameter:
http://localhost:8080/?source=https://www.google.co.uk/images/srpr/logo11w.png&width=200

I receive Internal Server Error

How can I debug this?

Go 1.3 on OSX 10.9.4

Many thanks

Is it possible to load images from a custom folder.

Hi, the project is awesome and I like it very much. I want to use it as my image server, however, I found all the images are loaded from a special folder naming testdata. I am wondering How can I custom some codes to make it possible that I can totally use the project as an image server including getting images from a custom folder on my disk.

how to deploy

we use Flynn for our servers. As I'm not an expert when it comes to Go, how can we deploy this app? is there a tutorial?

How to set up CORS?

Hi, how can I setup CORS without modifying the newImageHTTPHandler() function?

Help deploying to App Engine

Hi Pierrre,

I would like some help deploying a golang image server using your package to the Google App Engine.

Problem is, App Engine rejects the use of sockets. I think in order to rectify the issue, "google.golang.org/appengine/socket" package is necessary.

I'm trying to follow this github issue to fix the issue: go-sql-driver/mysql#457

"google.golang.org/appengine"
"github.com/go-sql-driver/mysql"
"google.golang.org/appengine/socket"

dial := func(addr string) (net.Conn, error) {
        return socket.Dial(appengine.NewContext(r), "tcp", addr)
    }

mysql.RegisterDial("external", dial)

However, I'm not sure how I could get access to the http request from where the Redis socket.Dial() is called.

about time.LoadLocation("GMT") in windows server2012 problem

in Windows Server 2012 Failure to perform normally time.LoadLocation("GMT")

The error is as follows:

UTC open C:\Go/lib/time/zoneinfo.zip: The system cannot find the path specified.

And I found your questions at go's issues,But our system is different

I found in the test that the program can be used normally by modifying imageserver/http/util.go/GMT to UTC. Therefore, if the GMT in the source code is changed to UTC, is this correct? I hope to get your suggestion?

//src
// var expiresHeaderLocation = getTimeLocation("GMT")
//me code
var expiresHeaderLocation = getTimeLocation("UTC")

Question about the server part.

Does it have an stand alone server?

Can I use ssl on a direct configuration or I need to use a proxy like ngnix?

Thank you.

Hotlink image to cache ?

Hello there, nice server !

Would that be possible to hotlink images to cache ?

Something like

http://fuckingfrogs.fr:8080/?source=http://stock.wikimini.org/w/images/b/b5/Poney_shetland-9380.jpg

that would make the server download the image only on the first hit and then cache it ?

Cheers !

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.