dotblue / nette-webimages

On-the-fly generated web images for your Nette app
Other
26 stars 18 forks source link

Name for rules #11

Closed f3l1x closed 9 years ago

f3l1x commented 10 years ago

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?

janedbal commented 10 years ago

You can define two rules and specify algorithm in route.

webimages:
    routes:
        - '/dir/<id>-<width>x<height>-<algorithm>.jpg'
    rules:
        - [width: 100, height: 100, algorithm: Nette\Utils\Image::EXACT]
        - [width: 100, height: 100, algorithm: Nette\Utils\Image::SHRINK_ONLY]
f3l1x commented 10 years ago

Oh, I see. Thx.