Download the PHP package tomaj/nette-images without Composer

On this page you can find all versions of the php package tomaj/nette-images. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nette-images

Nette Image

Specialna kniznica pre lahsiu pracu s obrazkami. Umoznuje ukladat obrazky do roznych storagov a roznej struktury. Rovnako umoznuje vytvarat priamo k obrazkom rozne thumby.

Build Status Dependency Status

Latest Stable Version Latest Unstable Version License

Instalacia

Najlepsie cez composer

Nastavenie

Pre fungovanie je potrebne zaregistrovat a nastavit, pdola toho aky backend chceme pouzivat. Backend je treba zaregistraovat ako nette service. Pouzitie klasickeho file backendu: alebo je mozne pouzit S3 backend . Nastavenie je treba upravit podla toho kam na S3 chceme obrazok ukladat

Celkova konfiguracia moze vyzerat napriklad takto:

Aplikacia moze obsahovat viacero instancii sluzby ImageService kde kazda moze pouzivat iny backend a ine velkosti pre obrazky

Pre fungovanie helpra v sablonach ho je potrebne zaregistrovat v presenteri:

Pouzitie

Pouzitie je rozdelene 2 casti - pridanie obrazku a vytvorenie linky na obrazok.

Upload

Novy obrazok je mozne pridat v kode cez nasledovanu funkciu:

Tento $identifier ktory vrati metoda store() si treba ulozit pre spetne ziskanie obrazku

Novy obrazok je mozne pridat priamo z nette formulara takto:

Generovanie nahladov

Pre vytvorenie nahladu je potrebna hodnota ktoru ImageService vratil po ulozenie obrazku. Priklad moze vyzerat nasledovne:

NOTE: v pripade ze zmensenina ktora sa da vytvorit neexistuje tak vytvori linka ktora bude odkazovat na neexistujuci zdroj, pokial tuto chybu neostruje priamo backend.

Tiez je mozne pouzit priamo vygenerovanie nahladu v sablone pomocou helpera (je potrebne ho zaregistrovat ako je uvedene na zaciatku)

Pri tomto pouziti je dolezite uvies druhy paramter(retazec) podla ktoreho sa pouzije spravny ImageService - v projekte ich moze byt viac. Pomocou dependecy injection sa vytvori nazov sluzby ktora sa bude pouzivat - toto chovanie je mozne v aplikacii zmenit, nie je sucastou kniznice(implementacia je hore pri registrovanie helpera)

Rozne typy nahladov Pre nahlady je mozne pouzit rozne presety podla ktorych sa budu obrazky pouzivat. Konfiguracia potom vyzera takto:

Nazvy a funkcnost presne kopiruje nette dokumentaciu ku obrazkom. http://doc.nette.org/cs/2.1/images Defaultne je pouzity preset EXACT.

Vygenerovanie novej velkosti alebo pregenerovanie nahladov

Na vygenerovanie novej velkosti existuje funkcia regenerateThumb v image servise. Staci ju zavolat nad identifiermi ktore mame a vygeneruju sa nove thumby. Pouzitie moze vyzerat nasledovne:

Rozisrenie - pridanie noveho backendu

Pre pridanie dalsieho backendu staci implementovat interface Tomaj\Image\Backend\BackendInterface. Vsetky potrebne info je mozne vycitat z komentarov priamo v tomto interfaci a implemtnacii FileBackendu a S3Backendu

TODO - co by bolo dobre este doriesit

  1. Aktualne sa vsety thumby generuju napevno ako .jpg
  2. Treba doplnit funkcie pre mazanie obrazkov z backendu a upravu obrazku v backende

All versions of nette-images with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
nette/nette Version ~2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tomaj/nette-images contains the following files

Loading the files please wait ....