PHPackages                             kujjs/resize-image - 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. kujjs/resize-image

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

kujjs/resize-image
==================

Resize images with predefined sizes

v0.7(6y ago)11.5k1[3 issues](https://github.com/kujjs/resize-image/issues)[1 PRs](https://github.com/kujjs/resize-image/pulls)MITPHPPHP ^7.1.3

Since Jul 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/kujjs/resize-image)[ Packagist](https://packagist.org/packages/kujjs/resize-image)[ Docs](https://github.com/kujjs/resize-image)[ RSS](/packages/kujjs-resize-image/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (7)Used By (0)

Image Resizing Package for Laravel 5.\* (update 17/09/2017)
-----------------------------------------------------------

[](#image-resizing--package-for-laravel-5-update-17092017)

[![Laravel](https://camo.githubusercontent.com/7755a2a710430e4ec242fe3e19d94b9a6e319509042fcdd86b956ff5d3c8a575/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e2a2d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Based on **[anakadote/laravel-5-image-manager.](https://github.com/anakadote/ImageManager-for-Laravel-5)**

Resize images with predefined sizes in config / imageManager.php

Attention!!!!!!!!!!!!
=====================

[](#attention)

important changes were made in how to obtain the cropped images, please read the new documentation.
===================================================================================================

[](#important-changes-were-made-in-how-to-obtain-the-cropped-images-please-read-the-new-documentation)

If you don't want to replace the changes but want to use Auto-Discovery you can use version 5.5.0
=================================================================================================

[](#if-you-dont-want-to-replace-the-changes-but-want-to-use-auto-discovery-you-can-use-version-550)

Install
-------

[](#install)

Edit your project's composer.json

```
"require": {
    "anakadote/laravel-5-image-manager": "dev-master",
    "kujjs/resize-image": "^0.5.5.1"
}
```

Add the service provider. config/app.php

```
'providers' => [
    kujjs\imageManager\imageManagerServiceProvider::class, // optional, you can use Auto-Discovery
    Anakadote\ImageManager\ImageManagerServiceProvider::class,
];
```

If not use Auto-Discovery your add next alias in config/app.php

```
'aliases' => [
  ...
  'Image' => 'kujjs\imageManager\Facades\ImageManager',
];
```

And run the following command

```
$ php artisan vendor:publish
```

Usage
-----

[](#usage)

Set sizes in **config/imageManager.php**

```
    'sizes' => [
        'thumbnail' => [
          'width'   => 120,
          'height'  => 120,
            'mode'    => 'crop', || fit || fit-x || fit-y
            'quality' => 90
          ]
    ];
```

PropertyDescription`width`*required*The width of the generated image in pixels.`height`*required*The height of the generated image in pixels.`mode`*required*Defines the way the image will be transformed. See the table below for accepted modes`quality`*required*The quality that will have the final image. range 0-100
ModeDescription`crop`Will smart crop an image to make it fit the desired dimensions. It will cut content of the image off the top/bottom and sides if required to preserve the aspect ratio.`fit`Fit while maintaining aspect ratio`fit-x`Fit to the given width while maintaining aspect ratio`fit-y`Fit to the given height while maintaining aspect ratio**Image::make($file , $size='thumbnail'))**
-------------------------------------------

[](#imagemakefile--sizethumbnail)

```
     {{ Image::make(public_path('img/image.jpg'),'thumbnail') }}
OR
      {{ Image::make(public_path('img/image.jpg')) }}
```

Return

```
    img/120-120/crop/image.jpg
```

PropertyDescription`File`*required* *(string)*The fully qualified name of image file. The file must reside in your app's public directory. You'll need to grant write access by the web server to the public directory and its children`Size Name`*(optional)* *(string)*The name of the size that is defined in **config/imageManager.php**.get full url
------------

[](#get-full-url)

#### **toUrl()**

[](#tourl)

```
    {{ Image::make(public_path('img/image.jpg'),'thumbnail')->toUrl() }}
```

return

```
    http://mysite.dev/img/120-120/crop/image.jpg
```

Get tag img
-----------

[](#get-tag-img)

#### **toHtml( $attributes = \[\] )**

[](#tohtml-attributes---)

```
    {!! Image::make(public_path('img/image.jpg'),'thumbnail')->toHtml() !!}
```

Return

```

```

Or

```
    {!! Image::make(public_path('img/image.jpg'),'thumbnail')->toHtml(['class'=>'my-class','alt'=>'my alt','title'=>'my title', 'attributes'=>'values']) !!}
```

Return

```

```

PropertyDescription`attributes`*optional* *(array)*Attributes html you can inset in the tag imgRemove
------

[](#remove)

### **Image::delete($file)**

[](#imagedeletefile)

remove image with all size declarade in config/imageManager.php

```
    Image::delete(public_path('img/image.jpg'))
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~214 days

Recently: every ~268 days

Total

6

Last Release

2214d ago

PHP version history (2 changes)0.5.2.1PHP &gt;=5.6.4

v0.7PHP ^7.1.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11365598?v=4)[Nelson Jara](/maintainers/kujjs)[@kujjs](https://github.com/kujjs)

---

Top Contributors

[![kujjs](https://avatars.githubusercontent.com/u/11365598?v=4)](https://github.com/kujjs "kujjs (10 commits)")

---

Tags

phplaravelresizeimageskujjs

### Embed Badge

![Health badge](/badges/kujjs-resize-image/health.svg)

```
[![Health](https://phpackages.com/badges/kujjs-resize-image/health.svg)](https://phpackages.com/packages/kujjs-resize-image)
```

###  Alternatives

[intervention/image-laravel

Laravel Integration of Intervention Image

1558.1M160](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

506511.0k27](/packages/bkwld-croppa)[ralphjsmit/laravel-glide

Auto-magically generate responsive images from static image files.

4923.6k5](/packages/ralphjsmit-laravel-glide)[antennaio/laravel-clyde

Image uploads and manipulation for Laravel, a wrapper around Glide

302.6k](/packages/antennaio-laravel-clyde)[bjthecod3r/laravel-cloudflare-stream

A Laravel package for Cloudflare Stream.

203.5k](/packages/bjthecod3r-laravel-cloudflare-stream)[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.4k1](/packages/ayvazyan10-nova-imagic)

PHPackages © 2026

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