PHPackages                             atk14/pupiq-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. atk14/pupiq-client

ActiveLibrary[Image &amp; Media](/categories/media)

atk14/pupiq-client
==================

Pupiq client for ATK14 applications

v1.14.15(8mo ago)245.3k—2.6%21MITPHPPHP &gt;=5.6.0

Since May 24Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/atk14/PupiqClient)[ Packagist](https://packagist.org/packages/atk14/pupiq-client)[ Docs](https://github.com/atk14/PupiqClient)[ RSS](/packages/atk14-pupiq-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (46)Used By (1)

Client for [Pupiq](http://i.pupiq.net/)
=======================================

[](#client-for-pupiq)

It's designated to be integrated in ATK14 applications - i.e. applications powered by [ATK14 Framework](http://www.atk14.net).

Installation
------------

[](#installation)

Just use the Composer:

```
cd path/to/your/atk14/project/
composer require atk14/pupiq-client

ln -s ../../vendor/atk14/pupiq-client/src/app/fields/pupiq_image_field.php app/fields/pupiq_image_field.php
ln -s ../../vendor/atk14/pupiq-client/src/app/widgets/pupiq_image_input.php app/widgets/pupiq_image_input.php
ln -s ../../vendor/atk14/pupiq-client/src/app/fields/pupiq_attachment_field.php app/fields/pupiq_attachment_field.php
ln -s ../../vendor/atk14/pupiq-client/src/app/widgets/pupiq_attachment_input.php app/widgets/pupiq_attachment_input.php
ln -s ../../vendor/atk14/pupiq-client/src/app/fields/async_pupiq_attachment_field.php app/fields/async_pupiq_attachment_field.php
ln -s ../../vendor/atk14/pupiq-client/src/app/widgets/async_pupiq_attachment_input.php app/widgets/async_pupiq_attachment_input.php
ln -s ../../vendor/atk14/pupiq-client/src/app/helpers/modifier.img_url.php app/helpers/modifier.img_url.php
ln -s ../../vendor/atk14/pupiq-client/src/app/helpers/modifier.img_attrs.php app/helpers/modifier.img_attrs.php
ln -s ../../vendor/atk14/pupiq-client/src/app/helpers/modifier.img_height.php app/helpers/modifier.img_height.php
ln -s ../../vendor/atk14/pupiq-client/src/app/helpers/modifier.img_width.php app/helpers/modifier.img_width.php
ln -s ../../vendor/atk14/pupiq-client/src/app/helpers/modifier.img_color.php app/helpers/modifier.img_color.php
ln -s ../../vendor/atk14/pupiq-client/src/app/helpers/modifier.img_format.php app/helpers/modifier.img_format.php
ln -s ../../vendor/atk14/pupiq-client/src/app/helpers/modifier.pupiq_img.php app/helpers/modifier.pupiq_img.php

```

Configuration
-------------

[](#configuration)

Write your PUPIQ API KEY into config/settings.php

```
define("PUPIQ_API_KEY","1234567890abcdefghijklmopqrst");

```

Optionally the following constants can be defined:

```
define("PUPIQ_API_URL","https://i.pupiq.net/api/");
define("PUPIQ_LANG","cs");
define("PUPIQ_IMG_HOSTNAME","i.pupiq.net");
define("PUPIQ_HTTPS",true);
define("PUPIQ_DEFAULT_WATERMARK_DEFINITION","default");

```

Usage in templates
------------------

[](#usage-in-templates)

Consider an image in the original resolution 800x600. In the string variable $img there is URL to the image.

```
To preserve aspect ratio:
{!$img|pupiq_img:"80"} {* 80x60 *}
{!$img|pupiq_img:"x30"} {* 40x30 *}
{!$img|pupiq_img:"80x80"} {* 80x60 *}

To crop the image:
{!$img|pupiq_img:"!80x80"} {* 80x80 *}
{!$img|pupiq_img:"80x80xcrop"} {* 80x80 *}

Top crop image to the top or bottom line:
{!$img|pupiq_img:"80x80xcrop,top"} {* 80x80 *}
{!$img|pupiq_img:"80x80xcrop,bottom"} {* 80x80 *}

To preserve aspect ratio and fill the background size with a specific colour:
{!$img|pupiq_img:"80x80x#ffffff"} {* 80x80, the image is not cropped *}

To preserve aspect ratio and use transparent background:
{!$img|pupiq_img:"80x80xtransparent"} {* 80x80, the image is not cropped *}

Keep in mind that transparent background works only on PNG images.

Transparent background can be specified with a fallback background colour for JPG images:
{!$img|pupiq_img:"80x80xtransparent_or_#ffffff"} {* 80x80, the image is not cropped *}

To add some attributes to img tag:
{!$img|pupiq_img:"80x80,enable_enlargement":"class='image-icon',title='Nice icon',data-clickable"}

To set a specific format:
{!$img|pupiq_img:"80x80,format=png"}
{!$img|pupiq_img:"80x80,format=jpg"}

To add some attributes prepared as array (got from a controller for example):

class SomeController extends ApplicationController {
....
    $this->tpl_data["image_attributes_array"] = array(
        "class" => "image-icon",
        "title" => "Nice icon",
        "data-clickable" => true
    );
....
}

{!$img|pupiq_img:"80x80,enable_enlargement":$image_attributes_array}

To magnify:
{!$img|pupiq_img:"1600x1600"} {* 800x600, i.e. there is no magnification by default *}
{!$img|pupiq_img:"1600x1600,enable_enlargement"} {* 1600x1200 *}

To render a  tag by hand:

To determine image width and height:
Width is {$img|img_width:"80x80"} pixels
Height is {$img|img_height:"80x80"} pixels

```

### Detecting dominant colours

[](#detecting-dominant-colours)

Helper img\_color returns dominant colour in the given image.

```
{$img|img_color}

```

Name of the colour can be specified in the optional 2nd parameter.

Possible names are:

- vibrant
- light\_vibrant
- dark\_vibrant
- muted
- light\_muted
- dark\_muted

    {$img|img\_color:"light\_muted"}

In some special cases the requested color may not be returned.

```
{$img|img_color:"light_vibrant"|default:"#FFFFFF"}

```

It may be useful to specify multiple colors in the desired order.

```
{$img|img_color:"light_vibrant or light_muted or muted"|desired:"#FFFFFF"}

```

### Watermarks

[](#watermarks)

At first you need to create one or more watermark definitions at address [https://i.pupiq.net/api/cs/watermark\_definitions/create\_new/](https://i.pupiq.net/api/cs/watermark_definitions/create_new/)

The default watermark should be named "default". When you didn't mention the name of the watermark, "default" is used.

```
{!$img|pupiq_img:"600x600xcrop,watermark"} {* default *}
{!$img|pupiq_img:"600x600xcrop,watermark=default"} {* also default *}
{!$img|pupiq_img:"600x600xcrop,watermark=logo"} {* watermark definition named logo is used *}

```

Set up local proxy
------------------

[](#set-up-local-proxy)

With local proxy, images uploaded to the Pupiq are being cached and served from your server.

Here you can find guides how to set up a local proxy in your application.

```
cd path/to/your/atk14/project/
mkdir i a
chmod 777 i a
ln -s ../vendor/atk14/pupiq-client/src/i/error.php i/error.php
ln -s ../vendor/atk14/pupiq-client/src/i/.htaccess i/.htaccess
ln -s ../vendor/atk14/pupiq-client/src/a/error.php a/error.php
ln -s ../vendor/atk14/pupiq-client/src/a/.htaccess a/.htaccess

```

Add following lines to .gitignore:

```
i/*
!i/.htaccess
!i/error.php
a/*
!a/.htaccess
!a/error.php

```

Prevent dispatcher.php to handle requests starting with /i/ or /a/ by adding these lines before `RewriteRule (.*) dispatcher.php [L]`

```
RewriteCond %{REQUEST_URI} !^\/i\/
RewriteCond %{REQUEST_URI} !^\/a\/

```

So the given part of the .htaccess may look like:

```
RewriteCond %{REQUEST_URI} ^\/
RewriteCond %{REQUEST_URI} !^\/public\/
RewriteCond %{REQUEST_URI} !^\/server-status\/
RewriteCond %{REQUEST_URI} !^\/server-info\/
RewriteCond %{REQUEST_URI} !^\/i\/
RewriteCond %{REQUEST_URI} !^\/a\/
RewriteRule (.*) dispatcher.php [L]

```

Define constant PUPIQ\_PROXY\_HOSTNAME in config/settings.php:

```
definedef("PUPIQ_PROXY_HOSTNAME",$HTTP_REQUEST->getHttpHost() ? $HTTP_REQUEST->getHttpHost() : ATK14_HTTP_HOST);

```

or in a non-ATK14 application this way:

```
define("PUPIQ_PROXY_HOSTNAME","your.hostname.com");

```

License
-------

[](#license)

Pupiq Client is free software distributed [under the terms of the MIT license](http://www.opensource.org/licenses/mit-license)

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance76

Regular maintenance activity

Popularity32

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 95.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~84 days

Recently: every ~140 days

Total

40

Last Release

242d ago

PHP version history (3 changes)v1.0PHP &gt;=5.0.0

v1.4PHP &gt;=5.3.0

v1.14.8PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6304dffbd91d7a978f98632b0e4e30d662dcdb691daadb1388a58984e98faf5c?d=identicon)[yarri](/maintainers/yarri)

---

Top Contributors

[![yarri](https://avatars.githubusercontent.com/u/974278?v=4)](https://github.com/yarri "yarri (173 commits)")[![mysutka](https://avatars.githubusercontent.com/u/974669?v=4)](https://github.com/mysutka "mysutka (7 commits)")[![mattez](https://avatars.githubusercontent.com/u/143115?v=4)](https://github.com/mattez "mattez (1 commits)")

---

Tags

imageimagesatk14pupiq

### Embed Badge

![Health badge](/badges/atk14-pupiq-client/health.svg)

```
[![Health](https://phpackages.com/badges/atk14-pupiq-client/health.svg)](https://phpackages.com/packages/atk14-pupiq-client)
```

###  Alternatives

[jbzoo/image

A PHP class that simplifies working with images

171126.9k3](/packages/jbzoo-image)[andrewgjohnson/imagettftextblur

imagettftextblur is a drop in replacement for imagettftext with added parameters to add blur, glow and shadow effects to your PHP GD images

27198.4k1](/packages/andrewgjohnson-imagettftextblur)[ayvazyan10/nova-imagic

Imagic is a Laravel Nova field package that allows for image manipulation capabilities, such as cropping, resizing, quality adjustment, and WebP conversion. It utilizes the powerful Intervention Image class for image manipulation.

144.3k1](/packages/ayvazyan10-nova-imagic)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
