Download the PHP package sawastacks/kropify-codeigniter without Composer

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

!['Kropify'](img/kropify.jpg)

![GitHub release](https://img.shields.io/github/v/release/sawastacks/kropify-codeigniter) GitHub code size in bytes [![Total Downloads](https://poser.pugx.org/sawastacks/kropify-codeigniter/downloads)](https://packagist.org/packages/sawastacks/kropify-codeigniter) [![Package License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](LICENSE) GitHub Org's stars

Kropify

Sawa Stacks brought you easy cropping image tool for user profile picture, cover image, etc... that can be integrated into Codeigniter project.

NOTE: Kropify cannot be integrated into CodeIgniter framework only. It has another php version that can be integrated into Laravel Framework and Core PHP projects.

What is a Kropify?

A Kropify is a tool that can be integrated into CodeIgniter framework projects for the purpose of giving users easy way to crop their profile pictures and cover images. It uses JQuery 3.x library in it's functionality as dependency. That's why it is important to include JQuery library on current view file.

Requirements

Installation

This package can be installed through composer require. Before install this, make sure that your are working with PHP >= 7.2 in your system. Just run the following command in your cmd or terminal:

  1. Install the package via Composer:

  2. After Kropify package installed, you need to publish its css and js minified files in CodeIgniter public folder by running the following command in terminal:

Updating Package

When new Kropify version released and try to update the current package to the latest version, you will need to use composer update command:

After Kropify package updated, you need also to update its assets (css and js minified files) by running the following command in terminal:

Usage

This package uses css and js minified files, that is why you first need to include this package assets on your view php file. Call the following helper function inside <head> tag of your blade file to including Kropify css file on page.

For Kropify Js file, you need to call the following helper function inside <body> tag but before closing </body> tag after including JQuery as shown in below example.

Package initialization

Suppose that you have an input file on your form for user profile picture:

Routes

When you want to initiate Kropify on that particular input file, you will use the following scripts.

Options

Option Default Description
viewMode 1 You can set this value to (1,2 or 3). But you can not add this option if you are happy with the default value which is 1.
aspectRatio 1 You can add your custom cropped image ratio. You can use fractional numbers and float numbers. eg: 16/4, 10/32, 0.25, 2.25, etc... Default value is 1.
preview required This option is very required option. This is where you define the output element to preview the cropped image. Here, you must use jquery selector to select id="" or class="" of the img tag element where you want to display cropped image result.
cancelButtonText Cancel You can change this button text with your need and according to your language.
resetButtonText Reset You can change this button text with your need and according to your language.
cropButtonText Crop You can change this button text with your need and according to your language.
maxSize 2097152 By default, this value set to the maximum size of 2MB .But, you can set your own maximum size of selected image.
processURL - This option is very required. You must define your url of croping selected image. eg: processURL : "/crop" or _processURL : "<?= route_to("crop") ?>"_
showLoader true If you want to display loading element when user croping the selected image, you can set this option to true. But if you do not want that loading element appears on page, set this option to false.
animationClass pulse If you want to animate cropping area, you may use this option by choosing one of three animation classes allowed pulse,headShake,fadeIn and pulse. By default, this value set to pulse class.

Errors callback

This callback has two arguments, error and text

Parameter Description
error This prameter will return two types of errors invalidFileType and bigFileSize. You can make a if condition according to the returned error type.
text You can alert this value eg: alert(text);. If you are using Toastr.js plugin, You may use toastr.error(text)' function to display error alert.

In controller

To include Kropify class in controller is very simple. Just import the following lines on your controller.

To upload the cropped image you will use the following lines inside method:

The above lines will upload the cropped image in the specified path. The cropped image will be uploaded in CodeIgniter public folder Very important function on the chain is maxWoH(). This function will limit maximum dimensions (Width or Height) in px value of the uploaded image. If you do not need to compress and resize the cropped image, just do not add maxWoH() to the Kropify upload function chain.

Get Cropped/Uploaded image details

When cropped image uploaded successfully, you can get the uploaded image information like name, size, width and height. You can use these details when you need to store them into database. Below are examples of getting uploaded image details:

Not Supported

This package still in development, that is why you can not make two instances of this jquery plugin on single page.


Copyright and License

This was written by Sawa Stacks (sawastacks) and is released under the MIT License.

Copyright (c) 2024 - Sawa Stacks


All versions of kropify-codeigniter with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ^8.0
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 sawastacks/kropify-codeigniter contains the following files

Loading the files please wait ....