dotblue / nette-webimages Goto Github PK
View Code? Open in Web Editor NEWOn-the-fly generated web images for your Nette app
License: Other
On-the-fly generated web images for your Nette app
License: Other
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?
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?
See
nette-webimages/src/Generator.php
Line 96 in 7b5f119
Is it possible to update composer dependencies to be able to use this library with nette 2.4?
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]
Currently, composer dependencies are locked to nette components in version <2.3. Is it needed or is it possible to unlock it?
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?
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.
There is no suitable place, where to catch this exception and convert it to BadRequestException, therefore passing invalid URL causing this exception leads to error 500, not 404 as it should.
It would be nice to have some tests. Can I try to put something together?
Hello, would it be possible to unlock/update this module for Nette version 3.x? Thank you!
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:
I could prepare PR.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.