Giter VIP home page Giter VIP logo

imbo's Introduction

Imbo

CI build

Imbo is an image "server" that can be used to add/get/delete images using a REST interface. There is also support for adding meta data to an image. The main idea behind Imbo is to have a place to store high quality original images and to use the REST interface to fetch variations of those images. Imbo will resize, rotate, crop (amongst other features) on the fly so you won't have to store all the different variations.

Installation / Configuration / Documentation

End-user docs can be found here.

License

Licensed under the MIT License.

imbo's People

Contributors

aliasaria avatar androa avatar chrisaq avatar christeredvartsen avatar dependabot[bot] avatar fangel avatar kbrabrand avatar kwn avatar matslindh avatar notomato avatar peterudo avatar rexxars 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

imbo's Issues

Varnish event listener

Imbo needs an event listener that can purge one or more Varnish servers when different events occur.

Introduce a "check" (or similar) resource

A resource that makes it possible to test public/private keys, signing etc. Would be great for clients to make sure they are correctly configured. Could possibly also test database, filesystem etc.

can't upload facebook profile picture

hi,

i tried adding a facebook profile picture either in format https://graph.facebook.com/user.name/picture or https://graph.facebook.com/user.id/picture which both resolve to https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash3/some_id_id_id_q.jpg via the addImageFromUrl function.

all of them gave me the ImboClient\Exception\RuntimeException

An error occured. Could not complete request (Response code: 0)

then i tried this picture http://upload.wikimedia.org/wikipedia/commons/1/1d/T-90_Bhisma_cropped.jpg. it worked ok.

what can be the problem? thanks

"Transformation bundles" / presets

Slightly unsure about the preferred URL-structure here, but an example would be:
/users/someuser/images/20ba09e9434c448ed629388ea5370749/?p[]=profile&accessToken=e0608d04e48ff13a3e5a700bf536bc473bfe4ab733b79140e4ceb0dbd95f2efe

Where "profile" would be a preset configured bundle of transformations, for example:
MaxSize(78, 78)
Canvas(78, 78, 'center')
Border('f00', 1, 1)

This would (in this case) cut down from 243 to 145 characters in the URL.

Another nice addition to this would be to have a "whitelist"-flag, which would indicate that the given preset did not need an access token.

Thoughts?

Add mode to the border transformation

The border transformation should have a mode parameter that enables you to decide if the border should be put outside of the original image (which is the current behavior) or inside the image, which will retain the original image width and height.

The crop transformation fails when x and/or y is 0

The crop transformation fails if x or y is equal to 0.

http://host/users/dev/images/image?t[]=crop:width=100,height=100,x=0,y=20

results in HTTP/1.1 400 Bad Request with this message:

Missing required parameter: x

More configuration options for the accessToken-listener

It would be nice to be able to configure the accessToken event listener to only be triggered for requests with one or more transformations attached.

This would make us able to send only the image identifier to a frontend and let javascript handle the URL building, potentially saving a lot of bytes.

Imbo returns incorrect content-type on errors

If a client requests the following URL:

/users/foobar.json

and the foobar user does not exist, the server should respond with Content-Type: application/json, but instead it uses the Accept header. Imbo disregards the Accept header when a specific extension is used in all other cases, and should do so in this case as well.

Stricter image validation

Imbo needs stricter image validation on PUT. Now it accepts broken images (which is represented in the return value of getimagesize by size/width of 0.

Automatically apply transformations using configuration

Imbo should support automatically adding transformations for all images (configurable per user (public key), before and after the regular transformation chain. This could for instance be used to automatically apply watermarks to all images for specific public keys.

The configuration might look something like this:

<?php
namespace Imbo\Image\Transformation;

use Imbo\Model\Image;

class customTransformation {
    public function __invoke(Image $image) {
        // custom transformation code
    }
}

// used in the configuration below
$customTransformation = new customTransformation();

function customFunc(Image $image) {
    // some custom code
}

return array(
    // ...

    'autoImageTransformations' => array(
        // settings per public key
        'publicKey' => array(
            // transformations applied BEFORE transformations specified in t[]
            'pre' => array(
                // implementation of the Imbo\Image\Transformation\TransformationInterface interface
                'thumbnail' => new Thumbnail(),

                // closure which receives the image to work with
                'customStuff' => function(Image $image) {
                    // custom transformation code
                },

                // callable code (instantiated above)
                'moreCustomStuff' => $customTransformation,

                // reference to the function defined above
                'awesomeCustomTransformation' => 'customFunc',
            ),
            // transformations applied AFTER transformations specified in t[]
            'post' => array(
                // same possibilities as above
            ),
        ),
    ),

    // ...
);

The transformations can be specified in the same manner as regular transformations under the ìmageTransformations key in the configuration array (see http://docs.imbo-project.org/en/latest/usage/configuration.html#image-transformations) and will be applied in the order specified in the configuration.

Thoughts?

images not displayed on Android 4.X default browser

When I enter a page with images generated by imbo they are not displayed. When image is viewed as single resource in browser (image link opened in window) and page is refreshed it becomes visible for browser.
Screenshot_2012-12-12-14-58-29
Screenshot_2012-12-12-15-00-14
Screenshot_2012-12-12-15-00-30

Figure out a more reliable signing method

Signatures are as of now generated using a timestamp. If this timestamp differs more than a minute or two, the request fails. This is potentially a problem in open environments where the date of the servers might be out of sync.

A solution where the signing of requests would work independently of the system clock would be a nice addition, improving the reliability.

Possible filesystem/database bug?

We have experienced that every once in a while an image is stored in database but not on the filesystem.

I have not experienced this when actually adding the image or in use, only when requesting /images

I see two possible areas where something might go wrong:

  • Adding an image
  • Deleting an image

We should investigate this further and see if we can find any code which might lead to this "unsynced" state.

Make adding custom transformations easier

It would be a really nice addition to be able to drop in a custom transformation without having to integrate it too deeply into the Imbo core. Adding transformations through the bootstrap for example would be a nice addition:

$container->transformationManager->addTransformation(new Rexxars\Transformation\Sexify());

...or some other clever way of doing it :-)

Public keys can not contain underscores

Today the router component uses the following regular expression for public keys:

(?<publicKey>[a-zA-Z0-9]{3,})

Because of this the public keys can not contain underscores. This should probably be fixed.

Image stays in database after file storage fails

When a new image is added it is first added to the database. If this is successful, and the storing of the file using a storage driver files, the image needs to be removed from the database as well.

Bug regarding errors from image transformations and image extensions

Whenever a transformation results in an error, and you use an image extension, the ResponseFormatter class tries to format the error model with an image formatter, which obviously makes no sense.

To trigger the error, make a request like this:

http://host/users/<publicKey>/images/<image>.<ext>?t[]=compress

The bug was introduced after the 0.1.0 tag.

Browser plugin

Imbo should have browser plugins that enables users to right click on images and directly upload them to one or more Imbo installations.

Imbo only works with Apache

Imbo currently only works running behind Apache because it depends on the Apache specific server variable REDIRECT_URL in Http/Request/Request.php.

The difference between REDIRECT_URL and REQUEST_URI is that REDIRECT_URL has the GET paramters stripped.

My proposed fix is to change the Http_Request contructor to build the path like this:

-        $this->path = str_replace($this->baseUrl, '', $this->server->get('REDIRECT_URL'));
+
+       $this->path = str_replace($this->baseUrl, '', $this->server->get('REQUEST_URI'));
+       if (strpos($this->path, '?') !== false) {
+            $this->path = substr($this->path, 0, strpos($this->path, '?'));
+       }

Test

Just a test to see if the notification stuff works.

Ability to fetch image in a specified file type (png, jpg, gif)

Would be nice to be able to upload an image in any format and have imbo serve you the image in the format specified, falling back to the original version if none is specified. Example:

I upload an image, my-cat.jpg, to imbo. It stores it without modification and the returned image identifier is simply a md5-hash of the image, without any extension.

If I want to fetch the image as a PNG, I can simply request GET //.png
If I wanted the original image (as JPG), I could GET //(.(jpg|jpeg))?

This way, one could easily use the service in scenarios where a specific file type is required, as well as only needing to store the actual md5-sum of the image as the identifier.

Dynamic auth info in the configuration array

Today the auth info (public/private key pairs) must be an array. Imbo could also support a closure for the auth part of the config that must return an array, making it easier to implement a different source of public/private keys than the configuration array. For instance:

<?php
return array(
    'auth' => function() {
        $pdo = new PDO('dsn', 'user', 'password');
        $sql = "SELECT publicKey, privateKey FROM imbo_users";
        $stmt = $pdo->prepare($sql);
        $stmt->execute();

        return $stmt->fetchAll(PDO::FETCH_COLUMN | PDO::FETCH_UNIQUE);
    },
);

metadata query

looks like its not possible to do a query on metada.

use case:

user creates an album, so i tag all photos with the name of the album, now i would like to retrieve all photos just by supplying the album name and the user. is it possible?

i believe that the hash can be indexed, so it should be doable.

Imbo needs a stats endpoint

Imbo should provide a stats endpoint that stats systems can use to aggregate data.

Elements that should be included:

  • Number of images
  • Number of users
  • Number of images per user

Canvas transformation

Imbo needs a transformation that can take an image and expand the canvas. Options must include the color to use in the regions that end up outside of the original image, and some options for how to place the original image inside the new canvas size.

memory consumption

could not get imbo running - if i call /status.json i get a white screen & in the logs get an error message about php consuming too much memory ( i gave php 2048M in php.ini )
any ideas?

SQL schema in docs not valid for MySQL

MySQL won't accept the schema defined in the documentation because imageIdentifier does not have a length. Key definition for imageIdentifier does not have a length either, and is not accepted.

backend

hi,

are the there any plans for a backend for imbo?

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.