Coder Social home page Coder Social logo

tck / zf-imageresizer Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 5.0 215 KB

This Laminas (Zend Framework) module allows image resizing and manipulation by url.

License: MIT License

PHP 100.00%
zf2 zf3 image manipulation image-manipulation php image-resizer image-resize resize thumbnail

zf-imageresizer's Introduction

ImageResizer

Latest Stable Version Build Status Scrutinizer Code Quality Code Coverage Total Downloads License

This Laminas module, once enabled, allows image resizing and manipulation by url.

Requirements

IMPORTANT! Version notes

  • Version 3.x: Laminas, dropped support for Zend Framework 3.
  • Version 2.x: Zend Framework 3, dropped support for Zend Framework 2.
  • Version 1.x: Zend Framework 2

Installation

Install via composer in your Laminas project

$ composer require tck/zf2-imageresizer

Post installation

  1. Enabling it in your application.config.php file.

    <?php
    return [
        'modules' => ]
            // ...
            'TckImageResizer',
        ],
        // ...
    ];
  2. Create "processed" folder in "public" folder.

Usage

Basic Syntax

All files in public folder

  • folder/filename.ext
  • processed/folder/filename.$command1,param1,param2$command2.ext

Example: Create a thumbnail and grayscale image

  • img/logo.jpg
  • processed/img/logo.$thumb,160,120$grayscale.jpg

View helper

Laminas tempalte:

<img alt="Example image" src="<?php echo $this->resize('img/logo.jpg')->thumb(200, 160)->grayscale(); ?>" />

Rendered HTML:

<img alt="Example image" src="/processed/img/logo.$thumb,200,160$grayscale.jpg" />

Command list

  • thumb(width, height)
  • resize(width, height)
  • grayscale
  • negative
  • gamma(correction)
  • colorize(hexColor)
  • sharpen
  • blur(sigma = 1)
  • 404(text = 'Not found', backgroundColor = 'F8F8F8', color = '777777', width = null, height = null) In view helper: ->x404(...) [text: url-safe base64] - \TckImageResizer\Util\UrlSafeBase64::encode($text)

Own commands possible - example place a watermark (Todo Documentation)

Goals / Todos

  • More commands
  • More command options
  • Administrative functions
  • Create placeholder

zf-imageresizer's People

Contributors

kokspflanze avatar tck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

zf-imageresizer's Issues

composer installation issue on ZF3

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Can only install one of: zendframework/zend-config[3.1.0, 2.6.0].
- Can only install one of: zendframework/zend-config[2.6.0, 3.1.0].
- Can only install one of: zendframework/zend-config[2.6.0, 3.1.0].
- tck/zf2-imageresizer v2.0.0 requires zendframework/zend-config ^2.6 -> satisfiable by zendframework/zend-config[2.6.0].
- Installation request for tck/zf2-imageresizer ^2.0 -> satisfiable by tck/zf2-imageresizer[v2.0.0].
- Installation request for zendframework/zend-config (locked at 3.1.0) -> satisfiable by zendframework/zend-config[3.1.0].

newest Version of ZF3 is installed on PHP7.

PackageList:

zendframework/zend-authentication            2.5.3   provides an API for authentication and includes concrete authentication adapters for common use case scenarios
zendframework/zend-cache                     2.7.2   provides a generic way to cache any data
zendframework/zend-code                      3.1.0   provides facilities to generate arbitrary code using an object oriented interface
zendframework/zend-component-installer       1.1.0   Composer plugin for automating component registration in zend-mvc and Expressive applications
zendframework/zend-config                    3.1.0   provides a nested object property based user interface for accessing this configuration data within application code
zendframework/zend-console                   2.6.0
zendframework/zend-crypt                     3.2.1
zendframework/zend-db                        2.9.0   Database abstraction layer, SQL abstraction, result set abstraction, and RowDataGateway and TableDataGateway implementations
zendframework/zend-debug                     2.5.1
zendframework/zend-developer-tools           1.1.1   Module for developer and debug tools for use with zend-mvc applications.
zendframework/zend-di                        2.6.1
zendframework/zend-dom                       2.6.0   provides tools for working with DOM documents and structures
zendframework/zend-escaper                   2.5.2
zendframework/zend-eventmanager              3.2.0   Trigger and listen to events within a PHP application
zendframework/zend-filter                    2.7.2   provides a set of commonly needed data filters
zendframework/zend-form                      2.11.0  Validate and display simple and complex forms, casting forms to business objects and vice versa
zendframework/zend-http                      2.7.0   provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests
zendframework/zend-hydrator                  2.3.1
zendframework/zend-i18n                      2.7.4
zendframework/zend-i18n-resources            2.5.2   Provides validator translations for zend-i18n's Translator
zendframework/zend-inputfilter               2.8.0   Normalize and validate input sets from the web, APIs, the CLI, and more, including files
zendframework/zend-json                      3.0.0   provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP
zendframework/zend-loader                    2.5.1
zendframework/zend-log                       2.9.2   component for general purpose logging
zendframework/zend-mail                      2.8.0   provides generalized functionality to compose and send both text and MIME-compliant multipart e-mail messages
zendframework/zend-math                      3.0.0
zendframework/zend-mime                      2.7.0   Create and parse MIME messages and parts
zendframework/zend-modulemanager             2.8.2   Modular application system for zend-mvc applications
zendframework/zend-mvc                       3.1.1   Zend Framework's event-driven MVC layer, including MVC Applications, Controllers, and Plugins
zendframework/zend-mvc-console               1.1.11
zendframework/zend-mvc-form                  1.0.0   Metapackage with all requirements needed to use zend-form with zend-mvc.
zendframework/zend-mvc-i18n                  1.0.0
zendframework/zend-mvc-plugin-fileprg        1.0.0
zendframework/zend-mvc-plugin-flashmessenger 1.0.0
zendframework/zend-mvc-plugin-identity       1.0.0
zendframework/zend-mvc-plugin-prg            1.0.0
zendframework/zend-mvc-plugins               1.0.1   Collection of all stable zend-mvc plugins served via separate packages.
zendframework/zend-navigation                2.8.2   provides support for managing trees of pointers to web pages
zendframework/zend-paginator                 2.8.0   zend-paginator is a flexible component for paginating collections of data and presenting that data to users.
zendframework/zend-permissions-acl           2.6.0   provides a lightweight and flexible access control list (ACL) implementation for privileges management
zendframework/zend-progressbar               2.5.2   component to create and update progressbars in different environments
zendframework/zend-router                    3.0.2
zendframework/zend-servicemanager            3.3.1
zendframework/zend-servicemanager-di         1.1.1
zendframework/zend-session                   2.8.3   manage and preserve session data, a logical complement of cookie data, across multiple page requests by the same client
zendframework/zend-stdlib                    3.1.0
zendframework/zend-test                      3.1.1
zendframework/zend-text                      2.6.0
zendframework/zend-uri                       2.5.2   a component that aids in manipulating and validating ┬╗ Uniform Resource Identifiers (URIs)
zendframework/zend-validator                 2.10.1  provides a set of commonly needed validators
zendframework/zend-view                      2.9.0   provides a system of helpers, output filters, and variable escaping
zfcampus/zf-development-mode                 3.1.0   Zend Framework development mode script

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.