Git Product home page Git Product logo

nette-webimages's People

Contributors

greeny avatar olicek avatar vojtech-dobes avatar vysinsky 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

Watchers

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

nette-webimages's Issues

Bad route behaviour

I noticed that when I have this "standard" router factory setup:

/**
 * @return \Nette\Application\IRouter
 */
public function createRouter()
{
    $router = new RouteList();
    $router[] = new Route('index.php', 'Homepage:default', Route::ONE_WAY);
    $router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
    return $router;
}

and in config:

webimages:
    routes:
        - 'images/<id>-<width>x<height>.jpg'

Then the <presenter>/<action>[/<id>] one somehow catches the image request and makes a whole lot of mess. Am I doing something wrong, or is it an issue?

When I actually PREPEND the webimages route, everything works fine. Maybe we should utilize something like https://github.com/Kdyby/Console/blob/master/src/Kdyby/Console/CliRouter.php#L124?

Plug-in support / call only specified providers (proposal)

Hi,

I will in near future make a local QR code image generator and don't want make It as separate add-on but as a plug-in to nette-webimages which I already using.

It can't be done now in handy way because Providers are called one by one.

All what is needed, I think, is to add some property e.g. $types to Generator with some default $type for current providers (eg. 'image') and extend Iprovider interface with e.g. getType() which is a small BC break.

Generator will then call only specified providers by given type.

Plug-in should work with same n:src macro and like any other image provider with new (optional) $type parameter what providers(s) should be call.

It can be done now by passing and additional argument to n:src macro, but the all providers must be altered to check that parameter and then do something...

This change should be also handy if I want to call only some providers on given image.

What do you think?

Incorrect .htaccess

Hi, I've just tried this on Apache and .htaccess from README does not work. I am not sure if I understand .htaccess and rewrite directives correctly but this is working for me:

RewriteCond %{REQUEST_URI} \.(jpg|jpeg|gif|png|ico)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .*$ /index.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ index.php [L]

Name for rules

If you want picture 100x100 in one case SHRINK_ONLY and in second case you want EXACT.

Is there any way how to detect 1st or 2nd case? I didn't found solution.

There could be a unique namespace/name/shotcut for rule (only for some specials). What do you think?

Allow returning no image from providers

It should be possible to allow situation when no provider will return anything (for example because image really isn't supposed to exist). Then the PHP script should return HTTP 404.

Tests

It would be nice to have some tests. Can I try to put something together?

Nette 3.0 support

Hello, would it be possible to unlock/update this module for Nette version 3.x? Thank you!

Generator - accept Configuration

In case of more params (maybe much more in the future), I suggest to create new object Configuration which pass to Generator.

Just for now there will be:

  • wwwDir
  • umask

I could prepare PR.

Localhost image generating

I have XAMMP and URL for example localhost/webimages/www and path for images is storage/.

It makes folders in storage, localhost/webimages/www/webimages/www/storage/mypicture-100x100.jpg.

It can be fixed by replacing basePath in URL. I could send PR.

Resizing image in provider

Why not create thumbnails in the provider? The provider generate only path to the picture, but I want to have in control the method of obtaining thumbnails.

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.