Download the PHP package tacnoman/thumcno without Composer

On this page you can find all versions of the php package tacnoman/thumcno. 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 thumcno

Build Status Code Climate

Thumcno - A Tacno Thumbnail Generator in runtime

Pre requisites

To use thumcno, you need install the php-gd first.

You must install composer too. [https://getcomposer.org/]

Installation

Based on timthumb: http://www.binarymoon.co.uk/projects/timthumb/

You can use for any projects with different domains.

How it works?

There are many solutions to crop images. I like the timthumb solution. The request goes to a php file with params. The crop happen in runtime and generate a cache file. The Thumcno project, add a security for this and reuse for multiple projects. It's veeeery easy to use! I'll show you!

First step:

You need to add your custom domain. You could run:

This command will generate a file called img.mydomain.com.ini in /app/apps directory. This file contains the custom configuration for this domain (example: cache directory, etc). This params will replace the params in default.ini (you can change it).

This is the default.ini.

You need to replace only the necessary.

See working in local machine

To see in your local machine, run this commands:

Running with Docker

Using with docker-compose

TODO THIS!

Now, go to your browser and open the url:

http://localhost:8888/?src=/dubai.jpg&w=200&h=200&q=80

You will see this:

Possible params

This list is the params that you can pass in url ($_GET):

parameter stands for values What it does
src source url to image Tells Thumbcno which image to resize
w width the width to resize to Remove the width to scale proportionally (will then need the height)
h height the height to resize to Remove the height to scale proportionally (will then need the width)
q quality 0-100 Compression quality. The higher the number the nicer the image will look. I wouldn’t recommend going any higher than about 95 else the image will get too large
a alignment c,t,l,r,b,tl,tr,bl,br Crop alignment. c = center, t = top, b = bottom, r = right, l = left. The positions can be joined to create diagonal positions
zc zoom/crop 0,1,2,3 Change the cropping and scaling settings
f filters too many to mention You can use the link above
s sharpen Apply a sharpen filter to the image, makes scaled down images look a little crisper
cc canvas colour hexadecimal color(#fff) Change background colour. Most used when changing the zoom and crop settings, which in turn can add borders to the image.
ct canvas transp true (1) Use transparency and ignore background colour
style thumb sizes string String to define the style of the size, for example, thumb=30x30, medium=200x200 and big=800x800

Set possible sizes

If you don't set the sizes, you could have a big security problem! Suppose that your URI is this <w>/<h>/<src>. A hacker could make a script to generate ALL POSSIBLE SIZES in cache. But, you can define the possible sizes to generate in your website. It's simple:

Now, you can generate thumbs only with sizes 30x30, 200x200 and 800x800. If you don't want to show the size in the URL, you can use the style (like paperclip for ruby).

The style will replace the size. An example for this config is:

http://<domain>/?src=dubai.jpg&style=medium -> Without friendly url. http://<domain>/medium/dubai.jpg -> Considering a friendly url, where the uri is /(?P<style>\w+)/(?P<src>(\w|-|\.)+).

URL Friendly

If you want to use friendly urls, you can set the params in your .ini file passing the URLS params. (You must know abour regex) The param is route and you can use the same url params in this format:

Bugs

Send-me an email: <[email protected]>.


All versions of thumcno with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
vlucas/phpdotenv Version ^2.4
symfony/console Version *
katzgrau/klogger Version dev-master
codeception/codeception 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 tacnoman/thumcno contains the following files

Loading the files please wait ....