PHPackages                             joomla-ua/juimage - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. joomla-ua/juimage

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

joomla-ua/juimage
=================

JUImage - library for render thumbs.

5.20(11mo ago)16725GPL-2.0-or-laterPHPPHP &gt;=8.1

Since Jan 10Pushed 11mo ago2 watchersCompare

[ Source](https://github.com/Joomla-Ukraine/JUImage)[ Packagist](https://packagist.org/packages/joomla-ua/juimage)[ Docs](https://joomla-ua.org)[ RSS](/packages/joomla-ua-juimage/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)DependenciesVersions (44)Used By (0)

JUImage v6
==========

[](#juimage-v6)

JUImage - library for render thumbs with support webp and avif.

Create thumbs for Joomla! extension or stand-alone use.

Demo (All thumbs)
-----------------

[](#demo-all-thumbs)

- [Sci314.com](https://sci314.com)
- [Львівська міська рада](https://city-adm.lviv.ua)
- [Високий замок](https://wz.lviv.ua)

Use in Joomla! Extension
------------------------

[](#use-in-joomla-extension)

- [JUNewsUltra](https://github.com/Joomla-Ukraine/JUNewsUltra)
- [JUMultiThumb](https://github.com/Joomla-Ukraine/JUMultiThumb)
- JURSSPublisher

Usage
-----

[](#usage)

### Stand-alone

[](#stand-alone)

#### Composer Install

[](#composer-install)

`composer require joomla-ua/juimage`

You can then later update using composer:

`composer update`

#### Code example

[](#code-example)

After installing, you need to require Composer's autoloader:

```
require_once('vendor/autoload.php');

$config['root_path'] = __DIR__;
$config['img_blank'] = 'images/logos';

$juImg = new JUImage\Image($config);
$thumb = $juImg->render('images/sampledata/fruitshop/apple.jpg', [
	'w'     => '300',
	'h'     => '100',
	'q'     => '77',
	'cache' => 'img'
]);

echo '';
```

Global optionsDescription`$root_path`Root path for your site. Default define `JPATH_BASE``$img_blank`Path to default image. For example if image not found display default image `noimage.png`. Use also option `error_image` if image not found or broken ([go to Option](#options))### Joomla! Integration

[](#joomla-integration)

#### Install

[](#install)

Install extention library (lib\_juimage\_v3.x.x.zip) using Joomla! Extension Manager.

#### Code example

[](#code-example-1)

Code for use in your extension.

```
JLoader::register('JUImage',  JPATH_LIBRARIES . '/juimage/JUImage.php');

$juImg = new JUImage();
$thumb = $juImg->render('images/sampledata/fruitshop/apple.jpg', [
	'w'     => '300',
	'h'     => '100',
	'q'     => '77',
	'cache' => 'img'
]);

echo '';
```

or

```
require_once(JPATH_SITE . '/libraries/juimage/vendor/autoload.php');

$juImg = new JUImage\Image();
$thumb = $juImg->render('images/sampledata/fruitshop/apple.jpg', [
	'w'     => '300',
	'h'     => '100',
	'q'     => '77',
	'cache' => 'img'
]);

echo '';
```

WebP support
------------

[](#webp-support)

```
